From 4a357024bc1d10961f288218fdb3979b02c8d4e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E9=94=8B?= <2535831261@qq.com> Date: Sat, 8 Aug 2026 13:29:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BF=9D=E5=AD=98=E8=AE=B0?= =?UTF-8?q?=E5=88=86=E6=97=A0=E6=B3=95=E8=BF=94=E5=9B=9E=E4=B8=8A=E4=B8=80?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/point_book_home_screen.dart | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/lib/features/home/presentation/point_book_home_screen.dart b/lib/features/home/presentation/point_book_home_screen.dart index c74bb52..cb2c3d5 100644 --- a/lib/features/home/presentation/point_book_home_screen.dart +++ b/lib/features/home/presentation/point_book_home_screen.dart @@ -64,9 +64,9 @@ class PointBookHomeScreen extends ConsumerWidget { } Future _openRecords(BuildContext context) async { - await Navigator.of(context).push( - MaterialPageRoute(builder: (_) => const PointBookListPage()), - ); + await Navigator.of( + context, + ).push(MaterialPageRoute(builder: (_) => const PointBookListPage())); } Future _startScoring(BuildContext context, WidgetRef ref) async { @@ -105,24 +105,19 @@ class PointBookHomeScreen extends ConsumerWidget { builder: (_) => const PointBookCreatePage(), ), ); + // Create already popped itself before returning, so the stack is [Home] + // here. A plain push yields [Home, Edit] and back/popUntil lands on Home. if (created != null && context.mounted) { - await _goToEdit(context, created, replacePrevious: true); + await _goToEdit(context, created); } } - Future _goToEdit( - BuildContext context, - PointRecord record, { - bool replacePrevious = false, - }) async { - final route = MaterialPageRoute( - builder: (_) => PointBookEditPage(recordId: record.id), + Future _goToEdit(BuildContext context, PointRecord record) async { + await Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => PointBookEditPage(recordId: record.id), + ), ); - if (replacePrevious) { - Navigator.of(context).pushReplacement(route); - } else { - await Navigator.of(context).push(route); - } } Future _showDraftConfirm(BuildContext context) { @@ -194,7 +189,10 @@ class _EntitlementBanner extends StatelessWidget { } class _EntryButtons extends StatelessWidget { - const _EntryButtons({required this.onOpenRecords, required this.onStartScoring}); + const _EntryButtons({ + required this.onOpenRecords, + required this.onStartScoring, + }); final VoidCallback onOpenRecords; final VoidCallback onStartScoring;