hide static method

dynamic hide({
  1. BuildContext? context,
})

隐藏 loading。 context 有时,开发者可能需要自行传入当前 context

Implementation

static hide({BuildContext? context}) {
  _timer?.cancel();
  _timer = null;
  if (context != null) {
    _cacheContext = context;
  }
  if (_isShow && _cacheContext != null) {
    _isShow = false;
    Navigator.pop(_cacheContext!);
    _cacheContext = null;
  }
}