我试图定义输入装饰来改变输入文本字段下划线的颜色。但它不起作用。谁能建议我在这里缺少什么?
这是代码片段:
decoration: InputDecoration(
hintText: 'Username',
hintStyle: TextStyle(color: Colors.white),
border: new UnderlineInputBorder(
borderSide: BorderSide(color: Colors.white,
width: 1.0, style: BorderStyle.none ),
),
最佳答案
decoration: InputDecoration(
hintText: 'Username',
hintStyle: TextStyle(color: Colors.white),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide(
color: Colors.white,
width: 1.0,
style: BorderStyle.none
),
),
),
只需将 border 更改为 enabledBorder
。希望对您有所帮助!
https://stackoverflow.com/questions/51373884/