create method

  1. @override
Widget create(
  1. BuildContext context,
  2. Widget title,
  3. Widget content,
  4. List<UIAction> actions,
  5. UIAction? cancel,
)
override

Implementation

@override
Widget create(
  BuildContext context,
  Widget title,
  Widget content,
  List<UIAction> actions,
  UIAction? cancel,
) {
  return CupertinoActionSheet(
    title: title,
    message: content,
    cancelButton: CupertinoActionSheetAction(
      child: cancel!.child,
      isDefaultAction: true,
      onPressed: () {
        cancel.onPressed as void Function();
        Navigator.pop(context, 'Cancel');
      },
    ),
    actions: actions.map<Widget>(
      (a) {
        return CupertinoActionSheetAction(
          child: a.child,
          onPressed: a.onPressed as void Function(),
        );
      },
    ).toList(),
  );
}