How to change the icon cursor of Textfield in Flutter?
(This image is screen shoot on Android)
I want to change the icon or change colour of the cursor.
How to change the icon cursor of Textfield in Flutter?
(This image is screen shoot on Android)
I want to change the icon or change colour of the cursor.
textSelectionHandleColor is deprecated and shouldn't be used.
Use TextSelectionThemeData.selectionHandleColor instead.
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
...
textSelectionTheme: TextSelectionThemeData(selectionHandleColor: Colors.black),
...
);
}
You mean the handler selector, not the cursor, right?
Yo can apply that change using textSelectionHandleColor in the root of your app using ThemeData.
I don't think it is possible for individual TextField
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
textSelectionColor: Colors.yellow,
textSelectionHandleColor: Colors.red)
);
}
ThemeData(
textSelectionTheme: TextSelectionThemeData(
cursorColor: pink,
selectionHandleColor: pink,
selectionColor: pink
)
);