Skip to content

Commit

Permalink
build(calendar): Version 0.4.9 #83
Browse files Browse the repository at this point in the history
* Proper execution of _updateEventsMap() when neccessary
* Closes #83
  • Loading branch information
agfeo committed Aug 14, 2024
1 parent 25a6cdf commit 8183dcf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [0.4.9] - 2024-08-14
* Issue #83: Updating the internal data possible again

## [0.4.8] - 2024-08-13
* Issue #82: Top row restructured, so that "Today" button is always centered, even when the date picker icon or the list picker icon is hidden

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.4.6"
version: "0.4.7"
flutter_platform_widgets:
dependency: transitive
description:
Expand Down
15 changes: 15 additions & 0 deletions lib/flutter_neat_and_clean_calendar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ class _CalendarState extends State<Calendar> {
List<NeatCleanCalendarEvent>? _selectedEvents;
bool isDarkMode = false;

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

Expand All @@ -244,6 +245,20 @@ class _CalendarState extends State<Calendar> {
}));
}

@override
void didUpdateWidget(covariant Calendar oldWidget) {
super.didUpdateWidget(oldWidget);
// Überprüfen, ob die neuen Events sich von den alten unterscheiden
if (oldWidget.eventsList != widget.eventsList) {
// When setting the initial date, the eventsmap must be updated. The eventsmap is used to
// store the events for each day. The eventsmap is used to display the events in the calendar.
// It is basically the internal store of the events. Because the events are passed as a list
// to the calendar, the eventsmap must be created from the list. This is done in the
// _updateEventsMap method.
_updateEventsMap();
}
}

/// The method [_updateEventsMap] has the purpose to update the eventsMap, when the calendar widget
/// is initiated. When this method executes, it fills the eventsMap with the contents of the
/// given eventsList. This can be used to update the events shown by the calendar.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: >-
Simple and clean flutter calendar with ability to slide up/down to show
weekly/monthly calendar. Fork of
https://pub.dev/packages/flutter_clean_calendar
version: 0.4.8
version: 0.4.9
homepage: https://github.com/rwbr/flutter_neat_and_clean_calendar

environment:
Expand Down

0 comments on commit 8183dcf

Please sign in to comment.