我是不熟悉Flutter的人,即使没有按下,我也想在textformfield中查看前缀文本。我的代码:
TextFormField(
decoration: InputDecoration(
prefix: Text("Subject: ",
style: TextStyle(color: Colors.black),),
hintText: "Unique Subject",
border: OutlineInputBorder(),
),
对不起img链接,我对stackoverflow还是陌生的,至今还没有达到10个声誉。
这是我的结果:
这是我想要的,甚至没有按下textformfield
谢谢
很少有解决方法。要了解更多信息,请使用此作为参考:https://github.com/flutter/flutter/issues/19488
prefixIcon: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text('Subject:',style: TextStyle(color: Colors.black),),
)
],),
hintText: "Unique Subject",
border: OutlineInputBorder(),