errorOrNull property

Object? get errorOrNull

The error, or null if not in error state.

Implementation

Object? get errorOrNull => switch (this) {
      AsyncError<T>(:final error) => error,
      _ => null,
    };