onAsyncError method

  1. @override
bool onAsyncError(
  1. FlutterErrorDetails details
)
override

Supply an 'error handler' routine if something goes wrong in the corresponding initAsync() routine.

Implementation

@override
bool onAsyncError(FlutterErrorDetails details) {
  /// This will call any and all Controllers
  /// that may have ran asynchronous operations.
  bool handled = true;

  /// No 'setState()' functions are allowed to fully function at this point.
  _rebuildAllowed = false;
  for (final con in _controllerList) {
    try {
      if (!con.onAsyncError(details)) {
        handled = false;
      }
    } catch (ex) {
      handled = false;
    }
  }
  _rebuildAllowed = true;
  return handled;
}