Enrich kerala_pincodes.json with lat/lng for all 463 entries via
pgeocode offline DB (453 exact matches + 10 district centroids).
Update SearchScreen _LocationItem to carry lat/lng fields, load them
from JSON on init, and pass them through every selection path
(_selectWithPincode, _selectAndClose, search result onTap).
Result: selecting Chavakkad (or any Kerala city) now pops
{label, pincode, lat:10.59322, lng:76.0297} → home_screen saves coords
to prefs → getEventsByLocation sends lat/lng to Django → haversine
filtering returns events within 10km radius, expanding to 25/50/100km
if fewer than 6 events found.
Root cause: SearchScreen popped with a plain city label string; the
pincode was available in search results but discarded. home_screen only
saved the display label to prefs and never updated the 'pincode' key,
so every API call always sent {pincode:'all'} regardless of selection.
GPS path had the same issue — lat/lng were obtained but thrown away
after reverse-geocoding; only the label was passed back.
Fix:
- SearchScreen now pops with Map<String,dynamic> {label, pincode,
lat?, lng?} instead of a plain String
- Pincode results return their pincode; GPS returns actual coordinates;
popular city chips look up the first matching pincode from the
Kerala pincodes DB (fallback 'all' if not found)
- home_screen._openLocationSearch() saves pincode + lat/lng to prefs
and updates _pincode/_userLat/_userLng in state
- home_screen._loadUserDataAndEvents() prefers getEventsByLocation
(haversine) when GPS coords are saved, falls back to getEventsByPincode
- EventsService gains getEventsByLocation(lat, lng) which sends
latitude/longitude/radius_km to the existing Django haversine endpoint
and auto-expands radius 10→25→50→100 km until ≥ 6 events found
Three root causes of the perceived scroll/animation lag:
1. profile_screen.dart — AnimationController listener called setState() on
every animation frame (60fps × 2s = 120 full-tree rebuilds). The entire
ProfileScreen with its nested lists and images was rebuilding 60 times per
second just to update two small widgets (EXP bar + stat counters).
Fix: remove setState() from listeners entirely; wrap only the EXP bar
(LayoutBuilder) and stat row (IntrinsicHeight) in AnimatedBuilder so
only those two leaf widgets re-render per frame.
2. learn_more_screen.dart — PageView.onPageChanged called setState() on
every swipe, rebuilding the full event detail screen (blurred bg image,
map, about section, etc.) just to update the 6px dot indicators.
Fix: int _currentPage → ValueNotifier<int> _pageNotifier; wrap only the
dot row and the blurred background image in ValueListenableBuilder.
3. search_screen.dart — BackdropFilter(ImageFilter.blur) without a
RepaintBoundary forces Flutter to read every pixel behind the blur widget
and composite it every frame. When the user scrolls the underlying list,
the blur repaints continuously causing frame drops.
Fix: wrap BackdropFilter in RepaintBoundary to isolate its repaint layer.
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
- Make web responsive layout use width-based mobile detection (820px)
- Add date filter chips that actually filter events by date ranges
- Custom calendar dialog with event dots on Date chip tap
- Update location search with Kerala cities and pincode display
- Fix calendar screen overflow errors and broken event indicators
- Replace thumbnail indicators with clean colored dots
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>