Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8cd56bc

Browse files
authoredAug 27, 2024
fix(flutter_todos): zone mismatch error (#4225)
1 parent 0c68c96 commit 8cd56bc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
 
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import 'dart:async';
21
import 'dart:developer';
32

43
import 'package:bloc/bloc.dart';
4+
import 'package:flutter/foundation.dart';
55
import 'package:flutter/widgets.dart';
66
import 'package:flutter_todos/app/app.dart';
77
import 'package:flutter_todos/app/app_bloc_observer.dart';
@@ -13,12 +13,14 @@ void bootstrap({required TodosApi todosApi}) {
1313
log(details.exceptionAsString(), stackTrace: details.stack);
1414
};
1515

16+
PlatformDispatcher.instance.onError = (error, stack) {
17+
log(error.toString(), stackTrace: stack);
18+
return true;
19+
};
20+
1621
Bloc.observer = const AppBlocObserver();
1722

1823
final todosRepository = TodosRepository(todosApi: todosApi);
1924

20-
runZonedGuarded(
21-
() => runApp(App(todosRepository: todosRepository)),
22-
(error, stackTrace) => log(error.toString(), stackTrace: stackTrace),
23-
);
25+
runApp(App(todosRepository: todosRepository));
2426
}

0 commit comments

Comments
 (0)
Please sign in to comment.