-
-
Save TechieBlossom/bf85941f6122d5926e0ffbcb50771f1b to your computer and use it in GitHub Desktop.
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
@override | |
@override | |
Widget build(BuildContext context) { | |
//1 | |
return BlocProvider( | |
//2 | |
create: (_) => movieCarouselBloc, | |
child: Scaffold( | |
//3 | |
body: BlocBuilder<MovieCarouselBloc, MovieCarouselState>( | |
bloc: movieCarouselBloc, | |
builder: (context, state) { | |
//4 | |
if (state is MovieCarouselLoaded) { | |
return Stack( | |
fit: StackFit.expand, | |
children: <Widget>[ | |
FractionallySizedBox( | |
alignment: Alignment.topCenter, | |
heightFactor: 0.6, | |
child: MovieCarouselWidget( | |
movies: state.movies, | |
defaultIndex: state.defaultIndex, | |
), | |
), | |
FractionallySizedBox( | |
alignment: Alignment.bottomCenter, | |
heightFactor: 0.4, | |
child: Placeholder(color: Colors.white), | |
), | |
], | |
); | |
} | |
//5 | |
return const SizedBox.shrink(); | |
}, | |
), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment