Skip to content

Instantly share code, notes, and snippets.

@webianks
Created August 13, 2019 12:51
Show Gist options
  • Save webianks/7a8d82de0179d024cd60b7e9acce11e0 to your computer and use it in GitHub Desktop.
Save webianks/7a8d82de0179d024cd60b7e9acce11e0 to your computer and use it in GitHub Desktop.
showActionSheet(
context: context,
child: CupertinoActionSheet(
message: const Text('Select image from'),
actions: <Widget>[
CupertinoActionSheetAction(
child: Padding(
padding: const EdgeInsets.only(right: 16.0),
child: Text(
'Camera',
style: TextStyle(color: Color(Const.colorPrimary)),
),
),
onPressed: () {
Navigator.pop(context, "0");
},
),
CupertinoActionSheetAction(
child: Padding(
padding: const EdgeInsets.only(right: 16.0),
child: Text('Gallery',
style: TextStyle(color: Color(Const.colorPrimary))),
),
onPressed: () {
Navigator.pop(context, "1");
},
),
],
cancelButton: CupertinoActionSheetAction(
child: const Text('Cancel',
style: TextStyle(color: Color(Const.colorPrimary))),
isDefaultAction: true,
onPressed: () {
Navigator.pop(context, '2');
},
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment