Skip to content

Instantly share code, notes, and snippets.

@felangel
Created June 18, 2019 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felangel/bf1c398ec836fd56aa46eac84a30e6c0 to your computer and use it in GitHub Desktop.
Save felangel/bf1c398ec836fd56aa46eac84a30e6c0 to your computer and use it in GitHub Desktop.
[flutter_bloc_hydrated_weather] HydratedBlocDelegate
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:hydrated_bloc/hydrated_bloc.dart';
class SimpleBlocDelegate extends HydratedBlocDelegate {
SimpleBlocDelegate(HydratedStorage storage) : super(storage);
@override
void onEvent(Bloc bloc, Object event) {
super.onEvent(bloc, event);
print(event);
}
@override
onTransition(Bloc bloc, Transition transition) {
super.onTransition(bloc, transition);
print(transition);
}
@override
void onError(Bloc bloc, Object error, StackTrace stacktrace) {
super.onError(bloc, error, stacktrace);
print(error);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment