showBottomChoose<T> function

Future<T?> showBottomChoose<T>({
  1. required BuildContext context,
  2. required List<CupertinoActionSheetAction> actions,
  3. Widget? title,
  4. Widget? message,
  5. bool showCancel = true,
})

Implementation

Future<T?> showBottomChoose<T>(
    {required BuildContext context,
    required List<CupertinoActionSheetAction> actions,
    Widget? title,
    Widget? message,
    bool showCancel = true}) async {
  return showCupertinoModalPopup<T>(
      context: context,
      barrierColor: Color(0x66000000),
      builder: (BuildContext context) {
        return CupertinoActionSheet(
          title: title,
          message: message,
          cancelButton: showCancel
              ? CupertinoActionSheetAction(
                  onPressed: () {
                    Navigator.of(context).pop();
                  },
                  child: Text(
                    S.of(context).cancel,
                    style: TextStyle(
                        fontSize: 16, color: CommonColors.color_333333),
                  ),
                )
              : null,
          actions: actions
              .map((e) => Container(
                    color: Colors.white,
                    child: e,
                  ))
              .toList(),
        );
      });
}