The value must be a List.
String? isList(String field, Object? value) => value != null && value is! List ? '$field must be a list' : null;