void _onViewChanged(ViewChangedDetails viewChangedDetails) {
SchedulerBinding.instance.addPostFrameCallback((duration) {
setState(() {
_future = /// code for getting future
});
}
But using CalendarView.schedule will not trigger the onViewChanged event. What I want to achieve is to incremental load additional items as the user navigates throug the view. Is this possible? I want to avoid that all the events are loaded.
Best regards,
Michael
view: CalendarView.week, dataSource: getCalendarDataSource(), loadMoreWidgetBuilder: loadMoreWidget ), return FutureBuilder<String>( initialData: 'loading', future: loadMoreAppointments(), builder: (context, snapShot) { return Container( height: _controller.view == CalendarView.schedule ? 50 : double.infinity, width: double.infinity, color: Colors.white38, alignment: Alignment.center, child: CircularProgressIndicator( valueColor: AlwaysStoppedAnimation(Colors.deepPurple))); }, ); } |