【问题标题】:How to create a text border with embedded text and how to add multiple text fields inside the box?如何创建带有嵌入文本的文本边框以及如何在框中添加多个文本字段?
【发布时间】:2021-02-20 00:33:01
【问题描述】:

我想实现以下文本框,但我被卡住了。我已经添加了带有嵌入文本的边框,但我无法在有边框的框中添加多个文本字段,例如屏幕截图。请帮忙。 this is what I want to achieve

【问题讨论】:

  • 显示你迄今为止尝试过的...

标签: flutter flutter-layout flutter-animation flutter-design


【解决方案1】:

展示你已经尝试过的东西?

对于文本,您可以使用TextSpan

块引用

【讨论】:

    【解决方案2】:

    试试这个!

           Stack( children: [
              Padding(
                padding: const EdgeInsets.only(top: 10),
                child: Container(height: 180, child: Padding(
                  padding: const EdgeInsets.only(top: 35,left: 15),
                  child: Column(children: [
                    Row(children: [
                      Text("Full Name:",style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),)
                     , Text("Mark"),
                    ],),
                    SizedBox(height: 15,),
                    Row(children: [
                      Text("Email:",style: TextStyle(fontWeight: FontWeight.bold),)
                      , Text("email@gmail.com"),
                    ],),
                    SizedBox(height: 15,),
                    Row(children: [
                      Text("Phone:",style: TextStyle(fontWeight: FontWeight.bold),)
                      , Text("036526494"),
                    ],),
                    SizedBox(height: 15,),
                    Row(children: [
                      Text("Address:",style: TextStyle(fontWeight: FontWeight.bold),)
                      , Text("Random Address,city,Country"),
                    ],),
    
                  ],),
                ),
                  width: MediaQuery.of(context).size.width,
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(8),
                      border: Border.all(width: 1)),
                ),
              ),
              Padding(
                padding: const EdgeInsets.only(left: 20),
                child: Container(
                    color: Colors.white,
                    child: Padding(
                      padding: const EdgeInsets.symmetric(horizontal: 10),
                      child: Text(
                        "Contact Info",
                        style: TextStyle(
                            fontWeight: FontWeight.bold, fontSize: 18),
                      ),
                    )),
              ),
            ],
          )
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-23
      • 1970-01-01
      • 2014-01-16
      • 1970-01-01
      • 2022-07-07
      • 2022-01-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多