text property

AttributedText get text

Implementation

AttributedText get text => _text;
set text (AttributedText newValue)

Implementation

set text(AttributedText newValue) {
  if (newValue != _text) {
    _switchText(newValue);

    // Ensure that the existing selection does not overshoot
    // the end of the new text value
    if (_selection.end > _text.length) {
      _selection = _selection.copyWith(
        baseOffset: _selection.affinity == TextAffinity.downstream ? _selection.baseOffset : _text.length,
        extentOffset: _selection.affinity == TextAffinity.downstream ? _text.length : _selection.extentOffset,
      );
    }

    notifyListeners();
  }
}