textDirection property

TextDirection? get textDirection

The default directionality of the text.

This controls how the TextAlign.start, TextAlign.end, and TextAlign.justify values of textAlign are resolved.

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.

After this is set, you must call layout before the next call to paint.

This and text must be non-null before you call layout.

Implementation

TextDirection? get textDirection => _textDirection;
set textDirection (TextDirection? value)

Implementation

set textDirection(TextDirection? value) {
  if (_textDirection == value) {
    return;
  }
  _textDirection = value;
  markNeedsLayout();
  _layoutTemplate?.dispose();
  _layoutTemplate = null; // Shouldn't really matter, but for strict correctness...
}