asList function

List asList(
  1. Map<String, dynamic>? json,
  2. String key, {
  3. List? defaultValue,
})

Implementation

List asList(Map<String, dynamic>? json, String key, {List? defaultValue}) {
  if (json == null || !json.containsKey(key)) return defaultValue ?? [];
  return toList(json[key]);
}