您可以使用prefixIcon
的InputDecorator
属性显示某个图形。
TextField(
decoration: InputDecoration(
prefixIcon: SizedBox(
width: 50,
child: Center(
child: Text(
'+91',
style: TextStyle(color: Colors.black),
),
),
),
),
),
您也可以使用prefix
属性,但是如果文本字段未聚焦,则文本将消失。