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)),
);
}
}
- Color is set to green.
- Font weight is set to bold.
Output
Click to Enlarge