kalender 0.19.1
kalender: ^0.19.1 copied to clipboard
This Flutter package offers a Calendar Widget featuring Day, MultiDay, Month and Schedule views. Moreover, it empowers you to tailor the visual aspects of the calendar widget.
0.19.1 #
Features #
- Added
MultiDayBodyConfiguration.keepPagesAlive(defaultfalse). When enabled, each visited multi-day page is kept alive and reused, so navigating back to it skips rebuilding every event tile. It is opt-in because cached pages stay in memory for the lifetime of the view. #293
Fixes #
- Fixed back-to-back events (one ending exactly when the next begins) rendering as overlapping at some zoom levels. An event's top and bottom now come from one shared time-to-pixel conversion, so touching tiles line up exactly instead of splitting on a rounding difference. #291
Performance #
- Sped up multi-day frame generation. #289
- The
visibleEventsnotifier now only publishes when the set of visible events actually changes, avoiding redundant work for listeners. #290 - The day view now builds only the event tiles within the visible scroll window (plus an overscan margin) instead of every event of the day, and skips the resize-handle scaffolding when resizing is disabled. #292
Tests #
0.19.0 #
Breaking Changes #
monthDayHeaderBuildernow receives a localized wall-clockDateTimeinstead of a UTC-flaggedInternalDateTime, matchingdayHeaderBuilder. #248- Replaced
ViewConfiguration.initialDateSelectionStrategywith per-dimension view-transition options:dateTransitionon all views, andscrollTransition/zoomTransitiononMultiDayViewConfiguration, each with an optional resolver for custom logic. #249 - View switches now preserve the vertical scroll (time-of-day) and zoom by default instead of resetting to
initialTimeOfDay; opt out withScrollTransition.reset/ZoomTransition.reset. #249 - Renamed
EmptyDayBehavior.showTodaytoEmptyDayBehavior.showOnlyToday, since it shows only today among empty days. #253 - Replaced
MultiDayBodyComponents.prototypeTimeLinewith atimelineWidthbuilder that returns the gutter width directly (double). The multi-day body, header and drag overlay now share this one width, so customizing the timeline can no longer misalign the header. Removed thePrototypeTimelinewidget andPrototypeTimeLineBuilder. #180
Features #
- Added
restorePerViewtransitions so each view can reopen its own last date, scroll, and zoom. #249 - Added
CalendarController.visibleTimeOfDayand theCalendarCallbacks.onScrollPositionChangedcallback. #249 - Added
ScheduleBodyConfiguration.leadingWidthto control the schedule view's date-column width. #253 - Added
TimelineStyle.widthto set an explicit multi-day timeline gutter width. #180 - Added
MonthBodyComponents.monthDayCellBuilderto style individual month-view day cells. Each call reports the cell's date, whether it is today, and whether it falls in the focused month (so adjacent-month days can be styled differently). Also added the ready-madeMonthDayCell.shadeAdjacentMonths()builder, which shades leading/trailing adjacent-month days. Pass acoloror let it default to a low-opacityonSurfaceoverlay that greys them out. #140 - Added
eventPaddingtoMonthBodyConfiguration(forwarded from the constructor and throughcopyWith), so month event tiles can be spaced likeMultiDayHeaderConfigurationalready allows. #252
Fixes #
- Fixed schedule view event tiles not lining up; every row now shares a fixed-width leading column whether or not it shows a date. #253
- Fixed the continuous schedule view scrolling to the wrong position when today has no events; the initial scroll and
animateToDateTimenow target today, or the nearest day when it is hidden. #253 - Fixed the free-scroll multi-day header "wobbling" (re-animating its height) whenever a calendar item changed; its paged content now keeps its state across rebuilds instead of being rebuilt from scratch. #282
- Fixed the free-scroll multi-day header clipping days that have more events than the leading day; the header now sizes to the tallest day currently in view. #283
- Fixed the multi-day/week header drifting out of alignment with the body when the timeline used a custom
stringBuilderor width; the gutter width now has a single source. #180 - The timeline gutter width now accounts for the text scale factor, so it no longer under-sizes when text is enlarged. #180
- The timeline gutter now measures every label across the day rather than a single sample, so a custom label format whose widest entry is not at 23:59 no longer clips. #180
Tests #
- Added end-to-end
CalendarViewregression coverage for the time indicator, run across the timezone matrix. #261 - Added end-to-end
CalendarViewtoday-highlighting coverage, run across the timezone matrix. #254 #251 - Added continuous schedule regression coverage for row alignment and the no-events-today scroll target. #253
- Added end-to-end month-view regression coverage for a custom
generateMultiDayLayoutFrame. #235 - Added regression coverage that the free-scroll header keeps its paged content's state across rebuilds. #282
- Added regression coverage that the free-scroll header fits the tallest visible day rather than only the leading page. #283
- Added regression coverage that the multi-day header and body day columns stay aligned across custom label formats, explicit widths, and right-to-left. #180
- Added regression coverage that a selected month-view event's focus aligns to its own row. #233
- Added coverage that
monthDayCellBuilderis invoked per day with the correct focused-month flags, and thatMonthDayCell.shadeAdjacentMonths()shades only the adjacent-month days. #140
0.18.7 #
Fixes #
- Fixed a blank page when a
displayRangespanned exactly one month, and the same off-by-one page count that dropped the final in-range page in the week, custom multi-day, and paginated schedule views. #266 - Fixed the month view showing a "+N more" overflow button when there were no events, and on very short row heights. Added end-to-end regression coverage. #255
0.18.6 #
Features #
- Added optional month-view week numbers via
MonthViewConfiguration.showWeekNumbers, with customizableMonthBodyComponents.weekNumberBuilderandMonthBodyComponentStyles.weekNumberStyle.
Fixes #
- Fixed a month-view regression where the
dropTargetTilepreview could fail to render while resizing an event.
0.18.5 #
Fixes #
- Fixed an issue where the highlighted selection border (
dropTargetTile) was painted on the wrong tile or missing entirely in month view overlapping events and the "X more" overflow drop-down. - Fixed a bug where the
TimeIndicatorwould disappear when zooming the calendar before any page navigation had occurred.
0.18.4 #
0.18.3 #
Fixes #
ResizeHandleandResizeHandlesnow take alengthparameter to provide properly sizedDraggablefeedback widgets instead of an empty layout, improving the resizing feedback.
0.18.2 #
Features #
TapDetailfrom*WithDetailcallbacks now calculates the exactDateTimeunder the cursor or finger tap based on spatio-temporal position within the event UI, rather than returning the event's start time.
0.18.1 #
Features #
- Added support for secondary gestures (right-clicks) on empty calendar spaces:
onSecondaryTapped,onSecondaryLongPressedand theirWithDetailvariants. - Added support for secondary gestures (right-clicks) on events:
onEventSecondaryTappedandonEventSecondaryTappedWithDetail.
Fixes #
- Fixed an issue where
DayDetailandMultiDayDetailexposed internalInternalDateTimeandInternalDateTimeRangeobjects without timezone offsets applied. All tap details now correctly apply.forLocation()to expose wall-clock DateTimes to consumers. - Fixed some raw callbacks (
onLongPressed,onSecondaryLongPressed) leaking internal representations instead of.forLocation()adjusted ones.
0.18.0 #
Features #
- New
NowCallbacktypedef andViewConfiguration.nowCallbackfield to decouple the time indicator, today highlighting, and schedule empty-day logic from the calendar's configuredLocation. InternalDateTime.isToday()now accepts an optionalDateTime? nowparameter, allowing callers to override what "today" means.DayHeader,MonthDayHeader, andScheduleDatereadnowCallbackfrom the view configuration and use it for today highlighting. When set, it takes priority over theLocation-based check.EmptyDayBehavior.showTodayinScheduleBodynow respectsnowCallback.- Added static
todayKeyconstants onDayHeader,MonthDayHeader, andScheduleDatefor easier widget-test assertions.
Fixes #
- TimeOfDay extensions (incorrect copyWith)
- Week and DayHeaders returning InternalDateTime
- Resize handle dragAnchorStrategy
- CalendarEvent passed to builders (sometimes outdated)
Tests #
- Added unit tests for
InternalDateTime.isToday(now:)parameter. - Added widget tests for
nowCallback-driven today highlighting acrossDayHeader,MonthDayHeader, andScheduleDate. - Added widget tests for time indicator positioning with
nowCallback.
0.17.0 #
Breaking Changes #
ResizeHandlePositionertypedef now takes an additionalbool isImpreciseparameter.ResizeHandlesabstract class now requires anisImpreciseconstructor parameter.
Features #
- New
InputModeenum (auto,precise,imprecise) onCalendarInteractionreplaces platform-based mobile/desktop detection for resize handle behavior. - Resize handle positioning and visibility is now driven by input precision (mouse/stylus/trackpad vs touch) instead of platform (
iOS/Android). InputMode.auto(default) detects input type dynamically — hover triggers precise mode, selection triggers imprecise mode.- New
allowHorizontalImpreciseResizeoption onCalendarInteractionto opt-in to horizontal resize handles for touch input (disabled by default). CalendarInteraction.resolveIsImprecise()provides a way to query the resolved input mode.- Removed direct
isMobileDeviceusage from resize handle widgets.
0.16.0 #
Breaking Changes #
CalendarEventis no longer generic. Thedatafield and<T>type parameter have been removed. Custom data should now be added by extendingCalendarEventdirectly.- Event IDs changed from
inttoString. This affectsaddEvent(returnsString),addEvents(returnsList<String>),removeById,byId, and any code that stores or compares event IDs. EventTile.eventIdis now aString.MultiDayOverlayEventTilerenamed toMultiDayEventOverlayTile.EventsControllerfolder moved into thecontrollersfolder; update any direct imports.
Features #
CalendarEventis now extensible. Attach custom fields (title, color, etc.) by sub-classing and overridingcopyWith. See the updated examples for guidance.CalendarEventgained alayoutEqualsmethod used internally for optimized layout rebuilds.
Fixes #
fix:SnapPoints calculation.fix:Visible events not updating correctly after a change.fix:Pointer events now pass through the time indicator widget.- Various bugs uncovered by the expanded test suite.
Improvements #
EventLayoutDelegateCacheis now cleared automatically whenheightPerMinutechanges.eventsFromDateTimeRange— thelocationparameter is no longer required.- Vertical drag-target behavior improved.
DefaultEventsControlleris now exported fromkalender.dartdirectly.
Tests #
- Extensive test additions and refactoring across controllers, layout delegates, drag targets, interactions, view configurations and callbacks.
- Added a tool (
tool/test_timezones_linux.dart) for running the test suite under multiple timezones on Linux.
Contributors #
CalendarEventextensibility,EventsControlleras a full interface, and event/group ID migration toStringcontributed by RedDuality.
0.15.0 #
- feat: Added timezone support.
- feat: Use
linked_pageviewpackage for linked scrolling between multi-day header and body. PR #247 - fix: Wrong current date highlighting due to extension method issues. PR #260 / #251
- fix: Schedule body rendering issue.
- fix: SnapPoints calculation.
- fix:
EventLayoutDelegateCachenot being cleared whenheightPerMinutechanges. - fix:
MultiDayViewControllernow correctly exposes a page offset listener.
Breaking Changes #
- Added InternalDateTime and InternalDateTimeRange classes accessible through
kalender/extensions.dart. - Moved
asUtcandasLocalextensions to InternalDateTime. EventLayoutStrategynow takes aInternalDateTimeinstead of a DateTime.GenerateMultiDayLayoutFramenow takes aInternalDateTimeRangeinstead of a DateTime.CalendarEventstores start and end times in utc format.- Removed initial date from
CalendarControllerthis is now set in theViewConfigurationof theCalendarWidget. **** - Replaced
visibleDateTimeRangeUtcvalueNotifier in theCalendarControllerwith a nullableinternalDateTimeRange. (visibleDateTimeRangeis remains the same). - The
EventsController.eventsFromDateTimeRangenow usesInternalDateTimeRangeand takes a nullableLocationfrom the timezone package. - Changes to the
DefaultDateMapto accommodate different timezones, any custom implementations will need to be updated. EventTileUtilsmixin was also updated to use the new internal date time classes.PageNavigationFunctionswas renamed toPageIndexCalculatorand updated to use internal date time classes.- Multiple default components where updated to use the new internal date time classes instead of date time classes.
- ViewConfiguration renamed
selectedDatetoinitialDateTime. CalendarHeaderandCalendarBodyno longer takeValueNotifiersand will instead create and dispose ValueNotifiers created from values passed to them.
0.14.3 #
- feat: Made TextAlign and TextOverflow configurable for TimelineStyle. PR #242 Thanks to quaaantumdev
- fix: Various issues while dragging events on multi-day view. PR #240 Thanks to redninjacat.
- fix: Drag and drop issues. PR #238 Thanks to redninjacat.
- fix: erroneous warning in month_body PR #237 Thanks to redninjacat.
0.14.2 #
- fix: Tile and ResizeHandleWidget rebuild issues.
0.14.0 #
- feat: Custom onWillAcceptWithDetails functions for DragTargets. #213
API Change #
- Resize Handles are now only rendered when the cursor is hovering on a tile or when a tile is selected on mobile.
- Added a [ResizeHandles] abstract widget and [DefaultResizeHandles] widget that allows for more customization.
- Replaced vertical/horizontal resize handle positioners from [TileComponents] with a single [ResizeHandlePositioner].
0.13.0 #
- feat: Improved TimeLine and HourLines widgets. #216
- feat: Improved DayHeader and DayHeaderStyle. PR #218
- feat: Improved CalendarCallbacks. #133 / #30
- Added
onTappedWithDetail,onLongPressedandonLongPressedWithDetailcallbacks. - DeprecatedonMultiDayTapped. (UseonTappedWithDetailinstead). - Not providingonEventTappedandonEventTappedWithDetailwill remove internal gesture detectors for events, removing interference for GestureDetectors added to EventTileBuilders. - Added mixins (DayEventTileUtilsandMultiDayEventTileUtils) for EventTileBuilders that have their own gesture detectors. - AddedonEventCreateWithDetailas used in the new advanced example. - fix: DayDragTarget
calculateLocalCursorPosition, add scroll offset after converting to local coordinate space.
0.12.0 #
- feat: Added
eventComparatortodefaultMultiDayFrameGeneratorthanks to captaingerhard. PR #210
0.11.1 #
0.11.0 #
0.10.0 #
- feat: Added locale property to CalenderView allowing users to specify a language with the intl package. #172
- feat: Add string builder to MultiDayPortalOverlayButtonStyle for easy override of the text. #172
- fix: MultiDayPortalOverlayButtonStyle not using style overrides. #172
- fix: Overlap when scrolling. #174
- fix: ScheduleView reload issues. #170
0.9.0 #
0.8.0 #
Features #
- Reimplemented schedule view. discussion 122, #130
- The tile builder is no longer a required parameter, default tiles are now provided. (Highly recommended to override these.)
0.7.2 #
0.7.1 #
0.7.0 #
Features #
- Ability to limit the number of events in MultiDayHeader. #141 / #147
MultiDayHeaderConfigurationChanges:- Added
maximumNumberOfVerticalEvents - Added
generateMultiDayLayoutFrame
- Added
- Added
overlayBuilderstoMultiDayHeaderComponentsfor customizing the overlay.
- MonthBody limits the number of events displayed based on size constraints. #141 / #147
- Added
overlayBuilderstoMonthBodyComponentsfor customizing the overlay.
- Added
- Added a new callback
OnEventTappedWithDetail. #141 / #148
Migrations #
- Deprecated MultiDayEventLayoutStrategy this should be migrated to use the new
GenerateMultiDayLayoutFrame
Improvements #
- The
defaultMultiDayGenerateFrameimproves on thedefaultMultiDayLayoutStrategyby allowing events to fill empty spaces.
Fixes #
0.6.7 #
0.6.6 #
- fix: MultiDayHeaderWidget layout regressions.
- Added widget tests for MultiDayHeaderWidget.
0.6.5 #
- fix: SingleDayView RenderFlex overflow.
0.6.3 #
- fix: Event snapping not always working.
0.6.1 #
- Changed
VerticalTileResizeHandlePositionerto never use more than 1/4 of the height of the event tile on desktop.
0.6.0 #
- Package will use Semantic versioning from 0.6.0 onwards.
Breaking changes #
- The
EventsControlleris now an abstract class, useDefaultEventsControllerinstead. - The
ViewConfigurationno longer contains the configuration forinteractionandsnapping. These are now separate classes that are passed directly to theBody/Header.
What's new #
- There is a new callback
onTappedinCalendarCallbacks.- This is now called when the user taps on an empty space a calendar (Multiday body).
- There is a new callback
onMultiDayTappedinCalendarCallbacks.- This is called when the user taps on an empty space in the calendar (Multiday Header / Month body).
- MultiDayBodyConfiguration added
horizontalPaddingthis padding is located between events and the edge of day. - There is now a
CalendarInteractionandCalendarSnappingclass that can be passed to theCalendarBody/CalendarHeaderas a ValueNotifier. This allows the calendar view to change these behaviors without rebuilding the entire view. CalendarSnappingnow has aeventSnapStrategythat can be used to define custom snapping behavior when creating new events. #119
Fixes #
Boring stuff #
- Lots of new unit tests that run in multiple timezones to ensure there are no regressions.
- Example directory layout has changed.
0.5.0 #
Breaking changes: #
Version 0.5.0 has quite a few Breaking changes, there is no easy way to migrate to this version. Here are a few important things that have changed.
-
The CalendarView now takes a
headerCalendarHeader andbodyCalendarBody widgets. You can wrap these widgets in other widgets to style them as seen here -
Event tiles now make use of the Draggable widget provided by flutter. Take a look at the TileComponents for more details on how tiles work now. This opens some interesting possibilities for displaying multiple calendars.
-
The CalendarCallbacks (previously
CalendarEventHandlers) have been changed so more information is given when an interaction occurs. -
The schedule view has been removed, but will be reimplemented in the future.
What's new #
- Auto scroll/paging (https://github.com/werner-scholtz/kalender/issues/75 && https://github.com/werner-scholtz/kalender/issues/64)
- Calender can now accept Draggable's (https://github.com/werner-scholtz/kalender/issues/48)
- More information for the TileBuilder (https://github.com/werner-scholtz/kalender/issues/83)