property 1.0.0
property: ^1.0.0 copied to clipboard
An observable value holder for Flutter. Update widgets without setState - as a ValueListenable, through a builder, or as a stream.
1.0.0 #
Breaking #
Propertyis now aChangeNotifierimplementingValueListenable<T>, and must be disposed. It previously created aStreamControllerin its constructor and offered no way to close it, so every property leaked one.PropertyBuilder's builder signature is(BuildContext context, T value, Widget? child). The value is no longer nullable - it never actually was - and the extrachildparameter allows a subtree to be excluded from rebuilds.PropertyBuilderno longer extendsStreamBuilder, and no longer asserts on a stream error.
Added #
update(transform),forceValue(value)for values mutated in place,map(transform)for a read-only derived property, andisDisposed.MultiPropertyBuilder, rebuilding when any of several listenables changes.- An optional
childonPropertyBuilder. - Works with
ValueListenableBuilder,ListenableBuilderandAnimatedBuilderout of the box.
Fixed #
- Every stream listener now receives the current value. The value was pushed
from the broadcast controller's
onListen, which fires only when the first listener arrives, so a second listener stayed empty until the next change. - The stream controller is created lazily and closed on dispose.
Other #
- Requires Dart 3.8 / Flutter 3.32;
flutter_lints6. - 18 tests, plus 3 in the example. There were two before.
0.0.3 #
- Small fixes
0.0.2 #
- Doc update
0.0.1 #
- Initial release.