text property

String? text

Implementation

String? get text {
  if (_text != null) {
    return _text;
  }

  dynamic value;

  if (_object != null) {
    value = _object.toString();
  } else if (_function != null) {
    value = _function!();
  } else if (_elementProvider != null) {
    value = _elementProvider!.element!.text;
  } else if (_intlKey != null) {
    value = _intlKey!.message;
  } else {
    throw StateError("Can't provide a text: $this");
  }

  var text = value != null ? value.toString() : '';

  if (singleCall) {
    _text = text;
  }

  return text;
}