From f260326a4422001398ffa744c1b18943fd031bbd Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Sun, 19 May 2024 18:39:07 +0200 Subject: [PATCH] Workaround for error catching on Web --- lib/core/catcher_2.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/core/catcher_2.dart b/lib/core/catcher_2.dart index 468b4d3..9a94c31 100644 --- a/lib/core/catcher_2.dart +++ b/lib/core/catcher_2.dart @@ -195,8 +195,18 @@ class Catcher2 implements ReportModeAction { ); }).sendPort, ); + _runApp(); + } else { + // Due to https://github.com/flutter/flutter/issues/100277 + // this is still needed... As soon as proper error catching support + // for Web is implemented, this branch should be removed and just + // _runApp should be called, the same as in the other branch + // without the Isolate[...] stuff. + runZonedGuarded(_runApp, _reportError); } + } + void _runApp() { if (rootWidget != null) { runApp(rootWidget!); } else if (runAppFunction != null) {