loaderDialog static method

dynamic loaderDialog({
  1. bool? show,
  2. double loaderSize = 50.0,
  3. Color? color,
  4. double? strokeWidth,
})

Full Screen Loading Dialog.

Implementation

static loaderDialog(
    {bool? show,
    double loaderSize = 50.0,
    Color? color,
    double? strokeWidth}) {
  if (show!) {
    _isLoading = show;
    showDialog(
      context: navigationService.context,
      builder: (context) {
        return WillPopScope(
            onWillPop: () => Future.value(false),
            child: circularLoader(
                color: color, size: loaderSize, strokeWidth: strokeWidth));
      },
    );
  } else {
    if (_isLoading) {
      _isLoading = show;
      navigationService.back();
    }
  }
}