小编Nov*_*evi的帖子

在 Theme 中设置 TextFromField 样式

因此,在我的 flutter 应用程序中,我创建 TextFormField 用作输入,如下所示(并将其返回到脚手架中):

final password = TextFormField(
      controller: passController,
      autofocus: false,
      obscureText: true,
      decoration: InputDecoration(hintText: 'Password'),
      style: new TextStyle(color: Colors.orange),
);
Run Code Online (Sandbox Code Playgroud)

我想更改stylea 内的属性themeData,但找不到要指定的属性。

我能找到的最接近的一个是textTheme: new TextTheme(body1: new TextStyle(color: Colors.orange)),但是这个对我的 TextFormField 没有任何作用。

如何设置 TextFormField 样式?请帮忙,我对 Dart 和编程都很陌生。我现在 13 岁,没有人能帮我解决这些事情。

PS:如果需要,完整的代码位于 GitHub 上: https: //github.com/Legolaszstudio/novynotifier

dart flutter flutter-layout

13
推荐指数
3
解决办法
1万
查看次数

标签 统计

dart ×1

flutter ×1

flutter-layout ×1