Showing multiple calendars with shared calendar controller bug

Hi.

I've been using the flutter calendar pretty well up until version 19.1.58 to display multiple calendars next to each other and synchronize them with one CalendarController.
But starting with version 19.1.59, I'm seeing a null safety error show on all calendars except the first one. Something related to a late variable being used before being initialised.
At the time of writing, we're on version 19.1.66 and the issue is still there.
Are you aware of this bug? If not, I believe it's fairly easy recreate, by using one CalendarController with multiple calendars.
Please let me know if you have a workaround for it, or planning to fix it in upcoming releases.

Thank you.

Kind regards,
Cris 

10 Replies 1 reply marked as answer

IR Indumathi Ravichandran Syncfusion Team June 2, 2021 01:06 PM UTC

Hi Cristinel, 
 
Thank you for contacting Syncfusion support. 
 
Based on the provided information, we have checked the mentioned issue “Calendar shows error when sharing single controller with multiple calendar”. We have prepared the simple sample with two calendar and assign the single controller properties (selectedDate, displayDate, view) for two calendars and there is no error, and it is working fine as expected from our end. Please find the sample from the following link. 
 
Sample link: 
 
If possible, can you please check the sample and let us know if you still facing the same issue? If not, please modify the sample based on your scenario and revert us back with below details. 
 
·       Code snippet related to calendar 
·       Issue reproducing video 
 
It would be helpful for us to analyze and provide you a solution at the earliest. 
 
Regards, 
Indumathi R 



CN Cristinel Negoianu June 2, 2021 01:15 PM UTC

Thanks for the prompt reply.
I will look at your sample and see what I'm doing differently. 
I try to reproduce it in that sample and get back to you.


IR Indumathi Ravichandran Syncfusion Team June 3, 2021 05:14 AM UTC

Hi Cristinel, 
 
Thank you for the update. We will wait until further response hear from you. 
 
Regards, 
Indumathi R 



CN Cristinel Negoianu June 3, 2021 05:58 AM UTC

Hello again.

I managed to replicate the issue on your example.
I could resend you the code, but the only change that is required is adding the initState method and setting the view property on the controller as below:

  @override
  void initState() {
    super.initState();

    _calendarController.view = CalendarView.week;
  }


IR Indumathi Ravichandran Syncfusion Team June 4, 2021 07:51 AM UTC

Hi Cristinel, 
 
Thank you for the update. 
 
We have already found and fixed the mentioned issue “Late variable initialization error with single controller with multiple calendars”. We will include the issue fix in our upcoming Weekly Nuget release, which is expected to be rolled out by June 8, 2021 and let you know once the release rolled out. We appreciate your patience until then. 
 
Regards, 
Indumathi R 



CN Cristinel Negoianu June 4, 2021 08:15 AM UTC

Hi.

Thanks for letting me know.
I don't mind waiting for the fix.

Kind regards,
Cris


IR Indumathi Ravichandran Syncfusion Team June 4, 2021 08:43 AM UTC

Hi Cristinel, 
 
Thank you for the update. We will let you know once the release rolled out and we appreciate your patience until then. 
 
Regards, 
Indumathi R 



IR Indumathi Ravichandran Syncfusion Team June 8, 2021 09:41 AM UTC

Hi Cristinel, 
 
Thank you for your patience. 
 
We have fixed the mentioned issue “Late variable initialization error with single controller with multiple calendars” and included the issue fix in our latest Weekly Nuget package version 19.1.67. Kindly update to the latest version for resolving this issue. Also please find the latest version from the following link, 
 
 
We hope that this helps you. Please let us know if you need further assistance. 
 
Regards, 
Indumathi R 


Marked as answer

CN Cristinel Negoianu June 8, 2021 09:49 AM UTC

Thanks, I've tried it and it works.


IR Indumathi Ravichandran Syncfusion Team June 8, 2021 11:58 AM UTC

Hi Cristinel, 
 
Thank you for the update. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Indumathi R 


Loader.
Up arrow icon