showLoadingDialog static method

Future<void> showLoadingDialog(
  1. BuildContext context, {
  2. String? label,
})

Implementation

static Future<void> showLoadingDialog(
  BuildContext context, {
  String? label,
}) async {
  return showDialog<void>(
      context: context,
      barrierDismissible: false,
      builder: (BuildContext context) {
        return PopScope(
            canPop: false,
            child: SizedBox(
              height: MediaQuery.of(context).size.height,
              width: MediaQuery.of(context).size.width,
              child: SimpleDialog(
                  elevation: 0.0,
                  backgroundColor: Colors.transparent,
                  children: <Widget>[
                    Center(
                      child: Column(children: [
                        CircularProgressIndicator(
                          color: Theme.of(context).colorScheme.secondary,
                        ),
                        const SizedBox(
                          height: 10,
                        ),
                        Text(
                          label ?? 'Loading...',
                          style: const TextStyle(
                              color: Color(0xffFFFFFF),
                              fontFamily: 'Roboto',
                              fontSize: 16,
                              fontWeight: FontWeight.w700),
                        )
                      ]),
                    )
                  ]),
            ));
      });
}