StructType constructor
- Iterable<
Field> fields
Creates a struct type from fields with unique names.
Throws an ArgumentError when field names repeat.
Implementation
StructType(Iterable<Field> fields) : fields = List.unmodifiable(fields) {
if (this.fields.map((field) => field.name).toSet().length !=
this.fields.length) {
throw ArgumentError.value(fields, 'fields', 'names must be unique');
}
}