Articles → FLUTTER AND DART → Text Widget In Flutter

Text Widget In Flutter






Purpose





Example




import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(home: Text("Hello", style: TextStyle(color: Colors.green, fontWeight: FontWeight.bold)),

    );
  }
}




  1. Color is set to green.
  2. Font weight is set to bold.

Output


Picture showing the output of Text widget in flutter
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, August 12, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250