assetSuccessDialog static method

dynamic assetSuccessDialog(
  1. BuildContext context,
  2. String title,
  3. String content,
  4. AssetImage asset,
)

Implementation

static assetSuccessDialog(
  BuildContext context,
  String title,
  String content,
  AssetImage asset,
) async {
  await showDialog(
    barrierDismissible: false,
    context: context,
    builder: (_) {
      Future.delayed(const Duration(seconds: 1), () {
        Navigator.of(context).pop(true);
      });
      return WillPopScope(
        onWillPop: () async {
          return false;
        },
        child: Dialog(
          insetPadding: EdgeInsets.all(SizeConstant.getHeightWithScreen(20)),
          child: Container(
            width: double.maxFinite,
            decoration: BoxDecoration(
              color: ColorConstant.white,
              borderRadius:
                  BorderRadius.circular(SizeConstant.getHeightWithScreen(16)),
            ),
            padding: EdgeInsets.symmetric(
                vertical: SizeConstant.getHeightWithScreen(30),
                horizontal: SizeConstant.getHeightWithScreen(10)),
            child: Column(
              mainAxisSize: MainAxisSize.min,
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Image(
                  fit: BoxFit.contain,
                  image: asset,
                  height: SizeConstant.getHeightWithScreen(50),
                  width: SizeConstant.getHeightWithScreen(50),
                ),
                SizedBox(
                  height: SizeConstant.getHeightWithScreen(10),
                ),
                Text(
                  title,
                  style: TextStyle(
                      color: ColorConstant.pgvDescTextColor,
                      fontSize: SizeConstant.mediumFont,
                      fontWeight: FontWeight.w600),
                ),
                SizedBox(
                  height: SizeConstant.getHeightWithScreen(9),
                ),
                Text(
                  content,
                  style: TextStyle(
                      color: ColorConstant.grey5,
                      fontSize: SizeConstant.mediumFont,
                      fontWeight: FontWeight.w500),
                ),
              ],
            ),
          ),
        ),
      );
    },
  );
}