You will need to modify the ThemeData of your app which can be done either by wrapping your app with a Theme widget, or by setting the theme property of the MaterialApp widget. Here is a sample as how you can use the latter mentioned approach to achieve your requirement:
return MaterialApp(
theme: ThemeData(
primarySwatch: Colors.red,
textSelectionTheme: TextSelectionThemeData(
cursorColor: Colors.red, // Change the cursor color. Change red to blue or as per your requirement
selectionHandleColor: Colors.red, // Change the selection handle color
selectionColor: Colors.red.withOpacity(0.5), // Change the text selection color
),
),
// ...Rest of code
3
Answers
In your
MaterialApp
, you can change theselectionHandleColor
for theTextSelectionThemeData
:Change the
primarySwatch
color ofThemeData
inMaterialApp
of your root widget tree:You will need to modify the
ThemeData
of your app which can be done either by wrapping your app with a Theme widget, or by setting the theme property of theMaterialApp
widget. Here is a sample as how you can use the latter mentioned approach to achieve your requirement:DARTPAD DEMO