showAlertDialog static method

void showAlertDialog({
  1. required String middleText,
  2. VoidCallback? onConfirm,
  3. VoidCallback? onCancel,
})

Implementation

static void showAlertDialog({required String middleText,VoidCallback? onConfirm,VoidCallback? onCancel}){
  Get.defaultDialog(
      title: '提示',
      titleStyle: const TextStyle(
          color: Colors.black,
          fontWeight: FontWeight.bold
      ),
      radius: 12,
      backgroundColor: Colors.white,
      middleText: middleText,
      confirmTextColor: Colors.white,
      textConfirm: '确定',
      onConfirm: (){
        onConfirm?.call();
        Get.back();
      }
  );
}