在颤振中更改步进器输入文本的颜色



我们正在使用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))
),
),

您可以使用此代码。

TextField(
style: new TextStyle(color: Colors.white),
...

最新更新