AdifEnumeration constructor

AdifEnumeration(
  1. dynamic value,
  2. List<String> enumerations
)

Implementation

AdifEnumeration(value, this.enumerations) : super(value.toUpperCase()) {
  if (enumerations.any((e) => isNotPureAscii(e))) {
    throw ArgumentError('Value must not contain non-ASCII characters: $enumerations');
  }
  if (!enumerations.contains(value.toUpperCase())) {
    throw ArgumentError(
      'Value must be one of the enumerations: $enumerations',
    );
  }
}