error property

  1. @override
Object get error
override

The error of a failed initialization.

Throws a StateError when there is none.

Implementation

@override
Object get error => switch (model.state) {
      AsyncScopeWaiting() ||
      AsyncScopeProgress() ||
      AsyncScopeReady() =>
        throw StateError('No error'),
      AsyncScopeError(:final error) => error,
    };