errorOrNull property

Object? get errorOrNull

Gets the error if in error state, null otherwise

Implementation

Object? get errorOrNull => switch (this) {
  AsyncError(:final error) => error,
  AsyncLoading() || AsyncData() => null,
};