Articles in this section
Category / Section

How to restrict the view navigation in the Flutter Calendar

1 min read

In the Flutter Event Calendar, restrict the view navigation by using the viewNavigationMode property value as 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 sample in GitHub

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 sign in to leave a comment
Access denied
Access denied