Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[syncfusion_flutter_calendar] view doesn't update when changing the state #27

Closed
Aljabri-Salman opened this issue Oct 20, 2020 · 2 comments

Comments

@Aljabri-Salman
Copy link

I am trying to switch calendar view in my app e.g ( from day to month ) but it doesn't to respond to state change. This happens in the latest version ( 18.3.42 ). When I tried the example given in : https://github.com/SyncfusionExamples/view-switching-calendar-flutter ; it seems to work in version ( syncfusion_flutter_calendar: ^17.4.39 ) but when updating the version to the latest it doesn't change.

@Indumathi1195R
Copy link

Indumathi1195R commented Oct 21, 2020

Hi @Aljabri-Salman ,

Based on the provided information, we have checked the mentioned issue “View doesn’t update when changing the state”. Now, we have implemented the view property on the controller for dynamic view switching. Kindly use the view property of the CalendarController for dynamic view updates.

Code snippet:

CalendarController _controller; 
 
@override 
void initState() { 
  _controller = CalendarController(); 
  super.initState(); 
} 
 
@override 
Widget build(BuildContext context) { 
  return Scaffold( 
    appBar: AppBar( 
      title: Text(widget.title), 
    ), 
    body: Center( 
      child: SfCalendar( 
        view: CalendarView.day,
        controller: _controller, 
      ), 
    ), 
    floatingActionButton: FloatingActionButton( 
      onPressed: () => _controller.view = CalendarView.week, 
      tooltip: 'Week View', 
      child: Icon(Icons.view_week), 
    ),  
  ); 
} 

Please find the changelog for the same.

Pub link: https://pub.dev/packages/syncfusion_flutter_calendar/changelog

We hope that this helps you. Please let us know if you need further assistance.

Regards,
Indumathi R

@Aljabri-Salman
Copy link
Author

yes that worked. I didn't see it.

Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants