ValidateValueAsArray method
void
ValidateValueAsArray(
- Object? value
)
Validates array value.
The value.
Implementation
void ValidateValueAsArray(Object? value) {
if (value == null) {
throw ArgumentNullException("value");
}
if (value is! List || value is Uint8List && Type != Uint8List) {
throw ArgumentException(
"Type ${value.runtimeType} can't be used as an array of type $Type.",
);
} else if (value.isEmpty) {
throw ArgumentException(
"The Array value must have at least one element.",
);
} else if (!value.every(IsOfType)) {
throw ArgumentException(
"Type ${value.runtimeType} can't be used as an array of type $Type.",
);
}
}