From 3a63f1acfa828320a6b52780b0298d8c6cd03f55 Mon Sep 17 00:00:00 2001 From: xkeyC <3334969096@qq.com> Date: Sun, 29 Oct 2023 11:04:22 +0800 Subject: [PATCH] update auto login --- lib/main.dart | 2 +- lib/ui/home/webview/webview.dart | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 203420e..e5e9caa 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -105,7 +105,7 @@ Widget _defaultWebviewTitleBar(BuildContext context) { ) : const SizedBox(width: 24), const SizedBox(width: 12), - SelectableText("${state.url}"), + SelectableText(state.url ?? ""), const Spacer() ], )); diff --git a/lib/ui/home/webview/webview.dart b/lib/ui/home/webview/webview.dart index 8989164..516ba69 100644 --- a/lib/ui/home/webview/webview.dart +++ b/lib/ui/home/webview/webview.dart @@ -55,9 +55,6 @@ class WebViewModel { userDataFolderWindows: "${AppConf.applicationSupportDir}/webview_data", title: title)); - if (loginMode) { - await webview.setWebviewWindowVisibility(false); - } // webview.openDevToolsWindow(); webview.isNavigating.addListener(() async { if (!webview.isNavigating.value && localizationResource.isNotEmpty) { @@ -157,6 +154,8 @@ class WebViewModel { webview.close(); } }); + Future.delayed(const Duration(seconds: 1)) + .then((value) => {webview.setWebviewWindowVisibility(false)}); } } catch (e) { showToast(context, "初始化失败:$e");