add method
Updates the current value of the StateBloc
to the provided value.
Implementation
@override
// ignore: avoid_renaming_method_parameters
void add(snap) {
// Optimistic snapshots link their previous and next snapshots in order to support
// rollback of optimistic updates.
if (snap?.isOptimistic ?? false) {
final currentSnap = value;
if (currentSnap?.isOptimistic ?? false) {
currentSnap!.next = snap;
}
snap!.prev = value;
}
super.add(snap);
}