live_cells_core 0.18.2
live_cells_core: ^0.18.2 copied to clipboard
Provides the core of live cells: A replacement for ChangeNotifier and ValueNotifier that is easier to use and more flexible
0.18.2 #
- Add
.withDefault()and.onTriggermethods for handlingEmptyMetaCellError.
0.18.1 #
- Add
keyargument toActionCellconstructor.
0.18.0 #
New features:
-
Meta Cells
A meta cell (
MetaCell) is a cell that points to another cell. The value of a meta cell is the value of the pointed to cell, and its observers are notified when the pointed to cell's value changes.The pointed to cell can be changed multiple times.
Example:
final a = MutableCell(0); final b = MutableCell(1); final meta = MetaCell<int>(); meta.setCell(a); print(meta.value); // 0 meta.setCell(b); print(meta.value); // 1 -
The
.hold()method for keeping a cell active until it is released with.release()final a = MutableCell(0, key: aKey); // Ensure that a is active final hold = a.hold(); ... // Allow a to be disposed hold.release();
Breaking Changes:
-
Removed
dispose()method fromMutableCellinterface. -
Reading/writing the value of a keyed
MutableCellwhile it is inactive now throws anInactivePersistentStatefulCellError.Use
.hold()to ensure a keyedMutableCellis active before using it.
0.17.0 #
New features:
- Functionality for automatically generating cell keys, using
AutoKey. - Mutable cells can now have keys.
0.16.1 #
- Add exception handling in initial call to cell watch functions.
- Improve unhandled exception notices.
0.16.0 #
New features:
-
and(),or()andnot()now return keyed cells. -
The following methods for waiting for changes in cell values:
.nextChange().untilValue().untilTrue().untilFalse()
-
ActionCellA cell without a value, used solely to represent actions and events.
0.15.1 #
- Fix issue with
.isCompletedhaving incorrect value whenFuturecompletes with an error.
0.15.0 #
New features:
-
.awaitedproperty on cells holding aFuture.Returns a cell which evaluates to the value of the
Futurewhen completed, throws anUninitializedCellErrorwhen it is pending. -
.isCompletedproperty on cells holding aFuture.Returns a cell which evaluates to
truewhen theFutureis complete,falsewhile it is pending. -
.initialValue(...)which returns a cell with takes on the value of the given cell until it is initialized.
0.14.1 #
Minor additions:
.waitLastproperty which is the same as.waitbut if a new Future is recevied before the previous one has resolved, the previous value update is dropped.
0.14.0 #
New features for asynchronous cells:
.waitproperty for creating a cell thatawaits aFutureheld in another cell..delayedfor creating a cell that takes the value of another cell but only notifies its observers after a given delay.
Breaking changes:
- Removed
DelayCell.
0.13.0 #
.cellextension property is now available on all types- Additions to
Iterablecell extension:cast<E>()methodmap()method
- Additions to
Listcell extension:cast<E>()methodmapCells()method
0.12.3 #
- Fix potential issues when the computed value of a mutable computed cell is the same as its assigned value.
0.12.2 #
- Fix issue with recomputing the value of mutable computed cells.
0.12.1 #
- Reduce minimum version of
metadependency
0.12.0 #
New features:
-
Record extension methods for creating lightweight computed (and mutable computed) cells:
(a, b).apply((a,b) => a + b); (a, b).mutableApply((a,b) => a + b, (v) {...}); -
changesOnlyoption in cell constructors. When this option is set to true, the cell only notifies its observers when its value has actually changed. -
Relaxed restriction that
MutableCellViewonly accept a single argument -
Extensions which allow Iterable, List, Map and Set methods and properties to be used directly on cells:
ValueCell<List<int>> listCell; ValueCell<int> index; ... final elementI = listCell[index]; final length = listCell.length;
Breaking changes:
CellObserver.updatenow takes a seconddidChangeparameter. This only affects code that uses theCellObserverinterface directly.DependentCell,ComputeCellandMutableCellViewnow take an argumentSetas opposed to anargumentList. This only affects code which instantiates these classes directly.- Remove
CellListenableExtension. This will be moved to thelive_cell_widgetspackage.
Other changes:
- Removed dependency on Flutter. This package can now be used in pure Dart applications.
- Deprecated
ListComputeExtension, i.e.[a, b].computeCell(...). Use the record compute extensions instead.
0.11.0 #
- Core live cell definitions extracted from
live_cellspackage to this package.