showProgressHUD function

void showProgressHUD(
  1. BuildContext context, {
  2. String? title,
  3. Color? barrierColor,
})

Implementation

void showProgressHUD(BuildContext context, {String? title, Color? barrierColor}) {
  showDialog(
    context: context,
    barrierColor: barrierColor,
    builder: (BuildContext context) {
      return Scaffold(
        backgroundColor: Colors.transparent,
        body: WillPopScope(
          onWillPop: () => Future.value(false),
          child: Stack(
            alignment: AlignmentDirectional.center,
            children: <Widget>[
              Center(
                child: Container(
                  padding: const EdgeInsets.fromLTRB(30, 30, 30, 20),
                  margin: const EdgeInsets.only(bottom: 100),
                  decoration: BoxDecoration(color: const Color(0x99000000), borderRadius: BorderRadius.circular(10)),
                  child: Column(
                    mainAxisSize: MainAxisSize.min,
                    children: <Widget>[
                      CupertinoTheme(
                        data: CupertinoTheme.of(context).copyWith(brightness: Brightness.dark),
                        child: const CupertinoActivityIndicator(radius: 12),
                      ),
                      const SizedBox(height: 10),
                      Text(title ?? AlertView.defaultLoadingTitle, style: const TextStyle(color: Colors.white)),
                    ],
                  ),
                ),
              ),
            ],
          ),
        ),
      );
    },
  );
}