batch method

void batch(
  1. VoidCallback fn
)

Batch updates

Implementation

void batch(VoidCallback fn) {
  _isBatching = true;
  try {
    fn();
  } finally {
    _isBatching = false;
    for (final field in _batchedFields) {
      notifyListeners(field);
    }
    _batchedFields.clear();
  }
}