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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-18 16:28:32 +05:30
parent 5b373e8694
commit ee0151efe5
5 changed files with 47 additions and 15 deletions

View File

@@ -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(