How to Set Text Color in Flutter iOS Android Example

Text widget supports Text Styling which supports color property. We can pass here color code in different formats like Hex Colo code, Inbuilt color constants and RGB color codes. So in this tutorial we would create a flutter application and Set Text Color in Flutter iOS Android Example Tutorial.

Contents in this project Set Text Color in Flutter iOS Android Example:

1. Import material.dart package in your app’s main.dart file.

2. Call our main MyApp widget class using void main runApp() function.

3. Create MyApp class extends with StatelessWidget.

4. Create Widget Build method in MyApp class with Scaffold default layout widget.

5. Crete Center widget -> Column widget in SafeArea widget. Column widget supports multiple children.

6. Create 3 Text widget in Column widget with text style color.

  • Color(0xffFF1744) : Here 0xff + Hex color code.
  • Colors.green : Inbuilt color constants.
  • Color.fromARGB(255, 66, 165, 245) : ARGB color code.

7. Complete source code for main.dart file:

Screenshot:

Set Text Color in Flutter iOS Android Example

Leave a Reply

Your email address will not be published. Required fields are marked *