commonDialogs function

dynamic commonDialogs({
  1. dynamic titleText,
  2. dynamic body,
  3. dynamic bgColor,
  4. dynamic textColor,
  5. dynamic radius,
  6. dynamic confirm,
  7. dynamic cancel,
  8. dynamic textCancel,
  9. dynamic textConfirm,
  10. dynamic onConfirmClick,
  11. dynamic confirmButtonColor,
  12. dynamic dismiss,
})

Implementation

commonDialogs({
  titleText,
  body,
  bgColor,
  textColor,
  radius,
  confirm,
  cancel,
  textCancel,
  textConfirm,
  onConfirmClick,
  confirmButtonColor,
  dismiss,
}) {
  return Get.defaultDialog(
    title: titleText ?? "",
    middleText: "",
    barrierDismissible: dismiss ?? true,
    content: body,
    confirm: confirm ?? Container(),
    cancel: cancel ?? Container(),
    onCancel: () {
      Get.back();
    },
    contentPadding: EdgeInsets.symmetric(horizontal: margin_20),
    buttonColor: confirmButtonColor ?? Colors.green,
    onConfirm: onConfirmClick ?? () {},
    radius: radius_8,
  );
}