show method

void show({
  1. String? contentLoading,
  2. int timeOut = 45,
})

Implementation

void show({String? contentLoading, int timeOut = 45}) {
  _onLoading = true;
  showDialog(
    context: context,
    barrierDismissible: allowDismiss,
    barrierColor: Colors.black12.withOpacity(0.5),
    builder: (context) {
      return GestureDetector(
        onLongPress: () {
          Navigator.pop(context);
        },
        onTap: () {
          AlertUtils.showToast(EzWidgetConfig.alertBackText);
        },
        child: LoadingDialogView(
          contentLoading: contentLoading ?? EzWidgetConfig.loadingText,
          onLoadingClose: _onLoadingClose,
          style: style,
        ),
      );
    },
  ).timeout(Duration(seconds: timeOut), onTimeout: () {
    dismiss();
  });
}