Text is a Flutter widget that displays a string on screen using a single, uniform style, making it the default way to render any label, heading, or paragraph in a Material or Cupertino app.
For text that requires multiple styles within the same block, Text.rich accepts a TextSpan tree instead of a plain string. Unlike TextField, which allows users to enter and edit text, Text is used to display fixed, non-editable text.
style property takes a single TextStyle; for mixed styles in one block, use Text.rich with TextSpan instead.overflow determines how text is handled when it exceeds the available space: clip, fade, ellipsis, or visible.softWrap determines whether text can wrap onto multiple lines, while maxLines limits the number of lines that can be displayed.textScaleFactor is deprecated in favor of textScaler, which supports nonlinear text scaling for accessibility.Text inherits its style from the nearest DefaultTextStyle.Pass a TextStyle to style for color, size, and weight.
import 'package:flutter/material.dart';
class SectionHeading extends StatelessWidget {
const SectionHeading({super.key, required this.label});
final String label;
@override
Widget build(BuildContext context) {
return Text(
label,
style: const TextStyle(
color: Colors.deepPurple,
fontSize: 20,
fontWeight: FontWeight.w600,
),
);
}
}For app-wide consistency, prefer using styles from Theme.of(context).textTheme rather than hardcoding the same TextStyle across multiple widgets.
Use softWrap, maxLines, and overflow to control how Text behaves when its content does not fit the available space. By default, text can wrap onto multiple lines. Set softWrap: false to prevent wrapping and keep the text on a single line.
For example, to limit a description to two lines and show an ellipsis when additional text does not fit:
Text(
'A long product description that should truncate cleanly '
'instead of overflowing the card layout underneath it.',
maxLines: 2,
overflow: TextOverflow.ellipsis,
),Here, maxLines: 2 limits the text to two lines, while TextOverflow.ellipsis displays an ellipsis when the text cannot fit within those lines.
Keep in mind that Text needs appropriate constraints from its parent to determine when text overflows. For example, when placing text inside a Row, wrap it with Expanded or Flexible if it needs to use the remaining horizontal space:
Row(
children: [
const Icon(Icons.info),
const SizedBox(width: 8),
Expanded(
child: Text(
'A long piece of text that needs to fit inside the row.',
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
],
),Without appropriate width constraints, maxLines and overflow may not behave as expected, and a Row can produce a horizontal overflow.
Text.rich with TextSpan, or RichText directly for lower-level control.RichText inside a Wrap handles that better than Text alone.Theme.of(context).textTheme instead of hardcoding TextStyle values across screens.maxLines and overflow deliberately when text needs to fit within a constrained layout. Use maxLines to limit the number of lines and overflow to control how content that does not fit is handled.textScaler, not the deprecated textScaleFactor, when a widget needs to respond to system font scaling manually.Text.rich for mixed formatting or interactive spans within a paragraph instead of composing it from multiple Text widgets. Individual TextSpans can have their own styles and GestureRecognizers for interactions such as links or tappable phrases.semanticsLabel when the visual representation does not convey the intended meaning to assistive technologies, such as when text uses symbols, abbreviations, or decorative characters that may not be read as intended.textScaleFactor instead of textScaler. textScaleFactor is deprecated as of Flutter 3.12; use textScaler for programmatic control over text scaling.Text directly inside a Row without constraining its width. This can cause a RenderFlex overflow when the text is longer than the available space. overflow: TextOverflow.ellipsis alone does not provide the missing constraint. Wrap the Text in Expanded or Flexible first; then use maxLines and overflow to control how text that does not fit is handled.overflow unset when text may exceed a fixed-width constraint. The default is TextOverflow.clip, so content that does not fit may be clipped without an explicit visual indication that text is missing. Use an appropriate overflow value, such as TextOverflow.ellipsis, when truncation should be visible.Text widgets in a Row to mix styles. For text that should flow as a single paragraph, use Text.rich with TextSpan instead.
Flutter is known for its seamless UI/UX features and robust design elements. It allowed us to deliver a unique customer experience in the “CA24 Mobile” banking app. This article shares some of the learnings and pain points behind implementing it in this large project.

Find the most important things to keep in mind when introducing RTL design in your Flutter mobile app and how you can use Flutter to support various text directions with little effort. Follow the guide on RTL prepared by Flutter Developer.