showAlertCountSelect function

Future<int?>? showAlertCountSelect({
  1. required List<String> list,
  2. int? defaultIndex,
  3. BottomSheetOptions? bottomSheetOptions,
})

带取消的 弹窗 单列选择

Implementation

Future<int?>? showAlertCountSelect(
        {required List<String> list,
        int? defaultIndex,
        BottomSheetOptions? bottomSheetOptions}) =>
    AlertCountSelect(
        cancelButton: Universal(
            safeBottom: true,
            onTap: maybePop,
            child: TextDefault('取消',
                    textAlign: TextAlign.center,
                    color: GlobalConfig().currentColor)
                .paddingSymmetric(vertical: 12)),
        actions: list.builderEntry((item) => CupertinoActionSheetAction(
              onPressed: () {
                maybePop(item.key);
              },
              isDefaultAction: defaultIndex == item.key,
              child: TextDefault(item.value),
            ))).popupBottomSheet<int?>(
        options: const BottomSheetOptions(backgroundColor: Colors.transparent)
            .merge(bottomSheetOptions));