Text widget in Flutter

The text widget is used to display a short piece of textual information on the App screen. It is part of the Flutter framework widgets and allows you to customize the appearance and style of the displayed text.
The Text can be used to display static text or dynamic text based on user input or Online Data. The flexibility of the Text widget makes it suitable for various use cases, including paragraphs, labels, buttons, and many more.

When we run the app in the emulator or device then this view show:

text widget in flutter

Some essential properties of the Text widget used in our App:

TextAlign: This is used to specify text is aligned horizontally.

TextDirection: We write text from left to right, with the help of this we can change it using this parameter.

Overflow: It is used to determine when the text will not fit in the available space. It means we have specified more text than the available space.

MaxLines: It is used to determine the maximum number of lines displayed in the text widget.

Style: It is the most common property of this widget that allows developers to style the text. It can do styling by specifying by using background color, font size, font weight, letter and word spacing, locale, shadows and many more.

See Example of Text widget in flutter.

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
const MyApp({super.key});
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
home: const MyHomePage(title: 'Flutter Demo Home Page'),

class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;

State<MyHomePage> createState() => _MyHomePageState();

class _MyHomePageState extends State<MyHomePage> {

Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
body: Center(
child: Text("Text Demo")

Related Posts

Unlocking Potential: Creating Any App with Flutter - How and Why?
Decoding Flutter: Is Coding Essential for App Success?
Unlocking Potential: Creating Any App with Flutter - How and Why?
Flutter Essentials: A Beginner’s Guide – Why Should You Start Here?
Inside Google's Plan: The Journey Behind Flutter's Rise - What You Should Know
Discovering Flutter: Who Can Benefit and How in the Digital World?
Flutter: Opening Doors to Exciting Careers - How Does it Work?
Exploring Flutter: From Crafting Apps to Transforming Web Development
Flutter Architecture
Exploring Container Widget in Flutter
How to make a phone call from a Flutter app
How to add AdMob ads in the Flutter
Scroll to Top