我正在使用Flutter SDK开发应用程序.当我使用TextField小部件时,我将其聚焦,下划线变为蓝色.我需要将此颜色更改为红色,我该怎么办?
我需要改变的截图.我只想更改下划线,而不是标签颜色.

我试图找到一个解决方案,在加载视图延迟后打开一个视图.我有一个视图,其中有一个按钮,当我按下它时,该onPressed()方法触发一个Navigator.of(Context).pushNamed("/loading").这将打开加载视图.在加载视图中,我有一个函数,使延迟为1.5秒,然后打开主视图,这是代码:
Future delay() async{
await new Future.delayed(new Duration(milliseconds: 1500), ()
{
Navigator.of(context).pushNamed("/home");
}
Run Code Online (Sandbox Code Playgroud)
但是,当延迟开始时,1.5秒后,它会打开Home视图,但是有以下异常:
I/flutter ( 5226): ??? EXCEPTION CAUGHT BY WIDGETS LIBRARY ????????????????????????????????????????????????????????????
I/flutter ( 5226): The following assertion was thrown building IconTheme(color: Color(0xff000000)):
I/flutter ( 5226): Multiple widgets used the same GlobalKey.
I/flutter ( 5226): The key [LabeledGlobalKey<ScaffoldState>#a0051] was used by multiple widgets. The parents of those
I/flutter ( 5226): widgets were different widgets that both had the following description:
I/flutter ( 5226): IconTheme(color: …Run Code Online (Sandbox Code Playgroud)