【问题标题】:How to add separator between leading icon and text in textfield in flutter如何在颤动的文本字段中的前导图标和文本之间添加分隔符
【发布时间】:2020-04-02 06:45:50
【问题描述】:

如何在文本和前导 ico 之间添加分隔符或分隔符

 TextField(
          decoration: InputDecoration(
            prefixIcon: Icon(Icons.perm_identity ),
            labelText: 'Enter Your Name',
          )
        )

【问题讨论】:

    标签: flutter flutter-layout flutter-dependencies flutter-animation flutter-listview


    【解决方案1】:

    您可以尝试将图标包装在容器中并为其添加边框。

    Container(
      margin: const EdgeInsets.all(15.0),
      padding: const EdgeInsets.all(3.0),
      decoration: BoxDecoration(
        border: Border(left: 
            BorderSide( //                   <--- left side
                color: Colors.black,
                width: 3.0,
            ),
          ),
          child: Icon(Icons.perm_identity),
        ),
    ),
    

    参考文献

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-04
      • 1970-01-01
      • 2020-01-18
      • 2021-02-06
      • 1970-01-01
      • 2020-06-29
      • 2021-08-11
      • 1970-01-01
      相关资源
      最近更新 更多