byList<T> method

List<T>? byList<T>(
  1. String key,
  2. T onDeserialize(
    1. dynamic rawValue
    ), {
  3. List<T>? defaultValue,
})

Implementation

List<T>? byList<T>(String key, T Function(dynamic rawValue) onDeserialize, {List<T>? defaultValue}) {
  if (this[key] == null) return defaultValue;
  if (this[key] is! List) return defaultValue;
  return (this[key] as List).map((e) => onDeserialize.call(e)).toList();
}