CompositeStateSnapshotParticipant constructor

CompositeStateSnapshotParticipant({
  1. required String path,
  2. required String schemaKind,
  3. required int schemaVersion,
  4. required Iterable<StateSnapshotParticipant> children,
  5. String configurationIdentity = '',
  6. List<String> dependencies = const [],
})

Creates a composite participant from non-empty child regions.

Implementation

CompositeStateSnapshotParticipant({
  required this.path,
  required this.schemaKind,
  required this.schemaVersion,
  required Iterable<StateSnapshotParticipant> children,
  this.configurationIdentity = '',
  this.dependencies = const [],
}) : children = List.unmodifiable(children) {
  if (this.children.isEmpty) {
    throw ArgumentError.value(children, 'children', 'Must not be empty.');
  }
  final paths = <String>{};
  for (final child in this.children) {
    if (!paths.add(child.path)) {
      throw ArgumentError('Duplicate composite child path ${child.path}.');
    }
  }
}