applyTo method

  1. @override
void applyTo(
  1. DiagramDocumentBatch batch
)

Implementation

@override
void applyTo(DiagramDocumentBatch batch) {
  final ids = <String>{};
  for (final element in elements) {
    if (!ids.add(element.id) || batch.contains(element.id)) {
      throw StateError('Element ${element.id} already exists.');
    }
  }
  elements.forEach(batch.insert);
}