Doing UI for a flutter app at uni, I just want the text typed into the TextFormField to be white. It seems unnecessarily difficult. I've tried googling etc but can't see an obvious answer.
new Theme(
// this colors the underline
data: theme.copyWith(
primaryColor: Colors.white,
hintColor: Colors.transparent,
),
child: new Padding(
padding: const EdgeInsets.fromLTRB(32.0, 40.0, 32.0, 4.0),
child: TextFormField(
key: Key('username'),
keyboardType: TextInputType.text,
controller: usernameController,
decoration: InputDecoration(
fillColor: Colors.black.withOpacity(0.6),
filled: true,
border: new OutlineInputBorder(
borderRadius: const BorderRadius.all(
const Radius.circular(8.0),
),
borderSide: new BorderSide(
color: Colors.transparent,
width: 1.0,
),
),
labelText: 'Username',
labelStyle:
new TextStyle(color: Colors.white, fontSize: 16.0)),
style:
TextStyle(fontSize: 20.0, color: textTheme.button.color),
validator: validateUserName,
onSaved: (val) => this.loginFields._username = val),
),
),
question from:
https://stackoverflow.com/questions/52603494/how-to-change-textformfield-input-text-color-in-flutter 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…