progressDialog static method

dynamic progressDialog(
  1. BuildContext context,
  2. String? message
)

Implementation

static progressDialog(BuildContext context, String? message) {
  final Localization localization = Localization.getInstance();

  showGeneralDialog(
    barrierDismissible: false,
    barrierColor: ColorConstant.black.withOpacity(0.6),
    context: context,
    transitionDuration: const Duration(milliseconds: 400),
    pageBuilder: (_, __, ___) {
      return 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,
                ),
              ),
            ],
          ),
        ),
      );
    },
  );
}