【问题标题】:change color of stepper input text in flutter在颤动中更改步进输入文本的颜色
【发布时间】:2019-12-16 16:25:54
【问题描述】:

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

【问题讨论】:

    标签: flutter dart


    【解决方案1】:

    您可以使用此代码。

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

    【讨论】:

      猜你喜欢
      • 2021-01-18
      • 2019-04-19
      • 2023-01-02
      • 2021-12-14
      • 1970-01-01
      • 2020-11-18
      • 2021-03-09
      • 2020-09-08
      • 1970-01-01
      相关资源
      最近更新 更多