FutureSnapshot<T>.error constructor

const FutureSnapshot<T>.error(
  1. Object error, [
  2. StackTrace? stackTrace
])

Creates an FutureSnapshot in error state.

The parameter error cannot be null.

Implementation

const FutureSnapshot.error(
  Object error, [
  this.stackTrace,
  // ignore: prefer_initializing_formals
])  : error = error,
      data = null,
      state = AsyncSnapshotState.error;