Text Align
Use text-{alignment} utilities to set the horizontal alignment of text within its container.
Basic example
Section titled “Basic example”Use text-left, text-center, text-right, and text-justify to set the alignment of text:
Style('text-left', child: Text('So I started to walk into the water...'))Style('text-right', child: Text('So I started to walk into the water...'))Style('text-center', child: Text('So I started to walk into the water...'))Style('text-justify', child: Text('So I started to walk into the water...'))Using logical properties
Section titled “Using logical properties”Use text-start and text-end, which use logical properties to map to either
the left or right side based on the text direction:
Style('text-end', child: Text('فبدأت بالسير نحو الماء...'))Class reference
Section titled “Class reference”| Class | Flutter equivalent |
|---|---|
text-left | TextAlign.left |
text-center | TextAlign.center |
text-right | TextAlign.right |
text-justify | TextAlign.justify |
text-start | TextAlign.start |
text-end | TextAlign.end |