fix: improve navigation stack and ensure square cover aspect ratios

Navigation fixes:
- Change goNamed to pushNamed in all library browser pages
- Maintains proper back navigation stack
- Back button now goes step by step instead of to beginning
- Prevents app from closing when navigating back from book detail

Grid layout fixes:
- Book covers are now always square (1.0 aspect ratio)
- Overall card aspect ratio is 0.75 to provide space for text
- Wrap cover in AspectRatio widget instead of using Expanded
- Ensures title and author info always visible below covers
- Fixes issue where book info was missing in series view
This commit is contained in:
Claude 2025-11-20 21:03:15 +00:00
parent cf0778e263
commit 8667bd03dd
No known key found for this signature in database
4 changed files with 8 additions and 7 deletions

View file

@ -77,7 +77,7 @@ class FilteredLibraryItemsPage extends HookConsumerWidget {
padding: const EdgeInsets.all(16),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 0.65,
childAspectRatio: 0.75,
crossAxisSpacing: 12,
mainAxisSpacing: 16,
),
@ -192,7 +192,7 @@ class LibraryItemCard extends ConsumerWidget {
return InkWell(
onTap: () {
// Navigate to item detail page
context.goNamed(
context.pushNamed(
Routes.libraryItem.name,
pathParameters: {'itemId': item.id},
);
@ -200,8 +200,9 @@ class LibraryItemCard extends ConsumerWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// Book cover
Expanded(
// Book cover - always square
AspectRatio(
aspectRatio: 1.0,
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: imageUrl != null

View file

@ -105,7 +105,7 @@ class AuthorCard extends HookConsumerWidget {
child: InkWell(
onTap: () {
// Navigate to filtered items page with author filter
context.goNamed(
context.pushNamed(
Routes.libraryFiltered.name,
extra: {
'filter': AuthorFilter(author.id),

View file

@ -86,7 +86,7 @@ class GenreListTile extends StatelessWidget {
trailing: const Icon(Icons.chevron_right),
onTap: () {
// Navigate to filtered items page with genre filter
context.goNamed(
context.pushNamed(
Routes.libraryFiltered.name,
extra: {
'filter': GenreFilter(genre),

View file

@ -110,7 +110,7 @@ class SeriesListTile extends StatelessWidget {
trailing: const Icon(Icons.chevron_right),
onTap: () {
// Navigate to filtered items page with series filter
context.goNamed(
context.pushNamed(
Routes.libraryFiltered.name,
extra: {
'filter': SeriesFilter(series.id),