state property

  1. @override
Future<T> get state
override

Implementation

@override
Future<T> get state async {
  if (_error != null) {
    return Future.error(_error as Object);
  }
  final s = _notifier.state;
  if (s == null) {
    if (_getCompleter == null) {
      final completer = Completer<T>();
      _getCompleter = completer;
      return completer.future;
    } else {
      return _getCompleter!.future;
    }
  } else {
    return s;
  }
}