decodeListAs<T> static method
Decodes a JSON string to a list of values of type T.
Implementation
static List<T> decodeListAs<T>(
String json, {
required T Function(Map<String, dynamic>) fromMap,
}) {
return (jsonDecode(json) as List<dynamic>)
.map((e) => fromMap(e as Map<String, dynamic>))
.toList();
}