xLayout_Dialog method

Future<bool?> xLayout_Dialog(
  1. T item, {
  2. Widget? contentWidget,
  3. String? title,
  4. String? BTN_Label_YES,
  5. String? BTN_Label_NO,
  6. bool BTNno_Visible = true,
  7. String? BTN_Label,
  8. dynamic onPressed()?,
})

Dialog Generico da Utilizzare

Implementation

Future<bool?> xLayout_Dialog(T item, {Widget? contentWidget, String? title, String? BTN_Label_YES, String? BTN_Label_NO, bool BTNno_Visible = true, String? BTN_Label, Function()? onPressed}) async {
  return await showDialog<bool>(
      barrierDismissible: false,
      context: context,
      builder: (context) {
        return XAlertDialog(
            title_Text: title ?? "Modifica il campo qui sotto:",
            title_Style: XStyles.xStyTextForTextBase(textColor: XColors.foregroundLight),
            child: contentWidget ?? Container(),
            actionsBTNarea_Child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
              Expanded(
                  child: BTNno_Visible
                      ? XBtnbase(
                          label: BTN_Label_NO ?? "Annulla",
                          label_Style: XStyles.xStyTextForSubLabel(textColor: XColors.undo),
                          onPressed: () => Navigator.pop(context, false),
                        )
                      : Container()),
              SizedBox(width: 10),
              Expanded(
                  child: XBtnbase(
                label: BTN_Label_YES ?? "OK, avanti..",
                label_Style: XStyles.xStyTextForSubLabel(textColor: XColors.done),
                onPressed: onPressed,
              ))
            ]));
      });
}