Skip to content

Instantly share code, notes, and snippets.

@TechieBlossom
Last active October 4, 2020 12:57
Show Gist options
  • Save TechieBlossom/c51300d84426ec11c6cbb8a4f48a3f7f to your computer and use it in GitHub Desktop.
Save TechieBlossom/c51300d84426ec11c6cbb8a4f48a3f7f to your computer and use it in GitHub Desktop.
class MovieDataWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
//1
return BlocBuilder<MovieBackdropBloc, MovieBackdropState>(
builder: (context, state) {
//2
if (state is MovieBackdropChanged) {
//3
return Text(
state.movie.title,
textAlign: TextAlign.center,
maxLines: 1,
//3
overflow: TextOverflow.fade,
//4
style: Theme.of(context).textTheme.headline6,
);
}
return const SizedBox.shrink();
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment