ShapeLibrary constructor

ShapeLibrary({
  1. required String id,
  2. required String name,
  3. required Iterable<ShapeDefinition> shapes,
})

Implementation

ShapeLibrary({
  required this.id,
  required this.name,
  required Iterable<ShapeDefinition> shapes,
}) : shapes = List.unmodifiable(shapes) {
  if (id.trim().isEmpty || name.trim().isEmpty) {
    throw ArgumentError('Library id and name must not be empty');
  }
  _validatedDefinitions(this.shapes);
}