mapListFromJson static method

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

Implementation

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