From 8f3c9f029c09e5ae3814d881289d88592da0548f Mon Sep 17 00:00:00 2001 From: My-Responsitories <107370289+My-Responsitories@users.noreply.github.com> Date: Wed, 12 Nov 2025 07:33:28 +0800 Subject: [PATCH] opt: const page (#1736) --- lib/pages/share/view.dart | 2 +- lib/pages/video/download_panel/view.dart | 2 +- lib/utils/page_utils.dart | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pages/share/view.dart b/lib/pages/share/view.dart index c923320ea..82661486f 100644 --- a/lib/pages/share/view.dart +++ b/lib/pages/share/view.dart @@ -177,7 +177,7 @@ class _SharePanelState extends State { onTap: () async { _focusNode.unfocus(); UserModel? userModel = await Navigator.of(context).push( - GetPageRoute(page: ContactPage.new), + GetPageRoute(page: () => const ContactPage()), ); if (userModel != null) { _userList diff --git a/lib/pages/video/download_panel/view.dart b/lib/pages/video/download_panel/view.dart index 4f99e6a86..4f4da826d 100644 --- a/lib/pages/video/download_panel/view.dart +++ b/lib/pages/video/download_panel/view.dart @@ -528,7 +528,7 @@ class _DownloadPanelState extends State { _buildBottomBtn( text: '查看缓存', onTap: () => Navigator.of(context).push( - GetPageRoute(page: DownloadPage.new), + GetPageRoute(page: () => const DownloadPage()), ), ), ], diff --git a/lib/utils/page_utils.dart b/lib/utils/page_utils.dart index 7e2af9917..6f063a6c2 100644 --- a/lib/utils/page_utils.dart +++ b/lib/utils/page_utils.dart @@ -77,7 +77,7 @@ abstract class PageUtils { ); } else if (context.mounted) { UserModel? userModel = await Navigator.of(context).push( - GetPageRoute(page: ContactPage.new), + GetPageRoute(page: () => const ContactPage()), ); if (userModel != null) { selectedIndex = 0; @@ -710,7 +710,7 @@ abstract class PageUtils { } } - static Future? toVideoPage({ + static Future? toVideoPage({ VideoType videoType = VideoType.ugc, int? aid, String? bvid,