textDirection property
The directionality of the text.
This decides how textAlign values like TextAlign.start and TextAlign.end are interpreted.
This is also used to disambiguate how to render bidirectional text. For example, if the text is an English phrase followed by a Hebrew phrase, in a TextDirection.ltr context the English phrase will be on the left and the Hebrew phrase to its right, while in a TextDirection.rtl context, the English phrase will be on the right and the Hebrew phrase on its left.
Defaults to the ambient Directionality, if any.
This does not affect the direction of the decoration's InputDecoration.hintText or InputDecoration.labelText.
To override the direction for the entire field (including the hint, label, and prefix/suffix icons), wrap the TextField in a Directionality widget.
See also:
- InputDecoration.hintTextDirection, which specifically controls the hint.
- InputDecoration.labelTextDirection, which specifically controls the label.
- Directionality, which provides the default direction for the subtree.
Implementation
final TextDirection? textDirection;