

omARGB(255, 66, 125, 145): This is used to have color from the alpha, red, green, and blue color combination.ĬursorColor: omARGB(255, 66, 125, 145),.Color(0xffF02E65): This is used to have a custom color.Colors.red: This is used to define from the predefined colors.There are main three ways you can add color to the TextField cursor widget. TextSelectionTheme: TextSelectionThemeData( Step 4: Inside the TextSelectionThemeData add the cursorColor parameter and provide the color. Step 3: Inside the ThemeData add the textSelectionTheme parameter and then assign the TextSelectionThemeData. Step 2: Inside the MaterialApp, add the theme parameter with ThemeData class assigned. You can change the TextField cursor color globally by defining the TextSelectionThemeData and then adding cursorColor property.
