popUpDialog static method

dynamic popUpDialog({
  1. required String headingText,
  2. required String subHeading,
  3. required VoidCallback onButtonTap,
  4. bool isPayment = false,
  5. String? buttonText,
})

Implementation

static popUpDialog(
    {required String headingText,
    required String subHeading,
    required VoidCallback onButtonTap,
    bool isPayment = false,
    String? buttonText}) {
  final Localization localization = Localization.getInstance();
  Get.dialog(
    AlertDialog(
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(12),
      ),
      backgroundColor: ColorConstant.white,
      titlePadding: EdgeInsets.zero,
      contentPadding: EdgeInsets.zero,
      content: Padding(
        padding: EdgeInsets.all(SizeConstant.getHeightWithScreen(24)),
        child: SizedBox(
          width: double.maxFinite,
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              SvgPicture.asset(
                isPayment
                    ? "assets/images/error_icon.svg"
                    : "assets/images/order_info_red.svg",
                package: Constants.packageName,
                height: SizeConstant.getHeightWithScreen(40),
                width: SizeConstant.getHeightWithScreen(40),
              ),
              SizedBox(height: SizeConstant.getHeightWithScreen(10)),
              Text(
                headingText,
                style: TextStyle(
                  color: ColorConstant.darkGrey2,
                  fontSize: SizeConstant.largeFont,
                  fontFamily: "Cellcard",
                  fontWeight: FontWeight.w400,
                  height: 1.75,
                ),
                textAlign: TextAlign.center,
              ),
              Text(
                subHeading,
                style: TextStyle(
                  fontSize: SizeConstant.mediumFont,
                  color: ColorConstant.darkGrey,
                  fontWeight: FontWeight.w300,
                  fontFamily: "Cellcard",
                  height: 1.43,
                ),
                textAlign: TextAlign.center,
              ),
              SizedBox(height: SizeConstant.getHeightWithScreen(16)),
              VentasPrimaryButton(
                onTap: onButtonTap,
                label: buttonText ?? localization.translate('okay'),
                btnHeight: SizeConstant.getHeightWithScreen(40),
                textColor: ColorConstant.white,
                borderRadius: SizeConstant.getHeightWithScreen(8),
                bgColor: ColorConstant.paymentBtnColor,
                disableColor: ColorConstant.disableLightBlue,
                weight: FontWeight.w500,
                textSize: SizeConstant.largeFont,
                fontFamily: "Cellcard",
              ),
            ],
          ),
        ),
      ),
    ),
  );
}