From 7b8e983412ba1a0002f6ddcc67aea8ad7204aab8 Mon Sep 17 00:00:00 2001 From: 21pages Date: Mon, 26 Feb 2024 00:02:42 +0800 Subject: [PATCH] fix calling getWindowName before bind init (#7259) Signed-off-by: 21pages --- flutter/lib/main.dart | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/flutter/lib/main.dart b/flutter/lib/main.dart index a53dd14db..b6a2aad96 100644 --- a/flutter/lib/main.dart +++ b/flutter/lib/main.dart @@ -58,14 +58,12 @@ Future main(List args) async { // Because stateGlobal.windowId is a global value. argument['windowId'] = kWindowId; kWindowType = type.windowType; - final windowName = getWindowName(); switch (kWindowType) { case WindowType.RemoteDesktop: desktopType = DesktopType.remote; runMultiWindow( argument, kAppTypeDesktopRemote, - windowName, ); break; case WindowType.FileTransfer: @@ -73,7 +71,6 @@ Future main(List args) async { runMultiWindow( argument, kAppTypeDesktopFileTransfer, - windowName, ); break; case WindowType.PortForward: @@ -81,7 +78,6 @@ Future main(List args) async { runMultiWindow( argument, kAppTypeDesktopPortForward, - windowName, ); break; default: @@ -162,9 +158,9 @@ void runMobileApp() async { void runMultiWindow( Map argument, String appType, - String title, ) async { await initEnv(appType); + final title = getWindowName(); // set prevent close to true, we handle close event manually WindowController.fromWindowId(kWindowId!).setPreventClose(true); late Widget widget;