Create Apply CSS Style on Text in Flutter Like React Native & HTML

CSS also known as Cascading Style Sheet is one the most famous way to make text or widgets beautiful in Flutter. Using CSS Style we can prepare a set of code for single time and use them again and again as we required. CSS works like a function create once and use many times. So in this tutorial we would Create Apply CSS Style on Text in Flutter Like React Native & HTML Android iOS Example Tutorial.

Contents in this project Create Apply CSS Style on Text in Flutter Like React Native & HTML Android iOS Example Tutorial:

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

2. Create void main runApp() method and here we would call our main MyApp class.

3. Create our main class named as MyApp extends with StatelessWidget .

4. Create a final type TextStyle named as textStyleBlue and textStyleGreen. We would define text color, font size and font weight on text using this style.

5. Creating Widget Build area in MyApp class. Now we would make Scaffold widget -> Center widget -> Column widget.

6. Creating 4 Text widget wrap in Padding widget. Now we would call our above created text style in Style.

7. Complete source code for main.dart file:

Screenshot:

Create Apply CSS Style on Text in Flutter Like React Native & HTML

Leave a Reply

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