嘿,在我的应用程序中,我有一些TextFormField。我想用MaterialApp()中的一个主题来定义它们的主题。我读到过FocusColor是次要颜色,但在我的情况下,focusColor是青色,尽管我从未定义过。下面是我的主题:
runApp(MaterialApp(
theme: theme.copyWith(
colorScheme: theme.colorScheme.copyWith(
primary: globals.primaryColor,
secondary: globals.highlightColor,
background: globals.backgroundColor,
),
),
));
下面是我的文本表单字段:
TextFormField(
style: TextStyle(color: globals.darkText, fontWeight: FontWeight.bold),
decoration: textInputDecoration.copyWith(
hintText: "Name",
hintStyle: TextStyle(color: globals.backgroundColor, fontWeight: FontWeight.bold),
focusColor: globals.highlightColor,
fillColor: globals.primaryColor,
),
onSaved: (input) => _name = input,
),
另外,光标总是深蓝色的,我也不知道该在哪里改变颜色。谢谢你的回答!
1条答案
按热度按时间06odsfpq1#
请尝试使用此: