perf: optimize scrolling and image loading performance

Added performance optimizations to all library browser views:

- Added cacheExtent: 500 to all GridView/ListView builders to pre-render
  items and reduce stuttering during scrolling
- Wrapped grid items in RepaintBoundary to isolate repaints and improve
  performance
- Optimized CachedNetworkImage with:
  - fadeInDuration/fadeOutDuration: Duration.zero to remove animation overhead
  - memCacheHeight: 300 to limit in-memory cache size
  - maxHeightDiskCache: 600 to resize images for better performance

These changes should significantly reduce the stuttering observed when
scrolling the authors grid and filtering books, especially on first load.
This commit is contained in:
Claude 2025-11-20 22:18:20 +00:00
parent ccb8318341
commit b434f73b2a
No known key found for this signature in database
4 changed files with 18 additions and 2 deletions

View file

@ -29,6 +29,7 @@ class LibraryGenresPage extends HookConsumerWidget {
return ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8),
cacheExtent: 500, // Pre-render items for smoother scrolling
itemCount: sortedGenres.length,
itemBuilder: (context, index) {
final genre = sortedGenres[index];