close method

dynamic close()

关闭悬浮窗

Implementation

close() {
  // 无论 _isShowing 状态如何,都要清理 OverlayEntry
  // 因为 hideFloating 只是隐藏视图但不移除 OverlayEntry
  if (_overlayEntry != null) {
    try {
      _overlayEntry!.remove();
      _overlayEntry!.dispose();
    } catch (e) {
      // ignore
    }
    _overlayEntry = null;
  }
  _isShowing = false;
  _notifyClose();
}