items_selector 2.3.1
items_selector: ^2.3.1 copied to clipboard
A Flutter package providing flexible item selection widgets with support for multiple layouts including list, grid, wrap, radio button, and checkbox list selectors, allowing you to choose the perfect [...]
[2.3.1] #
📝 Documentation #
- Fixed broken image links in
README.md
by replacing GitHub URLs with raw image links. - Ensured all widgets’ demo GIFs render correctly on pub.dev.
[2.3.0] #
✨ New Features #
-
RadioSelector
added! 🔘- A widget for single-selection radio button lists, using
RadioListTile
under the hood. - Supports a list of
RadioSelectorItem
objects, which extendRadioListTile
for individual customization. - Includes a
RadioSelectorOption
for global styling and layout properties likespacing
andmainAxisAlignment
. - Features an
initialItem
property for setting a default selection and a callback (OnSelectedRadioChanged
) for handling selection changes.
- A widget for single-selection radio button lists, using
-
CheckBoxSelector
added! ✅- A widget for multi-selection checkbox lists, using
CheckboxListTile
under the hood. - Accepts a list of
CheckBoxSelectorItem
objects, which extendCheckboxListTile
for individual customization. - Provides a
CheckBoxSelectorOption
for global styling and layout properties likespacing
andcrossAxisAlignment
. - Supports an
initialItems
property for pre-selecting multiple items and a callback (OnSelectedCheckboxChanged
) for tracking selected items and their indices.
- A widget for multi-selection checkbox lists, using
📌 Notes #
- No breaking changes.
- These new widgets expand the library’s selection capabilities, complementing existing widgets like
ListSelector
andGridSelector
. - Safe to upgrade from
2.2.0
without modifications to existing code.
[2.2.0] #
✨ New Features #
ListSelector.wheel
added! 🎡- Uses
ListWheelScrollView
under the hood. - Introduces
WheelConfiguration
, allowing customization of properties such asitemExtent
,squeeze
,perspective
, and more. - Unlike other
ListSelector
constructors, it does not accept adirection
property sinceListWheelScrollView
does not have one.
- Uses
[2.1.1] #
🛠 Fixed #
- Resolved an unused element warning in
GridSelector
:- Fixed the warning: "The declaration 'GridSelector._' isn't referenced."
- Removed the unused private constructor declaration.
- No functionality was affected—this was purely an internal cleanup.
📌 Notes #
- No breaking changes.
- This update improves code cleanliness but does not impact functionality.
- Safe to upgrade from
2.1.0
without modifications.
[2.1.0] #
🚀 Added #
-
Generative constructor for
ListSelector
:- Previously,
ListSelector
could only be used viaListSelector.builder
andListSelector.separated
. - Now, the main constructor (
ListSelector()
) is accessible. - This allows users to use
Row
orColumn
under the hood based on thedirection
property.
- Previously,
-
New
flexConfiguration
property forListSelector
:ListSelector.builder
andListSelector.separated
uselistConfiguration
(ListView-based).ListSelector()
now usesflexConfiguration
, which supports Row/Column properties like:mainAxisAlignment
crossAxisAlignment
mainAxisSize
textDirection
verticalDirection
textBaseline
clipBehavior
spacing
🔄 Changed #
ListSelector.builder
andListSelector.separated
still work the same (usingListView
under the hood).- The default behavior remains unchanged—developers can now choose between
ListView
andRow/Column
based 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.builder
orListSelector.separated
, no changes are required.
[2.0.0] #
🚀 Added #
- Introduced three new widgets:
ListSelector
→ ReplacesSingleListItemSelector
&MultiListItemSelector
.GridSelector
→ ReplacesSingleGridItemSelector
&MultiGridItemSelector
.WrapSelector
→ ReplacesSingleWrapItemSelector
&MultiWrapItemSelector
.
ListSelector
now provides two named constructors:ListSelector.builder
→ Builds a list of selectable items.ListSelector.separated
→ Adds separators between list items.
GridSelector
introduces three named constructors mirroring Flutter'sGridView
:GridSelector.builder
GridSelector.count
GridSelector.extent
- All widgets now take a
SelectedOption
parameter, which accepts bothSingleSelectOptions
andMultiSelectOptions
, offering a unified API. - Improved API consistency across all selectors, simplifying usability.
🔄 Changed #
ListSelector
always usesListView
under the hood instead of switching betweenRow/Column
andListView
.GridSelector
uses 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.builder
orListSelector.separated
MultiListItemSelector
→ListSelector.builder
orListSelector.separated
SingleGridItemSelector
→GridSelector.builder
,GridSelector.count
, or *GridSelector.extent
*MultiGridItemSelector
→GridSelector.builder
,GridSelector.count
, or *GridSelector.extent
*SingleWrapItemSelector
→WrapSelector
MultiWrapItemSelector
→WrapSelector
- Use the new
SelectedOption
parameter instead of separate selection options. - Ensure GridSelector uses the correct
GridConfiguration
subtype for its named constructors. ListSelector.separated
requires an additionalseparatorBuilder
parameter.
[1.1.0] #
Added #
listConfiguration
property introduced inSingleListItemSelector
&MultiListItemSelector
.- This allows users to switch from
Row
/Column
toListView
, providing greater flexibility and access toListView
features such as scrolling behavior, physics, controllers, and more. - If
listConfiguration
is 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
SingleWrapItemSelector
andMultiWrapItemSelector
widgets, providing flexible item arrangement using theWrap
layout.
Changed #
- Removed default padding applied to all widgets to give users more control over layout spacing.
- Removed
SingleChildScrollView
fromSingleListItemSelector
andMultiListItemSelector
to 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 fromSingleGridItemSelector
andMultiGridItemSelector
and moved into a new class:GridConfiguration
. - Both widgets now accept a
GridConfiguration
instance instead of multiple individual GridView-related properties.
- Properties related to
Added #
- New
GridConfiguration
class- Encapsulates all
GridView
configuration properties, makingSingleGridItemSelector
andMultiGridItemSelector
cleaner 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 toSingleGridItemSelector
orMultiGridItemSelector
, create aGridConfiguration
instance 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.md
for better clarity.
[0.0.1] #
- release initial version