runTalkerZonedGuarded<R> function

Future<R?> runTalkerZonedGuarded<R>(
  1. Talker talker,
  2. R body(),
  3. void onError(
    1. Object error,
    2. StackTrace stack
    ), {
  4. Map<Object?, Object?>? zoneValues,
  5. ZoneSpecification? zoneSpecification,
  6. bool catchFlutterErrors = true,
})

Implementation

Future<R?> runTalkerZonedGuarded<R>(Talker talker, R Function() body,
    void Function(Object error, StackTrace stack) onError,
    {Map<Object?, Object?>? zoneValues,
    ZoneSpecification? zoneSpecification,
    bool catchFlutterErrors = true}) async {
  setupErrorHooks(talker, catchFlutterErrors: catchFlutterErrors);
  return runZonedGuarded<R>(body, (dynamic error, StackTrace stackTrace) {
    onError(error, stackTrace);
    talker.handle(error, stackTrace);
  }, zoneValues: zoneValues, zoneSpecification: zoneSpecification);
}