Text Widget
Text is the basic widget in Flutter used to display string.
Text Properties
- fontSize
- color
- fontWeight
- fontStyle
- fontfamily
- letterSpacing
- wordSpacing
- backgroundColor
Example
import 'package:flutter/material.dart';
void main(List<String> args) {
runApp(MaterialApp(
home: Scaffold(
backgroundColor: Colors.green,
appBar: AppBar(
backgroundColor: Colors.black,
title: const Text("Weather App"),
centerTitle: true,
),
body: const Center(
child: Text(
"Welcome to Flutter",
style: TextStyle(
fontSize: 40,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 59, 8, 4),
backgroundColor: Colors.amber,
fontStyle: FontStyle.italic,
decoration: TextDecoration.underline,
// letterSpacing: 15,
wordSpacing: 15,
),
)),
),
));
}
No comments:
Post a Comment