showBottomAlertAndroid method

dynamic showBottomAlertAndroid({
  1. required dynamic list,
  2. dynamic callback,
  3. dynamic avtive,
})

底部弹出提示框

Implementation

showBottomAlertAndroid({required list, callback,avtive}) {
  return showCupertinoModalPopup(
    barrierColor: barrierColor,
    context: context,
    builder: (context) {
      Color? color = avtive==null?themeColor.ff0E1424: themeColor.primary;
      return XButton(
        callback: () {
          Navigator.pop(context);
        },
        child: Scaffold(
          backgroundColor: Colors.transparent,
          body: Column(mainAxisAlignment: MainAxisAlignment.end, children: [
            Column(
              children: [
                Column(
                  children: List.generate(
                    list?.length ?? 0,
                    (index) => XButton(
                      callback: () {
                        Navigator.pop(context);
                        callback(index);
                      },
                      child: Text(list[index], style: font(32, colorA:themeColor.primary)).center.background(height: 112.w, borderTop: index == 0 ? 0 : 1.w),
                    ),
                  ),
                ),
                Container(
                  height: 20.w,
                  color: themeColor.ffF3F6F9,
                ),
                XButton(
                  callback: () {
                    Navigator.pop(context);
                  },
                  child: Text(
                    '取消',
                    style: font(32, colorA: themeColor.primary),
                  ).center.background(height: 110.w),
                )
              ],
            ).background(color: themeColor.ffFFFFFF, topRight: 16.w, topLeft: 16.w).bottomCenter
          ]),
        ),
      );
    },
  );
}