// To parse this JSON data, do // // final affiliationsData = affiliationsDataFromJson(jsonString); import 'dart:convert'; AffiliationsData affiliationsDataFromJson(String str) => AffiliationsData.fromJson(json.decode(str)); String affiliationsDataToJson(AffiliationsData data) => json.encode(data.toJson()); class AffiliationsData { List> data; AffiliationsData({ required this.data, }); factory AffiliationsData.fromJson(Map json) => AffiliationsData( data: List>.from(json["data"].map((x) => Map.from(x) .map((k, v) => MapEntry(k, Datum.fromJson(v))))), ); Map toJson() => { "data": List.from(data.map((x) => Map.from(x) .map((k, v) => MapEntry(k, v.toJson())))), }; } class Datum { List affiliationNames; List affiliationCount; Datum({ required this.affiliationNames, required this.affiliationCount, }); factory Datum.fromJson(Map json) => Datum( affiliationNames: List.from(json["affiliationNames"].map((x) => x)), affiliationCount: List.from(json["affiliationCount"].map((x) => x)), ); Map toJson() => { "affiliationNames": List.from(affiliationNames.map((x) => x)), "affiliationCount": List.from(affiliationCount.map((x) => x)), }; }