We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug The DayView widget doesn't rebuild after changing content via state.
Code snippet
Widget _buildDayView() { List<FlutterWeekViewEvent> meetings = selectedWeekDay.meetings.map((meeting) { print('Meeting: ${meeting.title}, date: ${meeting.startDate}'); return FlutterWeekViewEvent( title: meeting.title, description: meeting.description, start: meeting.startDate, end: meeting.endDate, ); }).toList(); print('Meetingscount: ${meetings.length}'); print('SelectedDate: ${selectedWeekDay.date}'); var dayView = DayView( date: selectedWeekDay.date, events: meetings, ); print('DayEvents: ${dayView.events}'); return dayView; }
Console
- I/flutter ( 8800): Meeting: Meeting 1 , date: 2020-02-17 10:00:00.000 - I/flutter ( 8800): Meeting: Meeting 2 , date: 2020-02-17 11:00:00.000 - I/flutter ( 8800): Meeting: Meeting 3 , date: 2020-02-17 13:00:00.000 - I/flutter ( 8800): Meetingscount: 3 - I/flutter ( 8800): SelectedDate: 2020-02-17 00:00:00.000Z - I/flutter ( 8800): DayEvents: [Instance of 'FlutterWeekViewEvent', Instance of 'FlutterWeekViewEvent', Instance of 'FlutterWeekViewEvent']
After changing date via state:
- I/flutter ( 8800): Meeting: Meeting 4 , date: 2020-02-18 10:00:00.000 - I/flutter ( 8800): Meeting: Meeting 5 , date: 2020-02-18 13:00:00.000 - I/flutter ( 8800): Meetingscount: 2 - I/flutter ( 8800): SelectedDate: 2020-02-18 00:00:00.000Z - I/flutter ( 8800): DayEvents: [Instance of 'FlutterWeekViewEvent', Instance of 'FlutterWeekViewEvent']
Expected behavior DayView should rebuild its content.
Tablet (please complete the following information):
The text was updated successfully, but these errors were encountered:
When I remove the widget via code and add it again, it has the new content.
Sorry, something went wrong.
I think it's because the state is creating a copy of events (which allows to reorder them and to place them in the stack).
This should be managed in didUpdateWidget. Will take a look at this.
didUpdateWidget
4abc059
Skyost
No branches or pull requests
Describe the bug
The DayView widget doesn't rebuild after changing content via state.
Code snippet
Console
After changing date via state:
Expected behavior
DayView should rebuild its content.
Tablet (please complete the following information):
The text was updated successfully, but these errors were encountered: