asListOrNullFromJson<T> function

List<T>? asListOrNullFromJson<T>(
  1. Map<String, dynamic>? json,
  2. String key, {
  3. required T fromJson(
    1. dynamic json
    ),
})

Convert any map value with key to List

Implementation

List<T>? asListOrNullFromJson<T>(Map<String, dynamic>? json, String key,
    {required T Function(dynamic json) fromJson}) {
  return asListOrNull(
    json,
    key,
  )?.map((e) => fromJson(e)).toList();
}