catchError method Null safety

Future<InjectedBase<T>> catchError(
  1. void onError(
    1. dynamic error,
    2. StackTrace s
    )
)
inherited

Implementation

Future<InjectedBase<T>> catchError(
  void Function(dynamic error, StackTrace s) onError,
) async {
  try {
    await _reactiveModelState._endStreamCompleter?.future;
    if (hasError) {
      onError(error, snapState.stackTrace!);
    }
  } catch (e, s) {
    onError(e, s);
  }
  return this;
}