Skip to content

Commit

Permalink
fix zone mismatch error
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasMirbt committed Aug 4, 2024
1 parent db714f3 commit de4fd0e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions examples/flutter_todos/lib/bootstrap.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:async';
import 'dart:developer';

import 'package:bloc/bloc.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_todos/app/app.dart';
import 'package:flutter_todos/app/app_bloc_observer.dart';
Expand All @@ -13,12 +13,14 @@ void bootstrap({required TodosApi todosApi}) {
log(details.exceptionAsString(), stackTrace: details.stack);
};

PlatformDispatcher.instance.onError = (error, stack) {
log(error.toString(), stackTrace: stack);
return true;
};

Bloc.observer = const AppBlocObserver();

final todosRepository = TodosRepository(todosApi: todosApi);

runZonedGuarded(
() => runApp(App(todosRepository: todosRepository)),
(error, stackTrace) => log(error.toString(), stackTrace: stackTrace),
);
runApp(App(todosRepository: todosRepository));
}

0 comments on commit de4fd0e

Please sign in to comment.