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) <noreply@anthropic.com>
This commit is contained in:
2026-03-30 20:20:15 +05:30
parent ee97c54f73
commit 206602fca6

View File

@@ -52,7 +52,11 @@ class _LearnMoreScreenState extends State<LearnMoreScreen> {
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<LearnMoreScreen> {
// 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<void> _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<void> _loadEvent() async {
setState(() {
_loading = true;