capabilitiesFromJson static method

Map<String, List<String>> capabilitiesFromJson(
  1. dynamic json, {
  2. bool growable = false,
})

Implementation

static Map<String, List<String>> capabilitiesFromJson(
    dynamic json, {
      bool growable = false,
    }) {
  final map = <String, List<String>>{};
  if (json is Map && json.isNotEmpty) {
    // ignore: parameter_assignments
    json = json.cast<String, dynamic>();
    for (final entry in json.entries) {
      map[entry.key] = entry.value.cast<String>();
    }
  }
  return growable ? map : Map.unmodifiable(map);
}