update method

void update(
  1. String id,
  2. void change(
    1. TextEntity entity
    )
)

Apply change to the entity with id and emit.

Implementation

void update(String id, void Function(TextEntity entity) change) {
  final entity = byId(id);
  if (entity == null) return;
  change(entity);
  notifyListeners();
}