hide static method

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

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

Hide loading context Sometimes, developers may need to pass in the current context by themselves.

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;
  }
}