confirmationSuppression static method

Future<void> confirmationSuppression({
  1. required Widget widgetContentMsg,
  2. dynamic onPressedOui()?,
  3. dynamic onPressedNo()?,
  4. String? dialogTitle,
})

Implementation

static Future<void> confirmationSuppression(
    {required Widget widgetContentMsg,
    Function()? onPressedOui,
    Function()? onPressedNo,
    String? dialogTitle}) async {
  String title =
      (dialogTitle == null) ? 'msg_title_Attention'.tr : dialogTitle;
  return showDialog(
      context: Get.context!,
      barrierDismissible: true,
      builder: (BuildContext context) {
        return AlertDialog(
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(10),
          ),
          title: Container(
            width: MediaQuery.of(context).size.width,
            decoration: BoxDecoration(
              gradient: LinearGradient(
                  begin: Alignment.topLeft,
                  end: Alignment.bottomRight,
                  stops: const [0.1, 0.8],
                  colors: [Theme.of(context).primaryColor, Colors.black]),
            ),
            padding: const EdgeInsets.all(8),
            child: Text(title,
                style: TextStyle(color: ColorResources.getColor())),
          ),
          titlePadding:
              const EdgeInsets.only(left: 0.0, right: 0.0, top: 0, bottom: 0),
          content: widgetContentMsg,
          //Text(translator((isDeleteAll)?'msg_confirmation_suppression_all_note':'msg_confirmation_suppression_one_note')),
          actions: <Widget>[
            TextButton(
              onPressed: onPressedOui,
              child: Text('label_Oui'.tr),
            ),
            MyElevatedButton(
              style: elevatedButtonNormal(),
              onPressed: onPressedNo ?? () {
                      Navigator.pop(Get.context!);
                    },
              child: Text('label_Non'.tr.toUpperCase()),
            ),
          ],
        );
      });
}