Skip to content

Commit

Permalink
Migrate to ScaffoldMessenger (flutter#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
Piinks authored Oct 12, 2020
1 parent 5026d61 commit c2c4b33
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/animations/example/lib/container_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ class OpenContainerTransformDemo extends StatefulWidget {
class _OpenContainerTransformDemoState
extends State<OpenContainerTransformDemo> {
ContainerTransitionType _transitionType = ContainerTransitionType.fade;
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();

void _showMarkedAsDoneSnackbar(bool isMarkedAsDone) {
if (isMarkedAsDone ?? false)
scaffoldKey.currentState.showSnackBar(const SnackBar(
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Marked as done!'),
));
}
Expand Down Expand Up @@ -111,7 +110,6 @@ class _OpenContainerTransformDemoState
@override
Widget build(BuildContext context) {
return Scaffold(
key: scaffoldKey,
appBar: AppBar(
title: const Text('Container transform'),
actions: <Widget>[
Expand Down

0 comments on commit c2c4b33

Please sign in to comment.