[英]How to change the color of the text being entered in text field?
如何更改此代码中的颜色
Alert Dialog(
backgroundColor: Color(0xFF161619),
title: Text('Enter Your Name',
style: TextStyle(color: Colors.white, fontSize: 25.0)),
content: Row(
children: [
Expanded(
child: TextField(
autofocus: true,
decoration: InputDecoration(
labelText: 'Name',
labelStyle: TextStyle(
color: Colors.white,
fontFamily: 'abel',
fontSize: 20.0),
hintText: 'eg. Raakib Zargar'),
onChanged: (value) {
teamName = value;
},
))
],
),
将 TextStyle 添加到 TextField 并提供color
属性:
Alert Dialog(
backgroundColor: Color(0xFF161619),
title: Text('Enter Your Name',
style: TextStyle(color: Colors.white, fontSize: 25.0)),
content: Row(
children: [
Expanded(
child: TextField(
see here ---> style: TextStyle(color: Colors.red),
autofocus: true,
decoration: InputDecoration(
underline color ---> enabledBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.red),),
focusedBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.green),),
labelText: 'Name',
labelStyle: TextStyle(
color: Colors.white,
fontFamily: 'abel',
fontSize: 20.0),
hintText: 'eg. Raakib Zargar'),
onChanged: (value) {
teamName = value;
},
))
],
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.