collection_notifiers 2.2.0
collection_notifiers: ^2.2.0 copied to clipboard
Reactive collection wrappers (List, Map, Set, Queue) with ChangeNotifier and ValueListenable support for efficient Flutter UI rebuilds.
Changelog #
2.2.0 #
- feat: ship dedicated
flutter_hookshooks for every notifier —useListNotifier,useSetNotifier,useMapNotifier,useQueueNotifier. Each owns the lifecycle: creates on first build, disposes on unmount, rebuilds the host widget on every mutation. - feat:
flutter_hooksis now a runtime dependency. - docs: agent skill at
skills/flutter-collection-notifiers/SKILL.mdreplaces the oldrules/collection_notifiers.md. - docs: stronger "hooks recommended" framing in the library dartdoc;
method-level notes on
ListNotifier.sort/shuffle(always notify whenlength > 1) andMapNotifier.addEntries(length-only check). - docs: shallow-copy semantics called out on every notifier constructor.
- example: each tab now shows a hooks panel (
useXNotifier, self-contained) alongside the externally-ownedValueListenableBuilderpanel. - test: widget tests for all four hooks covering single-instance reuse,
dispose-on-unmount, rebuild-on-mutation, and one-time
initialsemantics.
2.1.0 #
- feat:
ListNotifiernow notifies listeners for thelength=,first=, andlast=setters. Previously these inherited fromDelegatingListand mutated silently. If you depend on silence here, audit call sites.
2.0.2 #
- fix:
ListNotifier.fillRangenow runsRangeError.checkValidRangebefore thefillValuecast and short-circuits on empty ranges, so an empty no-op call no longer crashes whenfillValueis omitted. - fix:
MapNotifier.addAllno longer skips notification when a new key is added with anullvalue (false-negative onsuper[key] != valuefor absent keys with null defaults). - fix:
ListNotifier.operator []=andMapNotifier.operator []=no longer write the same value back when the value is unchanged. - fix:
MapNotifier.putIfAbsentreturns the value from the underlyingputIfAbsentcall instead of re-reading viasuper[key]!. - test: expanded coverage with dispose semantics,
removeListener, re-entrant listener mutation, null-element handling, andValueListenableBuilderrebuild integration. - chore: added
issue_trackertopubspec.yaml.
2.0.1 #
- docs: Promoted
flutter_hooksas the recommended pattern. - docs: Fixed version migration documentation and cleaned up README.
2.0.0 #
- Breaking:
SetNotifier.invert()now returnstruewhen added,falsewhen removed. - fix:
QueueNotifier.add()not triggering notifications. - fix:
ListNotifiernotification logic forreplaceRange()andsetRange(). - docs: Enhanced example app and test suite.
- chore: Dart 3 upgrade and lint updates.
1.1.0 #
- Dart 3 upgrade
- Removed dependency constraints
- Updated lints with code reformat
1.0.5 #
MapNotifier.addAlllength-based comparison fixMapNotifier,ListNotifieroperators improvements- Support for wider range of dependencies
1.0.4 #
SetNotifier.invert(element)method added
1.0.3 #
- improved docs
- version bumps
- simplified example
1.0.2 #
lengthbasedMapNotifier.addAll/addEntries()check- test improvements
1.0.1 #
- Better null value handling in
MapNotifier - Diff calculation in
SetNotifier's batch operations nowlengthbased
1.0.0+1 #
- Doc and CI improvements
1.0.0 #
- Initial Release with
Set,Map,ListandQueuesupport