items_selector 2.1.0
items_selector: ^2.1.0 copied to clipboard
A Flutter package for selecting single or multiple items from a list or grid
2.1.0 #
π Added #
-
Generative constructor for
ListSelector:- Previously,
ListSelectorcould only be used viaListSelector.builderandListSelector.separated. - Now, the main constructor (
ListSelector()) is accessible. - This allows users to use
RoworColumnunder the hood based on thedirectionproperty.
- Previously,
-
New
flexConfigurationproperty forListSelector:ListSelector.builderandListSelector.separateduselistConfiguration(ListView-based).ListSelector()now usesflexConfiguration, which supports Row/Column properties like:mainAxisAlignmentcrossAxisAlignmentmainAxisSizetextDirectionverticalDirectiontextBaselineclipBehaviorspacing
π Changed #
ListSelector.builderandListSelector.separatedstill work the same (usingListViewunder the hood).- The default behavior remains unchangedβdevelopers can now choose between
ListViewandRow/Columnbased on their needs.
π Migration Notes #
- No breaking changes.
- If you prefer to use Row/Column, you can now use the new generative constructor and pass a
flexConfiguration. - If you are already using
ListSelector.builderorListSelector.separated, no changes are required.
2.0.0 #
π Added #
- Introduced three new widgets:
ListSelectorβ ReplacesSingleListItemSelector&MultiListItemSelector.GridSelectorβ ReplacesSingleGridItemSelector&MultiGridItemSelector.WrapSelectorβ ReplacesSingleWrapItemSelector&MultiWrapItemSelector.
ListSelectornow provides two named constructors:ListSelector.builderβ Builds a list of selectable items.ListSelector.separatedβ Adds separators between list items.
GridSelectorintroduces three named constructors mirroring Flutter'sGridView:GridSelector.builderGridSelector.countGridSelector.extent
- All widgets now take a
SelectedOptionparameter, which accepts bothSingleSelectOptionsandMultiSelectOptions, offering a unified API. - Improved API consistency across all selectors, simplifying usability.
π Changed #
ListSelectoralways usesListViewunder the hood instead of switching betweenRow/ColumnandListView.GridSelectoruses a sealed class configuration (GridConfiguration), requiring the correct subtype (BuilderConfiguration,CountConfiguration, orExtentConfiguration) for each named constructor.- Codebase refactored for better readability and maintainability.
β οΈ Migration Guide #
This update includes breaking changes that require adjustments to your existing code.
- Replace old widgets with new ones:
SingleListItemSelectorβListSelector.builderorListSelector.separatedMultiListItemSelectorβListSelector.builderorListSelector.separatedSingleGridItemSelectorβGridSelector.builder,GridSelector.count, or *GridSelector.extent*MultiGridItemSelectorβGridSelector.builder,GridSelector.count, or *GridSelector.extent*SingleWrapItemSelectorβWrapSelectorMultiWrapItemSelectorβWrapSelector
- Use the new
SelectedOptionparameter instead of separate selection options. - Ensure GridSelector uses the correct
GridConfigurationsubtype for its named constructors. ListSelector.separatedrequires an additionalseparatorBuilderparameter.
1.1.0 #
Added #
listConfigurationproperty introduced inSingleListItemSelector&MultiListItemSelector.- This allows users to switch from
Row/ColumntoListView, providing greater flexibility and access toListViewfeatures such as scrolling behavior, physics, controllers, and more. - If
listConfigurationis not provided, the default behavior remains unchanged.
- This allows users to switch from
Changed #
- Refactored codebase for better readability and maintainability. No functional changes were made.
- Updated example files to reflect recent improvements and demonstrate new capabilities.
Migration Notes #
- No breaking changes. Upgrading to this version will not cause any compilation errors or issues.
1.0.1 #
Fixed #
- Corrected the image URL in the README to properly display on pub.dev.
This update does not change any functionality but ensures that documentation is correctly presented to users.
1.0.0 #
Added #
- Introduced
SingleWrapItemSelectorandMultiWrapItemSelectorwidgets, providing flexible item arrangement using theWraplayout.
Changed #
- Removed default padding applied to all widgets to give users more control over layout spacing.
- Removed
SingleChildScrollViewfromSingleListItemSelectorandMultiListItemSelectorto avoid unintended scrolling behavior.
Fixed #
- General improvements to layout consistency and flexibility.
0.2.0 #
Changed #
- Refactored
SingleGridItemSelector&MultiGridItemSelector- Properties related to
GridView(such asgridDelegate,controller,physics, etc.) have been removed fromSingleGridItemSelectorandMultiGridItemSelectorand moved into a new class:GridConfiguration. - Both widgets now accept a
GridConfigurationinstance instead of multiple individual GridView-related properties.
- Properties related to
Added #
- New
GridConfigurationclass- Encapsulates all
GridViewconfiguration properties, makingSingleGridItemSelectorandMultiGridItemSelectorcleaner and more modular. - Simplifies the API by grouping all grid-related options into a single parameter.
- Encapsulates all
Migration Guide #
-
Instead of passing
gridDelegate,controller,physics, etc., directly toSingleGridItemSelectororMultiGridItemSelector, create aGridConfigurationinstance and pass it as a parameter.Before:
SingleGridItemSelector<int>( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2), padding: EdgeInsets.all(8), controller: ScrollController(), ... ) MultiGridItemSelector<int>( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3), padding: EdgeInsets.symmetric(horizontal: 16), controller: ScrollController(), ... )After:
SingleGridItemSelector<int>( gridConfiguration: GridConfiguration( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2), padding: EdgeInsets.all(8), controller: ScrollController(), ... ) ) MultiGridItemSelector<int>( gridConfiguration: GridConfiguration( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3), padding: EdgeInsets.symmetric(horizontal: 16), controller: ScrollController(), ... ) )
0.1.2 #
- Add examples
0.1.1 #
- Updated
README.mdfor better clarity.
0.0.1 #
- release initial version