In the Flutter Event Calendar, you can programmatically navigate to the adjacent dates by using the forward and backward method of CalendarController. Inside the state, initialize the calendar controller. final CalendarController? _controller = CalendarController(); Use the forward and backward properties of controller for programmatically change the adjacent dates. Row( children: [ Container( margin: const EdgeInsets.fromLTRB(30, 20, 0, 20), child: RaisedButton.icon( icon: Icon(Icons.arrow_back), label: Text('Backward'), onPressed: () { _controller.backward(); }, ), ), Container( margin: const EdgeInsets.fromLTRB(70, 20, 0, 20), child: RaisedButton.icon( label: Text('Forward'), icon: Icon(Icons.arrow_forward), onPressed: () { _controller.forward(); }, ), ) ], ), Assign _controller to the controller property of the calendar. child: SfCalendar( controller: _controller, ),
|
This page will automatically be redirected to the sign-in page in 10 seconds.