mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
Wrap app in zone guard
This commit is contained in:
parent
9b32c9c956
commit
38da6e73d4
1 changed files with 11 additions and 4 deletions
|
@ -42,9 +42,16 @@ final navigatorKey = GlobalKey<NavigatorState>();
|
|||
final rootKey = GlobalKey<RootState>();
|
||||
|
||||
Future<void> main() async {
|
||||
try {
|
||||
|
||||
await runZonedGuarded(() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// FlutterError.onError = ;
|
||||
|
||||
// Isolate.current.addErrorListener(RawReceivePort((pair) async {
|
||||
// final List<dynamic> errorAndStacktrace = pair;
|
||||
// }).sendPort);
|
||||
|
||||
final appDir = await getApplicationDocumentsDirectory();
|
||||
await Hive.close();
|
||||
Hive.init(appDir.path);
|
||||
|
@ -130,7 +137,7 @@ Future<void> main() async {
|
|||
secureStorage: secureStorage,
|
||||
initialMigrationVersion: 17);
|
||||
runApp(App());
|
||||
} catch (e, stacktrace) {
|
||||
}, (error, stackTrace) {
|
||||
runApp(MaterialApp(
|
||||
debugShowCheckedModeBanner: true,
|
||||
home: Scaffold(
|
||||
|
@ -138,10 +145,10 @@ Future<void> main() async {
|
|||
margin:
|
||||
EdgeInsets.only(top: 50, left: 20, right: 20, bottom: 20),
|
||||
child: Text(
|
||||
'Error:\n${e.toString()}\nStacktrace: $stacktrace',
|
||||
'Error:\n${error.toString()}\nStacktrace: $stackTrace',
|
||||
style: TextStyle(fontSize: 22),
|
||||
)))));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> initialSetup(
|
||||
|
|
Loading…
Reference in a new issue