Skip to content

Instantly share code, notes, and snippets.

@rrifafauzikomara
Created December 14, 2019 16:53
Show Gist options
  • Save rrifafauzikomara/275c745574a0f886636b16ded3a14ef4 to your computer and use it in GitHub Desktop.
Save rrifafauzikomara/275c745574a0f886636b16ded3a14ef4 to your computer and use it in GitHub Desktop.
Widget getListMovie() {
return Container(
child: Center(
child: StreamBuilder(
stream: bloc.allMovie,
builder: (context, AsyncSnapshot<Movie> snapshot) {
if (snapshot.hasData) {
return showListMovie(snapshot);
} else if (snapshot.hasError) {
return Text(snapshot.error.toString(), style: TextStyle(color: Color.fromRGBO(58, 66, 86, 1.0)),);
}
return Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(
Color.fromRGBO(58, 66, 86, 1.0),
),
),
);
},
),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment