mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-08-23 21:41:51 +00:00
30 lines
748 B
Dart
30 lines
748 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:selfprivacy/ui/components/error/error.dart';
|
|
import 'package:selfprivacy/utils/route_transitions/basic.dart';
|
|
|
|
import 'package:selfprivacy/config/get_it_config.dart';
|
|
|
|
class SimpleBlocObserver extends BlocObserver {
|
|
SimpleBlocObserver();
|
|
|
|
@override
|
|
void onError(
|
|
final BlocBase<dynamic> bloc,
|
|
final Object error,
|
|
final StackTrace stackTrace,
|
|
) {
|
|
final NavigatorState navigator = getIt.get<NavigationService>().navigator!;
|
|
|
|
navigator.push(
|
|
materialRoute(
|
|
BrandError(
|
|
error: error,
|
|
stackTrace: stackTrace,
|
|
),
|
|
),
|
|
);
|
|
super.onError(bloc, error, stackTrace);
|
|
}
|
|
}
|