Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion lib/widgets/festival_menu_sheets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,24 @@ class FestivalSelectorSheet extends StatelessWidget {
sortedFestivals: festivals,
isSelected: isSelected,
onTap: () {
// Capture current path first, before any state changes
// Default to festival home; override if currently on favorites
String targetPath = buildFestivalHome(festival.id);
try {
final currentPath = GoRouterState.of(context).uri.path;
// Preserve user's tab: if on favorites, stay on favorites
if (currentPath.endsWith('/favorites')) {
targetPath = buildFavoritesPath(festival.id);
}
} catch (e) {
// GoRouterState unavailable (e.g., in tests), keep default path
debugPrint('Festival selector: Unable to get current route, using default: $e');
}

final router = GoRouter.maybeOf(context);
provider.setFestival(festival);
Navigator.pop(context);
router?.go('/${festival.id}');
router?.go(targetPath);
},
onInfoTap: () {
Navigator.pop(context);
Expand Down