

Finally, we also learned what are the different ways to add colors. In this tutorial, we learned how to change TextField cursor color in Flutter with practical examples, we first saw how to change the color at the page level and then explored the way to change color at the app level. 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),.

See alsoUse profiles to change the look of Terminal windows on MacChange. Color(0xffF02E65): This is used to have a custom color. To change the color of the cursor, click the Cursor color well, then select a color.Colors.red: This is used to define from the predefined colors. Other projects by Blife Team that you definitely should check out A fun idle clicker game about a simple guy willing to become a Custom Cursor hero Cursor-Man and his adventures.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.
