From 08762ca727daf42802211bcde322a42b29f9f6c2 Mon Sep 17 00:00:00 2001 From: 21pages Date: Thu, 29 Jun 2023 06:25:17 +0800 Subject: [PATCH 1/3] fix note dialog Signed-off-by: 21pages --- flutter/lib/common/widgets/dialog.dart | 2 +- flutter/lib/desktop/pages/desktop_setting_page.dart | 2 +- flutter/lib/models/user_model.dart | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flutter/lib/common/widgets/dialog.dart b/flutter/lib/common/widgets/dialog.dart index 5f9205fdc..8fa7b9068 100644 --- a/flutter/lib/common/widgets/dialog.dart +++ b/flutter/lib/common/widgets/dialog.dart @@ -1100,7 +1100,7 @@ showSetOSAccount( showAuditDialog(SessionID sessionId, dialogManager) async { final controller = TextEditingController(); - dialogManager.show((setState, close) { + dialogManager.show((setState, close, context) { submit() { var text = controller.text.trim(); if (text != '') { diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 817e1b476..fe617140a 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -1403,7 +1403,7 @@ class _AccountState extends State<_Account> { child: Column( children: [ text('Username', gFFI.userModel.userName.value), - text('Group', gFFI.groupModel.groupName.value), + // text('Group', gFFI.groupModel.groupName.value), ], ), )).marginOnly(left: 18, top: 16); diff --git a/flutter/lib/models/user_model.dart b/flutter/lib/models/user_model.dart index 39e440364..f24cca429 100644 --- a/flutter/lib/models/user_model.dart +++ b/flutter/lib/models/user_model.dart @@ -165,6 +165,7 @@ class UserModel { static Future> queryLoginOptions() async { try { final url = await bind.mainGetApiServer(); + if (url.trim().isEmpty) return []; final resp = await http.get(Uri.parse('$url/api/login-options')); return jsonDecode(resp.body); } catch (e) { From 52b8cbcd4806250e76f175cf1613cfb068a3ffd3 Mon Sep 17 00:00:00 2001 From: 21pages Date: Thu, 29 Jun 2023 10:02:19 +0800 Subject: [PATCH 2/3] mobile material effect Signed-off-by: 21pages --- flutter/lib/common.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index e4d8416d1..67091db7a 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -288,8 +288,8 @@ class MyTheme { tabBarTheme: const TabBarTheme( labelColor: Colors.black87, ), - splashColor: Colors.transparent, - highlightColor: Colors.transparent, + splashColor: isDesktop ? Colors.transparent : null, + highlightColor: isDesktop ? Colors.transparent : null, splashFactory: isDesktop ? NoSplash.splashFactory : null, textButtonTheme: isDesktop ? TextButtonThemeData( @@ -377,8 +377,8 @@ class MyTheme { scrollbarTheme: ScrollbarThemeData( thumbColor: MaterialStateProperty.all(Colors.grey[500]), ), - splashColor: Colors.transparent, - highlightColor: Colors.transparent, + splashColor: isDesktop ? Colors.transparent : null, + highlightColor: isDesktop ? Colors.transparent : null, splashFactory: isDesktop ? NoSplash.splashFactory : null, textButtonTheme: isDesktop ? TextButtonThemeData( From 07d916249101401fc3ca27da714b61236f3b80c2 Mon Sep 17 00:00:00 2001 From: 21pages Date: Thu, 29 Jun 2023 10:26:03 +0800 Subject: [PATCH 3/3] remove PopupMenuButton default tooltip, and then long press will pop up menu Signed-off-by: 21pages --- flutter/lib/common/widgets/chat_page.dart | 1 + flutter/lib/mobile/pages/connection_page.dart | 1 + flutter/lib/mobile/pages/file_manager_page.dart | 3 +++ flutter/lib/mobile/pages/server_page.dart | 1 + 4 files changed, 6 insertions(+) diff --git a/flutter/lib/common/widgets/chat_page.dart b/flutter/lib/common/widgets/chat_page.dart index 119103753..0e6be569e 100644 --- a/flutter/lib/common/widgets/chat_page.dart +++ b/flutter/lib/common/widgets/chat_page.dart @@ -23,6 +23,7 @@ class ChatPage extends StatelessWidget implements PageShape { @override final appBarActions = [ PopupMenuButton( + tooltip: "", icon: Icon(Icons.group), itemBuilder: (context) { // only mobile need [appBarActions], just bind gFFI.chatModel diff --git a/flutter/lib/mobile/pages/connection_page.dart b/flutter/lib/mobile/pages/connection_page.dart index 5a581f0c7..3f8fdd32e 100644 --- a/flutter/lib/mobile/pages/connection_page.dart +++ b/flutter/lib/mobile/pages/connection_page.dart @@ -215,6 +215,7 @@ class _WebMenuState extends State { Widget build(BuildContext context) { Provider.of(context); return PopupMenuButton( + tooltip: "", icon: const Icon(Icons.more_vert), itemBuilder: (context) { return (isIOS diff --git a/flutter/lib/mobile/pages/file_manager_page.dart b/flutter/lib/mobile/pages/file_manager_page.dart index d6e366ad6..3fceba240 100644 --- a/flutter/lib/mobile/pages/file_manager_page.dart +++ b/flutter/lib/mobile/pages/file_manager_page.dart @@ -131,6 +131,7 @@ class _FileManagerPageState extends State { ), actions: [ PopupMenuButton( + tooltip: "", icon: Icon(Icons.more_vert), itemBuilder: (context) { return [ @@ -473,6 +474,7 @@ class _FileManagerViewState extends State { setState(() {}); }) : PopupMenuButton( + tooltip: "", icon: Icon(Icons.more_vert), itemBuilder: (context) { return [ @@ -585,6 +587,7 @@ class _FileManagerViewState extends State { onPressed: controller.goToParentDirectory, ), PopupMenuButton( + tooltip: "", icon: Icon(Icons.sort), itemBuilder: (context) { return SortBy.values diff --git a/flutter/lib/mobile/pages/server_page.dart b/flutter/lib/mobile/pages/server_page.dart index d4fbbb498..8eadcaa2b 100644 --- a/flutter/lib/mobile/pages/server_page.dart +++ b/flutter/lib/mobile/pages/server_page.dart @@ -23,6 +23,7 @@ class ServerPage extends StatefulWidget implements PageShape { @override final appBarActions = [ PopupMenuButton( + tooltip: "", icon: const Icon(Icons.more_vert), itemBuilder: (context) { listTile(String text, bool checked) {