fl_list_wheel 1.0.0
fl_list_wheel: ^1.0.0 copied to clipboard
Extended ListWheelScrollView and CupertinoPicker with a unified option set, plus date, time and linkage pickers.
Changelog #
1.0.0 #
First stable release, built on Flutter 3.47 / Dart 3.13.
Added #
FlPickerPresenter/FlBottomSheetPickerPresenter/FlPickerSession: one global presenter now opens the sheet and installs a session so confirm/cancel closes the correct route. Everyshow()also accepts a per-callpresenter.- Chinese API documentation for all public widgets, parameters and typedefs.
- A complete English usage guide in
README.md, including presenter options, per-call presenters, inlineFlPickerSessionusage, migration notes and a web demo link. - A responsive example gallery covering every picker, with inline previews, themed bottom sheets and result panels.
The
Presentationdemo shows the global presenter, a custom Cupertino presenter and an inline dialog session.
Improved #
- Material and custom wheels now use
FixedExtentScrollPhysicsby default, so they snap to whole items likeCupertinoPicker. Pass anotherphysicstoFlWheelOptionsto opt out. FlListWheelStateclamps the initial item, keeps the current selection when the parent rebuilds, only disposes the controller it created itself, and appliesinitialItemchanges after the controller attaches.FlSingleListPickerkeeps its initial selection when confirming without interaction, ignores out-of-range or duplicated initial indices, and re-clamps them whenitemCountchanges.FlMultiListWheelPickerkeeps selections across rebuilds, clamps out-of-range positions and supports horizontal scrolling.FlMultiListLinkagePickerhonours the initialvalueand clamps positions against the current data.FlMultiListWheelLinkagePickeronly resets whenvaluechanges, keeps column keys stable, resets lower columns when a parent column changes, and notifiesonChangedsynchronously before rebuilding child columns.FlPickerSubjectallowsbackgroundColoranddecorationtogether (decorationwins), uses a 1:3:1 header layout and closes through theFlPickerSessioninstalled by the presenter.FlDateTimePickercenters each number/unit pair as a compact group, so two-column time pickers no longer spread the columns and their unit labels across the full sheet width.DateTimePickercomputes days in month without DST issues, clamps the day index when the month changes and guards controller jumps that are not attached yet.FlSingleListWheelPickerowns and disposes its controller; the constructor is nowconst. ItsitemWidthis honoured, an out-of-rangeinitialIndexis clamped, and confirming an emptyitemCountreturnsnull.FlSingleListPickerin single-choice mode keeps at most one initial selection, andFlSingleListPickerOptionsgains anitemExtentfor fixed-height rows.FlMultiListWheelLinkagePickerrebuilds child columns after the current frame instead of a fixed 50 ms delay.FlMultiListLinkagePickergains anitemExtentfor fixed-height rows.FlPickerSubjectmerges the theme text style instead of replacing it, marks the cancel/confirm areas as buttons for screen readers, and aligns them withAlignmentDirectionalfor RTL layouts.FlListWheel.presentercan be cleared together with the global wheel options via the newFlListWheel.reset().FlDatePickerreports the initial value throughonChangedafter the first frame, matchingFlDateTimePicker, and asserts in debug mode when the range exceeds 200 years.- The iOS example app is named
FlListWheelon the home screen. - Example wheels use a taller item extent and smaller text so labels are not clipped while scrolling.
Changed #
- All public classes, typedefs and extensions now use the
Flprefix, for exampleFlDatePicker,FlDateTimePicker,FlPickerOptions,FlWheelOptions,FlSingleListPicker,FlPickerPresenter,FlPickerSession,FlSelectIndexedChangedFunctionandFlDatePickerExtension, so they are easy to recognise and less likely to clash with other packages. Update your type references when upgrading. FlWheelOptions.mergeno longer copiesisCupertinofrom the overriding options: a plainFlWheelOptions(...)used to tweak a single wheel silently switched the global Cupertino style to Material. Change the style globally viaFlListWheel.wheelOptions(or construct a completeFlWheelOptions) instead.FlListWheel.showPickeris nowasync, so a missing presenter surfaces as a failedFutureinstead of a synchronous throw.FlListWheel.onNotificationnow returns the callback's result, so returningtruestops the notification from bubbling.FlPickerSubjectTapCallbackreturnsT?; returningnulltreats the result as "no selectable value". Existing implementations that returnTkeep working.- Removed unused APIs:
PickerStatelessWidget,DatePickerUnitBuilder,FlDatePickerUnit.getLength(),FlDateTimePickerUnit.length,FlPickerLinkageItem.toMap()andFlSelectIndexedChanged.
Fixed #
FlDatePickerconfirmation could read a stale position when the sheet was dismissed right after scrolling.FlDatePickerwithout a year column showed duplicate months such as multiple01when the range crossed years.FlDatePickercould not select adefaultDatein a later year, or in the first month of a year.FlDatePickerday generation is DST-safe, and the result is built from the selected date instead of parsed text (fixesdual: false).DateTime.getDaysForRangeiterates calendar days instead of adding 24-hour durations.FlDateTimePickerclamps the confirmed time into[startDate, endDate], so hiding the month column can no longer return an out-of-range value.FlSingleListPickerno longer reports an out-of-range index afteritemCountshrinks; selection state now has a single source of truth.FlMultiListWheelPickerreturnsnullwhen any column hasitemCount: 0, because no valid index exists for that column.FlDatePickerrebuilds its options whenitemBuilderchanges, instead of keeping the old labels.FlListWheelscroll callbacks report the real item index with or without a controller.FlPickerSubjectno longer falls back to Flutter's debug text style (monospace with a yellow underline) when a custom presenter such asshowCupertinoModalPopupprovides no Material text context.FlCustomPicker.show()is generic (FlCustomPicker<T>), so the confirmed value keeps its type.
Compatibility #
- Requires Flutter 3.47 or newer and Dart 3.13.
FlListWheel.push/FlListWheel.popwere removed. AssignFlListWheel.presenter = FlBottomSheetPickerPresenter(...)once instead;.show()still works without aBuildContext.flutter_lints6, a 120-column formatter andalways_use_package_importsin both the package and the example.
0.0.4 #
- Migrated to Flutter 3.47 / Dart 3.13, upgraded
flutter_lintsto 6 and rewrote the example as a responsive gallery. - Various picker fixes and lifecycle improvements; see the 1.0.0 notes above for the consolidated list.
0.0.3 #
- Update version.
0.0.2 #
- Change the
paddingofFlPickerOptionstotitlePadding.
0.0.1 #
- Initialization package.