KonectarApp/lib/model/affiliationsmodel.dart

71 lines
1.9 KiB
Dart
Raw Permalink Normal View History

2024-09-06 06:30:31 +00:00
// 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 {
2024-10-07 12:45:45 +00:00
List<Map<String, Affiliations>> data;
2024-09-06 06:30:31 +00:00
AffiliationsData({
required this.data,
});
factory AffiliationsData.fromJson(Map<String, dynamic> json) =>
AffiliationsData(
2024-10-07 12:45:45 +00:00
data: List<Map<String, Affiliations>>.from(json["data"].map((x) =>
Map.from(x).map((k, v) =>
MapEntry<String, Affiliations>(k, Affiliations.fromJson(v))))),
2024-09-06 06:30:31 +00:00
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data.map((x) => Map.from(x)
.map((k, v) => MapEntry<String, dynamic>(k, v.toJson())))),
};
}
2024-10-07 12:45:45 +00:00
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 {
2024-09-06 06:30:31 +00:00
List<String> affiliationNames;
List<String> affiliationCount;
2024-10-07 12:45:45 +00:00
Affiliations({
2024-09-06 06:30:31 +00:00
required this.affiliationNames,
required this.affiliationCount,
});
2024-10-07 12:45:45 +00:00
factory Affiliations.fromJson(Map<String, dynamic> json) => Affiliations(
2024-09-06 06:30:31 +00:00
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)),
};
}