Skip to content

Instantly share code, notes, and snippets.

@kishansinhparmar
Created January 4, 2020 14:12
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 kishansinhparmar/b2f61d0bf99eeb68c8afa9bb1d7ed45f to your computer and use it in GitHub Desktop.
Save kishansinhparmar/b2f61d0bf99eeb68c8afa9bb1d7ed45f to your computer and use it in GitHub Desktop.
BlocBuilder<$BlocClass$, $BlocState$>(
builder: (context, state) {
print("$state");
if (state is InitialQuoteState) {
return buildInitialState();
} else if (state is LoadingQuoteState) {
return buildLoadingState();
} else if (state is DetailQuoteState) {
return buildQuoteState(state.quoteDetails, context);
} else if (state is ErrorState) {
return buildErrorState(state.errorMsg);
} else {
return Center(
child: Text("Unhandled state"),
);
}
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment