// 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, Affiliations.fromJson(v))))), ); Map toJson() => { "data": List.from(data.map((x) => Map.from(x) .map((k, v) => MapEntry(k, v.toJson())))), }; } class AffiliationsResp { Affiliations data; AffiliationsResp({ required this.data, }); factory AffiliationsResp.fromJson(Map json) => AffiliationsResp( data: Affiliations.fromJson(json["data"]), ); Map toJson() => { "data": data.toJson(), }; } class Affiliations { List affiliationNames; List affiliationCount; Affiliations({ required this.affiliationNames, required this.affiliationCount, }); factory Affiliations.fromJson(Map json) => Affiliations( 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)), }; }