validateNotEmpty function
Utility functions for validating input data for encoders. Throws an ArgumentError if the list is empty.
Implementation
/// Throws an [ArgumentError] if the list is empty.
void validateNotEmpty(List<dynamic> list, {String message = 'Input list cannot be empty.'}) {
if (list.isEmpty) {
throw ArgumentError(message);
}
}