Created
June 18, 2019 05:29
-
-
Save felangel/bf1c398ec836fd56aa46eac84a30e6c0 to your computer and use it in GitHub Desktop.
[flutter_bloc_hydrated_weather] HydratedBlocDelegate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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