Hello,
i want to catch controller.view when allowed view is changed from view.month to view.timlinemonth ,but on tap method is not including changing allowed view .
Can anyone help me?
Scaffold(
body: SfCalendar(
headerHeight: 60,
showNavigationArrow: true,
viewNavigationMode: ViewNavigationMode.snap,
headerStyle: const CalendarHeaderStyle(
textAlign: TextAlign.center,
backgroundColor: Color(0xff015176),
textStyle: TextStyle(color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 20)
),
view: CalendarView.month,
allowedViews: [
CalendarView.day,
CalendarView.week,
CalendarView.month,
CalendarView.timelineMonth
],
viewHeaderHeight: 60,
viewHeaderStyle: ViewHeaderStyle(backgroundColor: Colors.grey,
dayTextStyle: TextStyle(color: Colors.white, fontSize: 15)),
backgroundColor: _calendarColor,
controller: _controller,
initialDisplayDate: DateTime.now(),
todayHighlightColor: Colors.black,
monthViewSettings: MonthViewSettings(showAgenda: true),
timeSlotViewSettings:
TimeSlotViewSettings(timelineAppointmentHeight: 100),
dataSource: MeetingDataSource(_getDataSource()),
appointmentBuilder: appointmentBuilder,
onTap: calendarTapped,
)
void calendarTapped(CalendarTapDetails details) {
if(_controller.view==Month){
isScheduler=false;}else{
isScheduler=true;}
}
|
body: SfCalendar(
view: CalendarView.month, controller: _controller, dataSource: _getCalendarDataSource(), allowedViews: [CalendarView.month,CalendarView.timelineMonth,CalendarView.timelineWeek], onViewChanged: viewChanged, ) void viewChanged(ViewChangedDetails viewChangedDetails) { if(_controller.view==CalendarView.month) { // To do your requirement here. } else { // To do your requirement here. } } |
Hello
Indumathi,
I want when i click one of allowed views to get the value of what i am clicking.
Is there any possibility?
Thank you!