905086
2026-11-09 cbb26873e88a7a13e868448c1cc578ce70b8c6ae
fluttergamebox/lib/pages/main_shell.dart
@@ -620,7 +620,7 @@
      case '游戏恢复':
        _showToast('游戏恢复功能:重新下载可恢复游戏文件');
      case '重启应用':
        _showToast('应用重启中...');
        _restartApp();
      case '检查更新':
        _showToast('当前已是最新版本!');
      case '退出应用':
@@ -628,6 +628,21 @@
    }
  }
  /// 重启应用:启动新的应用进程后退出当前进程
  Future<void> _restartApp() async {
    try {
      // 以分离模式启动当前应用的 exe(带原有启动参数)
      await Process.start(
        Platform.resolvedExecutable,
        Platform.executableArguments,
        mode: ProcessStartMode.detached,
      );
    } catch (_) {
      // 启动失败时仍尝试退出(下次手动打开)
    }
    exit(0);
  }
  void _showToast(String msg) {
    final ctx = context;
    // 使用全局 overlay 显示