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

View file

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

View file

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

View file

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