Skip to content

Instantly share code, notes, and snippets.

@ananevam
Created February 18, 2020 16:54
Show Gist options
  • Save ananevam/2a82a60089894acff217900fe92830e5 to your computer and use it in GitHub Desktop.
Save ananevam/2a82a60089894acff217900fe92830e5 to your computer and use it in GitHub Desktop.
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (BuildContext context) {
_welcomeBloc = WelcomeBloc();
_welcomeBloc.add(WelcomeFetch());
return _welcomeBloc;
},
child: CupertinoPageScaffold(child: BlocBuilder<WelcomeBloc, WelcomeState>(
builder: (context, state) {
print(state);
if (state is WelcomeUninitialized) {
return LoadView();
}
if (state is WelcomeLoaded) {
return welcomeLoaded(state);
}
return Container();
})),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment