alertYesNo static method

dynamic alertYesNo(
  1. BuildContext context,
  2. dynamic onPressedBTN_YES()?, {
  3. String titleText = "",
  4. TextStyle? titleStyle,
  5. Color? titleColor,
  6. String? labelBTNtext,
  7. TextStyle? styleLabelBTN_NO,
  8. TextStyle? styleLabelBTN_YES,
  9. Color? colorLabelBTN_NO,
  10. Color? colorLabelBTN_YES,
  11. Decoration? decorationBTN,
  12. Color? colorBTN,
  13. double? heightBTN,
  14. double? widthBTN,
})

Implementation

static alertYesNo(
  BuildContext context,
  Function()? onPressedBTN_YES, {
  String titleText = "",
  TextStyle? titleStyle,
  Color? titleColor,
  String? labelBTNtext,
  TextStyle? styleLabelBTN_NO,
  TextStyle? styleLabelBTN_YES,
  Color? colorLabelBTN_NO,
  Color? colorLabelBTN_YES,
  Decoration? decorationBTN,
  Color? colorBTN,
  double? heightBTN,
  double? widthBTN,
}) {
  return showDialog(
      context: context,
      builder: (context) {
        return XAlertDialog(
            height: null,
            title_Text: titleText,
            title_Style: titleStyle ?? XStyles.xStyTextForTextBase(titleColor ?? Colors.white),
            actionsBTNarea_Child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
              XBtnbase(
                  width: widthBTN ?? 70,
                  height: heightBTN ?? 30,
                  label: labelBTNtext ?? "NO",
                  label_Style: styleLabelBTN_NO ?? XStyles.xStyTextForSubLabel(colorLabelBTN_NO ?? Colors.redAccent),
                  decoration: decorationBTN ?? BoxDecoration(color: colorBTN ?? Colors.transparent),
                  elevation: 0,
                  onPressed: () {
                    Navigator.pop(context);
                  }),
              XBtnbase(
                  width: widthBTN ?? 70,
                  height: heightBTN ?? 30,
                  label: labelBTNtext ?? "SI",
                  label_Style: styleLabelBTN_YES ?? XStyles.xStyTextForSubLabel(colorLabelBTN_YES ?? Colors.greenAccent),
                  decoration: decorationBTN ?? BoxDecoration(color: colorBTN ?? Colors.transparent),
                  elevation: 0,
                  onPressed: () {
                    onPressedBTN_YES!();
                    Navigator.pop(context);
                  })
            ]));
      });
}