selfprivacy.org.app/lib/config/bloc_observer.dart
2022-09-16 13:36:26 +03:00

20 lines
448 B
Dart

import 'package:flutter_bloc/flutter_bloc.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,
) {
getIt<NavigationService>().showSnackBar(
'Bloc error: ${error.toString()}',
);
super.onError(bloc, error, stackTrace);
}
}