Skip to content

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

Closed

Description

@Aljabri-Salman

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.

Activity

  1. Indumathi1195R commented on Oct 21, 2020

    @Indumathi1195R

    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

  2. Aljabri-Salman commented on Oct 21, 2020

    @Aljabri-Salman
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions