dismissSKProgressDialog function

Future<void> dismissSKProgressDialog({
  1. BuildContext? context,
  2. BuildContextPredicate buildContextPredicate = _defaultContextPredicate,
})

Implementation

Future<void> dismissSKProgressDialog({
  BuildContext? context,
  BuildContextPredicate buildContextPredicate = _defaultContextPredicate,
}) async {
  if (context == null) {
    _throwIfNoContext(_contextMap.values, 'showAlert');
  }
  context ??= buildContextPredicate(_contextMap.values);

  await lock.synchronized(() async {
    if (isProgressDismissed) {
      return;
    }
    isProgressDismissed = true;
    Navigator.of(context!, rootNavigator: true).pop(true);
  });
}