ArrowStructType constructor

ArrowStructType(
  1. List<ArrowField> fields, {
  2. bool allowDuplicateNames = false,
})

Creates a struct. Duplicate child names are rejected unless allowDuplicateNames is true; Arrow itself permits them, so decoders of standard data (JSON, IPC) pass true. The flag is not serialized.

Implementation

ArrowStructType(List<ArrowField> fields, {bool allowDuplicateNames = false})
  : fields = List.unmodifiable(fields) {
  if (allowDuplicateNames) return;
  final names = <String>{};
  for (final field in fields) {
    if (!names.add(field.name)) {
      throw ArgumentError('Duplicate struct field: ${field.name}');
    }
  }
}