我正在尝试将文本字段更新为使用红色而不是绿色/蓝色。这是我目前的状态。
这是我的代码:
TextField(
focusNode: focusNode,
autocorrect: false,
autofocus: false,
style: TextStyle(color: Colors.white),
cursorColor: Colors.white,
decoration: InputDecoration.collapsed(
hintStyle: TextStyle(color: Colors.white),
hintText: "FirstName"),
)
答案 0 :(得分:1)
https://docs.flutter.io/flutter/material/ThemeData/textSelectionHandleColor.html
final theme = Theme.of(context);
return Theme(data: theme.copyWith(
textSelectionHandleColor: Colors.red,
child: TextField(
focusNode: focusNode,
autocorrect: false,
autofocus: false,
style: TextStyle(color: Colors.white),
cursorColor: Colors.white,
decoration: InputDecoration.collapsed(
hintStyle: TextStyle(color: Colors.white),
hintText: "FirstName"),
)
)