Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Created December 26, 2019 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/7883e9e86af17f69d63a9e15ebedb69c to your computer and use it in GitHub Desktop.
Save McLarenCollege/7883e9e86af17f69d63a9e15ebedb69c to your computer and use it in GitHub Desktop.
AppBar(
title: Text('McLaren Chat - ${widget.chatID}'),
actions: <Widget>[
IconButton(
icon: Icon(Icons.exit_to_app),
onPressed: () async {
await FirebaseAuth.instance.signOut();
Navigator.pushReplacementNamed(context, '/');
},
),
PopupMenuButton(
itemBuilder: (context) {
return [
PopupMenuItem(
child: Text('Show Food Menu'),
value: ['Biryani', 'Khichdi', 'Sabzi', 'Pulav'],
),
PopupMenuItem(
child: Text('Show Weekdays'),
value: ['Monday', 'Tuesday', 'Wednesday', 'Friday', 'Saturday', 'Sunday'],
),
PopupMenuItem(
child: Text('Close All'),
value: <String>[],
)
];
},
onSelected: (List<String> value) {
print('Selected value $value');
setState(() {
FocusScope.of(context).unfocus();
options = value.isEmpty ? null : value;
});
},
)
],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment