From 206602fca6ccfa4097a431dceca508e09d5e57dd Mon Sep 17 00:00:00 2001 From: Sicherhaven Date: Mon, 30 Mar 2026 20:20:15 +0530 Subject: [PATCH] fix: fetch full event details in background to show important information When navigating from the home screen, LearnMoreScreen now shows the pre-loaded event data instantly, then silently fetches full details from the event-details API in the background. This fills in fields missing from the slim list endpoint (important_information, images, important_info) without showing a loading spinner. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/screens/learn_more_screen.dart | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/screens/learn_more_screen.dart b/lib/screens/learn_more_screen.dart index f651b2b..f2ae148 100644 --- a/lib/screens/learn_more_screen.dart +++ b/lib/screens/learn_more_screen.dart @@ -52,7 +52,11 @@ class _LearnMoreScreenState extends State { if (widget.initialEvent != null) { _event = widget.initialEvent; _loading = false; - WidgetsBinding.instance.addPostFrameCallback((_) => _startAutoScroll()); + WidgetsBinding.instance.addPostFrameCallback((_) { + _startAutoScroll(); + // Fetch full event details in background to get important_information, images, etc. + _loadFullDetails(); + }); } else { _loadEvent(); } @@ -71,6 +75,21 @@ class _LearnMoreScreenState extends State { // Data loading // --------------------------------------------------------------------------- + /// Silently fetch full event details to fill in fields missing from the list + /// endpoint (important_information, images, etc.) without showing a loader. + Future _loadFullDetails() async { + try { + final ev = await _service.getEventDetails(widget.eventId); + if (!mounted) return; + setState(() { + _event = ev; + }); + _startAutoScroll(); + } catch (_) { + // Silently fail — the pre-loaded data is already displayed + } + } + Future _loadEvent() async { setState(() { _loading = true;