err<T> function
Creates an AsyncSnapshot with an error (equivalent to Result.err)
Example:
final result = err<int>(Exception('Something went wrong'));
print(result.error); // Exception: Something went wrong
Implementation
AsyncSnapshot<T> err<T>(Object error, [StackTrace? stackTrace]) =>
AsyncSnapshot.withError(
ConnectionState.done,
error,
stackTrace ?? StackTrace.empty,
);