progressDialog static method

dynamic progressDialog(
  1. BuildContext context,
  2. String? message, {
  3. bool canPop = false,
})

Implementation

static progressDialog(
  BuildContext context,
  String? message, {
  bool canPop = false,
}) {
  final Localization localization = Localization.getInstance();
  showGeneralDialog(
    barrierDismissible: false,
    barrierColor: ColorConstant.black.withOpacity(0.6),
    context: context,
    transitionDuration: const Duration(milliseconds: 400),
    pageBuilder: (_, __, ___) {
      return PopScope(
        canPop: canPop,
        child: Material(
          type: MaterialType.transparency,
          child: Container(
            color: Colors.transparent,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              mainAxisSize: MainAxisSize.min,
              children: [
                SizedBox(
                  height: SizeConstant.getHeightWithScreen(105),
                  width: SizeConstant.getHeightWithScreen(105),
                  child: Lottie.asset(
                    'assets/json_assets/loader.json',
                    package: Constants.packageName,
                    height: SizeConstant.getHeightWithScreen(105),
                    width: SizeConstant.getHeightWithScreen(105),
                    delegates: LottieDelegates(
                      values: [
                        ValueDelegate.blurRadius(
                          ['**'],
                          value: 20,
                        ),
                      ],
                    ),
                  ),
                ),
                Text(
                  localization.translate("loading"),
                  style: TextStyle(
                    color: ColorConstant.white,
                    fontSize: SizeConstant.mediumFont,
                  ),
                ),
              ],
            ),
          ),
        ),
      );
    },
  );
}