perf: add memCacheWidth/memCacheHeight to all thumbnail images
All CachedNetworkImage instances in list/card contexts now decode at 2x rendered size instead of full resolution. A 3000x2000 event photo previously decoded to ~24MB in GPU memory even when shown at 96px — now decodes to <1MB. Affected screens (16 CachedNetworkImage instances total): - home_screen.dart: hero (800w), top card (300w), stacked (192w), horizontal (440x360), full-width (800x400), search (112x112), filter sheet (160x160), type icons (112x112) - home_desktop_screen.dart: mini (128x128), grid (600x280), horiz (600x296) - calendar_screen.dart: event card (400x300) - profile_screen.dart: avatar (size*2), event tile (120x120) learn_more_screen.dart intentionally unchanged — full-res for detail view. Estimated memory reduction: ~500MB → ~30MB for a typical home screen.
This commit is contained in:
@@ -777,6 +777,8 @@ class _HomeDesktopScreenState extends State<HomeDesktopScreen> with SingleTicker
|
||||
child: img != null
|
||||
? CachedNetworkImage(
|
||||
imageUrl: img,
|
||||
memCacheWidth: 128,
|
||||
memCacheHeight: 128,
|
||||
width: 64,
|
||||
height: 64,
|
||||
fit: BoxFit.cover,
|
||||
@@ -833,6 +835,8 @@ class _HomeDesktopScreenState extends State<HomeDesktopScreen> with SingleTicker
|
||||
child: img != null
|
||||
? CachedNetworkImage(
|
||||
imageUrl: img,
|
||||
memCacheWidth: 600,
|
||||
memCacheHeight: 280,
|
||||
width: double.infinity,
|
||||
height: imageHeight,
|
||||
fit: BoxFit.cover,
|
||||
@@ -944,6 +948,8 @@ class _HomeDesktopScreenState extends State<HomeDesktopScreen> with SingleTicker
|
||||
child: img != null
|
||||
? CachedNetworkImage(
|
||||
imageUrl: img,
|
||||
memCacheWidth: 600,
|
||||
memCacheHeight: 296,
|
||||
width: width,
|
||||
height: imageHeight,
|
||||
fit: BoxFit.cover,
|
||||
|
||||
Reference in New Issue
Block a user