Insert, update or remove operation for push. Multiple operations run sequentially without a transaction.
TxPush.insert
| Parameter | Type | Default | Meaning |
|---|---|---|---|
| data | T | required | Records or event payload. |
TxPush.update
| Parameter | Type | Default | Meaning |
|---|---|---|---|
| key | Object | required | Stable key or selector; distinct from a widget key. |
| change | T Function(T) | required | Transformation of the existing record. |
TxPush.remove
| Parameter | Type | Default | Meaning |
|---|---|---|---|
| key | Object | required | Stable key or selector; distinct from a widget key. |
| Member / type / return | Meaning |
|---|---|
final String type | Appearance/input type; see the signature for allowed values. |
import 'package:tecexpress/tecexpress.dart';
Future<void> example() async {
final source = TxDataSource.array([1], keyOf: (v) => v);
await source.push([const TxPush.insert(2), const TxPush.remove(1)]);
source.dispose();
}