forEachComponentAsync method

Future<void> forEachComponentAsync(
  1. Future<void> action(
    1. C component
    )
)

Implementation

Future<void> forEachComponentAsync(Future<void> Function(C component) action) async {
  var length = this.length;
  for (var i = 0; i < length; i++) {
    await action(_modelToComponent[i]);
    if (length != this.length) {
      throw ConcurrentModificationError(this);
    }
  }
}