如何在前导图标和文本字段中的文本之间添加分隔符

问题描述 投票:-2回答:1

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

 TextField(
          decoration: InputDecoration(
            prefixIcon: Icon(Icons.perm_identity ),
            labelText: 'Enter Your Name',
          )
        )
flutter flutter-layout flutter-dependencies flutter-animation flutter-listview
1个回答
0
投票

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

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),
    ),
),

参考

© www.soinside.com 2019 - 2024. All rights reserved.