KonectarApp/lib/model/affiliationsmodel.dart

71 lines
1.9 KiB
Dart

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