perf: fix remaining 11 performance issues across 5 screens
Critical — Image.network → CachedNetworkImage: - home_screen.dart: hero/carousel banner image now cached with placeholder - profile_screen.dart: avatar and event list tile images now cached - calendar_screen.dart: event card images now cached with placeholder High: - profile_screen.dart: TextEditingControllers in dialogs now properly disposed via .then() and after await to prevent memory leaks Medium: - search_screen.dart: shrinkWrap:true → ConstrainedBox(maxHeight:320) + ClampingScrollPhysics for smooth search result scrolling - learn_more_screen.dart: MediaQuery.of(context) cached once per method instead of being called multiple times on every frame
This commit is contained in:
@@ -1216,10 +1216,12 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: img != null && img.isNotEmpty
|
||||
? Image.network(
|
||||
img,
|
||||
? CachedNetworkImage(
|
||||
imageUrl: img,
|
||||
fit: BoxFit.cover,
|
||||
errorBuilder: (context, error, stackTrace) =>
|
||||
placeholder: (_, __) => Container(
|
||||
decoration: const BoxDecoration(color: Color(0xFF1A2A4A))),
|
||||
errorWidget: (_, __, ___) =>
|
||||
Container(decoration: AppDecoration.blueGradientRounded(radius)),
|
||||
)
|
||||
: Container(
|
||||
|
||||
Reference in New Issue
Block a user