Skip to content

Instantly share code, notes, and snippets.

@as3eem
Created June 23, 2018 16:43
Show Gist options
  • Save as3eem/504fadbafebdb9d5df218e42033458f2 to your computer and use it in GitHub Desktop.
Save as3eem/504fadbafebdb9d5df218e42033458f2 to your computer and use it in GitHub Desktop.
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final key = new GlobalKey<ScaffoldState>();
return new Scaffold(
key: key,
floatingActionButton: new Builder(
builder: (BuildContext context) {
return new FloatingActionButton(
onPressed: () {
key.currentState.showSnackBar(new SnackBar(
content: new Text("Sending Message"),
));
},
tooltip: 'Increment',
child: new Icon(Icons.add),
);
}
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment