Articles in this section
Category / Section

How to restrict the view navigation in the Flutter Calendar

1 min read

In the Flutter Event Calendar, you can restrict the view navigation by setting the viewNavigationMode property to ViewNavigationMode.none.

child: Column(
  children: [
    Container(
      child: TextButton(
        child: Text('Restrict view navigation'),
        onPressed: () {
          setState(() {
            _viewNavigationMode = ViewNavigationMode.none;
          });
        },
      ),
    ),
    Expanded(
      child: SafeArea(
          child: SfCalendar(
        view: CalendarView.day,
        allowedViews: [
          CalendarView.day,
          CalendarView.week,
          CalendarView.workWeek,
          CalendarView.month,
          CalendarView.timelineDay,
          CalendarView.timelineWeek,
          CalendarView.timelineWorkWeek,
          CalendarView.timelineMonth,
        ],
        dataSource: _getCalendarDataSource(),
        viewNavigationMode: _viewNavigationMode,
      )),
    )
  ],
),

View the GitHub sample here

Flutter calendar view restriction

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied