cupertino_calendar_picker 3.0.0
cupertino_calendar_picker: ^3.0.0 copied to clipboard
This package includes a suite of Cupertino-style components that make date and time selection seamless and visually consistent with iOS design principles.
3.0.0 #
Breaking changes #
- Migrated to the standalone
cupertino_uiandmaterial_uipackages; apps must migrate as well (see the migration guide). Theflutter_localizationsdependency was removed; useGlobalMaterialLocalizations.delegatesfrommaterial_ui. - Requires Flutter
3.47.0and Dart3.13.0. - Fixed misspelled names:
onOusideTapOrDateSelect,hasOusideTapDismissandtransparentAndBluredare nowonOutsideTapOrDateSelect,hasOutsideTapDismissandtransparentAndBlurred. - Typed action callbacks:
CancelCupertinoCalendarAction.onPressedis aVoidCallbackandConfirmCupertinoCalendarAction.onPressedis aValueChanged<DateTime>.onPressedwas removed from theCupertinoCalendarActionbase class, and a cancel action never equals a confirm action. - Action labels default to the localized "Cancel" and "OK" instead of
'Cancel'and'Done'.CupertinoCalendarAction.labelis nullable; useeffectiveLabelto get the displayed label. widgetRenderBoxofshowCupertinoCalendarPickerandshowCupertinoTimePickeris optional; without it the picker is centered.- Decoration fields are non-nullable where a default exists. The header and the selected and current day styles default to
CupertinoColors.systemRedwhen nomainColoris given.
New #
- Accessibility: screen reader semantics for all parts of the picker, announcement of the displayed month, and keyboard activation of buttons. (Thanks to @mikailsyr)
horizontalSpacingandverticalSpacingforCupertinoCalendarPickerButtonandCupertinoTimePickerButton.- Exported
CupertinoCalendarActionandCalendarButtonFormatter. - Value equality for decoration classes;
constconstructors forCupertinoCalendarandCalendarMonthPickerDecoration. CalendarDismissBehavior.onActionTapasserts that at least one action is provided.
Fixes #
- Picker result: the cancel action no longer returns the changed date and the confirm action no longer returns
null. With a confirm action, closing the picker in any other way returnsnull.CupertinoCalendarPickerButtonnow displays the confirmed date. - Placement: the picker stays on the screen and outside of the safe area in all cases: when the screen rotates, on screens narrower than the picker, for anchors partially off the screen, in nested navigators, and with a horizontal
offset. It keepsoffsetfrom its anchor and is centered on the screen when it would otherwise shrink below half of its size. - Date range: the initial date and time are limited to
minimumDateTime...maximumDateTimein all widgets, including when the range changes; this also fixes an assertion when today is outside of the range. The AM/PM switcher, the year picker and times that are not a multiple ofminuteIntervalno longer produce invalid values. - Range changes: when a changed
minimumDateTimeormaximumDateTimemoves the selection into the range,CupertinoCalendar,CupertinoCalendarPickerButtonandCupertinoTimePickerButtonreport it throughonDateTimeChanged/onTimeChanged, and the displayed month no longer jumps. - Buttons:
CupertinoCalendarPickerButtonandCupertinoTimePickerButtonno longer fill the whole width of their parent. - Actions: actions of a compact
CupertinoCalendaroutside of an overlay no longer pop the hosting route, and the picker no longer closes a route pushed on top of it. - Decorations:
copyWithkeeps the values that were not passed, and dynamic colors adapt to dark mode in all decorations, includingPickerContainerDecoration.PickerContainerDecoration.withDynamicColornow only limits the opacity of a custom color instead of raising it. - Localization: 12-hour times follow the locale (e.g.
下午 3:07), one-letter weekdays are no longer repeated in Chinese and Arabic, and the chevrons are mirrored in right-to-left layouts. - Stability fixes for disposed widgets and animations.
2.2.6 #
- Added
selectableDayPredicatecallback parameter to the calendar, allowing certain dates to be disabled. (Thanks to @Menelphor)
2.2.5 #
- Added
useRootNavigatorparameter to dialog functions and buttons, allowing to disable the root navigator for displaying the picker. (Thanks to @pablodekeyzer)
2.2.4 #
- Fixed an issue with wrong weekday generation caused by daylight saving time differences. (Thanks to @vixez)
2.2.3 #
- Fixed an issue where
xAlignmentwas calculated incorrectly when theCupertinoCalendarPickerdownscaled because of the lack of space. (Thanks to @maxfrees) - Added accessibility text scaling to the
CupertinoCalendarPickerandCupertinoPickerButtonwidgets. (Thanks to @ervindobri) - Default
fontSizeforCalendarMonthPickerSelectedDayandCalendarMonthPickerSelectedCurrentDayhas been decreased from22.0to20.0.
2.2.2 #
- Fixed an issue when
setStatewas called after theCupertinoPickerButtonwas disposed. (Thanks to @nightmre789)
2.2.1 #
- The
intlpackage version constraint has been updated to the range>=0.19.0 <0.21.0. (Thanks to @KoheiKanagu)
2.2.0 #
- Added
CupertinoCalendarActionlist to theCupertinoCalendarwidget, allowing to display actions at the bottom of the calendar. - Added
CalendarDismissBehavior.onActionTapallowing to dismiss the calendar only when an action is tapped.
2.1.7 #
- Added
firstDayOfWeekIndexparameter to calendar widgets, allowing customization of the starting day of the week. If not specified, the locale's default value is used.
2.1.6 #
- Added
onCompletedcallback toCupertinoCalendarPickerButtonandCupertinoTimePickerButton. (Thanks to @MrLightful) - The minimum required Flutter SDK is set to
v3.24.0. - The minimum required Dart SDK is set to
v3.2.0.
2.1.5 #
- Updated the
scaleAlignmentcalculation for the X-axis.
2.1.4 #
- Thanks to @desarrolladorits2 for the following changes:
- Fixed a bug that caused an exception during time parsing in certain localizations.
dayPeriodTextStyleproperty has been added to theCalendarFooterDecorationclass.
2.1.3 #
- Fixed scrolling behavior in Date/Time pickers when using a mouse on Desktop and Web platforms. (Thanks to @klondikedragon)
2.1.2 #
- Removed redundant assertions for
currentDateTime. (Thanks to @danielshuk)
2.1.1 #
CustomCupertinoDatePickerwas updated to use the version introduced in Flutter3.27.0agetter was replaced byalphato maintain compatibility with the current minimum SDK version.
2.1.0 #
intlpackage is now being used for date and time formatting.withOpacitymethod was replaced bywithAlphadue to deprecation.
2.0.1 #
use24hFormatparam has been added to all widgets. (Thanks to @sargntpi)dismissBehaviorparam has been added to theCupertinoCalendarPickerButtonwidget.
2.0.0+1 #
READMEupdate.
2.0.0 #
Major Updates:
- New
showCupertinoTimePickerfunction which can be used for time selection. - New
CupertinoCalendarPickerButtonwidget. - New
CupertinoTimePickerButtonwidget. - New
CupertinoCalendarwidget. Which is now can be used asinlinecalendar. - New
CupertinoCalendarModeparameter withdateanddateTimeoptions, enabling the calendar to select both date and time within the picker.
Minor Updates:
- The
CupertinoCalendarPickerupdates: -
- The
monthDateStyleis now animated when switching between the month/year picker and month picker modes.
- The
-
- Weekdays are now aligned more accurately.
-
- The month/year picker mode switching animation has been updated.
Breaking Changes:
CalendarContainerDecorationhas been renamed toPickerContainerDecoration.CalendarBackgroundTypehas been renamed toPickerBackgroundType.dismissBehaviourhas been renamed todismissBehavior.minimumDatehas been renamed tominimumDateTime.maximumDatehas been renamed tomaximumDateTime.initialDatehas been renamed toinitialDateTime.currentDatehas been renamed tocurrentDateTime.onDateChangedhas been renamed toonDateTimeChanged.
1.1.2 #
- The
CalendarDismissBehaviorenum was added to specify different dismiss behaviors. - The
onDateSelectedparameter was added. - The
showCupertinoCalendarPickerfunction now returns aDateTime. - Fixed an issue where the calendar closed without animation when the Android back button was tapped. (Thanks to @JCKodel)
1.1.1 #
- Fixed an issue where
safeAreatop wasn't considered in the position calculation. - Fixed an issue where
CalendarContainerDecorationwasn't applied to the calendar.
1.1.0 #
- Updates to the
CupertinoCalendarPickerposition calculation:- The calendar will be downscaled if it doesn't fit on a screen.
safeAreais now considered in the calculation.verticalSpacingis now considered in the calculation.- Available space calculation fixes.
- New parameters added to the
showCupertinoCalendarPicker:verticalSpacingto set the minimum space between the edge of the screen and the calendar.barrierColorfor the overlay background color.
- Updates to the
CalendarContainerDecorationclass:- Default
boxShadowhas been updated. CalendarBackgroundTypeenum added withplainColorandtransparentAndBluredvalues.
- Default
- Other improvements:
- The
innerAlignmentof the calendar is alwaystopCenternow. - The selected day will remain after the month/year wheel value change.
- The
1.0.3 #
cupertino_iconsdependency addedwidgetRenderBoxis required nowpubspecscreenshots update
1.0.2 #
- Decoration classes updated (copyWith, documentation)
pubspecupdate
1.0.1 #
READMEfixpubspecupdate
1.0.0 #
- The cupertino calendar package release.
