From b0091d8554fc2fd095d76af790b558e79c71b6cb Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 15 Mar 2026 14:25:47 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20[UX=20improvement]=20?= =?UTF-8?q?Add=20tooltip=20to=20GitHub=20link?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: JustLookAtNow <12379683+JustLookAtNow@users.noreply.github.com> --- lib/pages/about_page.dart | 83 +++++++++++++++++++++------------------ pubspec.lock | 16 ++++---- 2 files changed, 53 insertions(+), 46 deletions(-) diff --git a/lib/pages/about_page.dart b/lib/pages/about_page.dart index 10a7203..3cc0b8b 100644 --- a/lib/pages/about_page.dart +++ b/lib/pages/about_page.dart @@ -65,53 +65,60 @@ class _AboutPageState extends State { const SizedBox(height: 8), Text( _version, - style: const TextStyle( - fontSize: 16, - color: Colors.grey, - ), + style: const TextStyle(fontSize: 16, color: Colors.grey), ), const SizedBox(height: 16), - InkWell( - onTap: () async { - try { - final Uri url = Uri.parse('https://github.com/JustLookAtNow/pt_mate'); - if (await canLaunchUrl(url)) { - await launchUrl(url, mode: LaunchMode.externalApplication); - } else { - // 降级处理:复制URL到剪贴板 - await Clipboard.setData(ClipboardData(text: url.toString())); + Tooltip( + message: '在浏览器中打开 GitHub 仓库', + child: InkWell( + onTap: () async { + try { + final Uri url = Uri.parse( + 'https://github.com/JustLookAtNow/pt_mate', + ); + if (await canLaunchUrl(url)) { + await launchUrl( + url, + mode: LaunchMode.externalApplication, + ); + } else { + // 降级处理:复制URL到剪贴板 + await Clipboard.setData( + ClipboardData(text: url.toString()), + ); + if (context.mounted) { + NotificationHelper.showInfo( + context, + '无法直接打开链接,已复制到剪贴板,请手动粘贴到浏览器', + duration: const Duration(seconds: 2), + ); + } + } + } catch (e) { + // 捕获任何异常并显示错误信息 if (context.mounted) { - NotificationHelper.showInfo( + NotificationHelper.showError( context, - '无法直接打开链接,已复制到剪贴板,请手动粘贴到浏览器', + '操作失败: $e', duration: const Duration(seconds: 2), ); } } - } catch (e) { - // 捕获任何异常并显示错误信息 - if (context.mounted) { - NotificationHelper.showError( - context, - '操作失败: $e', - duration: const Duration(seconds: 2), - ); - } - } - }, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - const Text( - 'https://github.com/JustLookAtNow', - style: TextStyle( - color: Colors.blue, - // decoration: TextDecoration.underline, + }, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Text( + 'https://github.com/JustLookAtNow', + style: TextStyle( + color: Colors.blue, + // decoration: TextDecoration.underline, + ), + overflow: TextOverflow.visible, + softWrap: true, ), - overflow: TextOverflow.visible, - softWrap: true, - ), - ], + ], + ), ), ), const SizedBox(height: 24), diff --git a/pubspec.lock b/pubspec.lock index 507755d..2ed0eaf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -69,10 +69,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" checked_yaml: dependency: transitive description: @@ -649,18 +649,18 @@ packages: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6" url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.18" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" meta: dependency: transitive description: @@ -1022,10 +1022,10 @@ packages: dependency: transitive description: name: test_api - sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636" url: "https://pub.dev" source: hosted - version: "0.7.7" + version: "0.7.9" timezone: dependency: transitive description: