You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The event I added with EventController seem not to work and the event won't be shown. Please tell me how to make it work.
I want you to tell me how to use this EventController with another MonthCalendar. I wish I use riverpod for it. class WeekCalendar extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: WeekView( controller: EventController(), eventTileBuilder: (date, events, boundry, start, end) { // Return your widget to display as event tile. return Container(); }, showLiveTimeLineInAllDays: true, // To display live time line in all pages in week view. width: 400, // width of week view. heightPerMinute: 1, // height occupied by 1 minute time span. eventArranger: SideEventArranger(), // To define how simultaneous events will be arranged. onDateLongPress: (time) { try { final event = CalendarEventData( date: DateTime(2022, 6, 17), startTime: DateTime(2022, 6, 17, 15), endTime: DateTime(2022, 6, 17, 18), event: "Event 1", title: 'test', ); EventController().add(event); print(EventController().getEventsOnDay(DateTime(2022, 6, 17))); } catch (e) { print(e); } }, */ )); } }
The text was updated successfully, but these errors were encountered:
@Timememory6 You are creating new instance of EventController every time. That won't work. You have to create only one instance of EventController and pass it to WeekView. Also, Use same instance to add events as well.
ex,
The event I added with EventController seem not to work and the event won't be shown. Please tell me how to make it work.
I want you to tell me how to use this EventController with another MonthCalendar. I wish I use riverpod for it.
class WeekCalendar extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: WeekView( controller: EventController(), eventTileBuilder: (date, events, boundry, start, end) { // Return your widget to display as event tile. return Container(); }, showLiveTimeLineInAllDays: true, // To display live time line in all pages in week view. width: 400, // width of week view. heightPerMinute: 1, // height occupied by 1 minute time span. eventArranger: SideEventArranger(), // To define how simultaneous events will be arranged. onDateLongPress: (time) { try { final event = CalendarEventData( date: DateTime(2022, 6, 17), startTime: DateTime(2022, 6, 17, 15), endTime: DateTime(2022, 6, 17, 18), event: "Event 1", title: 'test', ); EventController().add(event); print(EventController().getEventsOnDay(DateTime(2022, 6, 17))); } catch (e) { print(e); } }, */ )); } }
The text was updated successfully, but these errors were encountered: