我们正在使用内置于flutter中的步进器,我们想将输入文本的颜色更改为白色,默认情况下为黑色:这是代码:
List<Step> steps = [
new Step(
title: const Text('First Name', style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, fontSize: 19.0 )),
isActive: true,
state: StepState.indexed,
content: new TextFormField(
focusNode: _focusNode,
keyboardType: TextInputType.text,
autocorrect: false,
onSaved: (String value) {
data.firstname = value;
},
maxLines: 1,
validator: (value) {
if (value.isEmpty || value.length < 1) {
return 'Please enter first name';
}
},
decoration: new InputDecoration(
labelText: 'Enter your first name',
icon: const Icon(Icons.person, color: Colors.white),
labelStyle:
new TextStyle(decorationStyle: TextDecorationStyle.solid,color: Colors.white, fontSize: 16.0))
),
),
答案 0 :(得分:1)
您可以使用此代码。
TextField(
style: new TextStyle(color: Colors.white),
...