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;