mirror of
https://github.com/wger-project/flutter.git
synced 2026-12-04 20:52:26 +01:00
Merge pull request #847 from RahulShaw321/fix/dashboard-calendar-crash
fix: defer loadEvents() to avoid context null crash
This commit is contained in:
@@ -78,7 +78,10 @@ class _DashboardCalendarWidgetState extends State<DashboardCalendarWidget>
|
||||
_events = <String, List<Event>>{};
|
||||
_selectedDay = _focusedDay;
|
||||
_selectedEvents = ValueNotifier(_getEventsForDay(_selectedDay!));
|
||||
loadEvents();
|
||||
//Fix: Defer context-dependent loadEvents() until after build
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
loadEvents();
|
||||
});
|
||||
}
|
||||
|
||||
void loadEvents() async {
|
||||
|
||||
Reference in New Issue
Block a user