KonectarApp/lib/model/specialtymodel.dart

80 lines
2.3 KiB
Dart

// To parse this JSON data, do
//
// final specialtyData = specialtyDataFromJson(jsonString);
import 'dart:convert';
SpecialtyData specialtyDataFromJson(String str) =>
SpecialtyData.fromJson(json.decode(str));
String specialtyDataToJson(SpecialtyData data) => json.encode(data.toJson());
class SpecialtyData {
List<Map<String, List<Specialty>>> data;
SpecialtyData({
required this.data,
});
factory SpecialtyData.fromJson(Map<String, dynamic> json) => SpecialtyData(
data: List<Map<String, List<Specialty>>>.from(json["data"].map((x) =>
Map.from(x).map((k, v) => MapEntry<String, List<Specialty>>(k,
List<Specialty>.from(v.map((x) => Specialty.fromJson(x))))))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data.map((x) => Map.from(x).map((k, v) =>
MapEntry<String, dynamic>(
k, List<dynamic>.from(v.map((x) => x.toJson())))))),
};
}
class Specialtyresp {
List<Specialty> data;
Specialtyresp({
required this.data,
});
factory Specialtyresp.fromJson(Map<String, dynamic> json) => Specialtyresp(
data: List<Specialty>.from(
json["data"].map((x) => Specialty.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"data": List<dynamic>.from(data.map((x) => x.toJson())),
};
}
// List<Specialty> specialtyFromJson(String str) =>
// List<Specialty>.from(json.decode(str).map((x) => Specialty.fromJson(x)));
// List<AllSessionNotesResponse>.from(json.decode(str).map((x) => AllSessionNotesResponse.fromJson(x)));
String specialtyToJson(List<Specialty> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
List<Specialty> specialtyFromJson(String str) {
final jsonData = json.decode(str);
return new List<Specialty>.from(jsonData.map((x) => Specialty.fromJson(x)));
}
class Specialty {
String? specialtyCount;
String? specialtyName;
Specialty({
this.specialtyCount,
this.specialtyName,
});
factory Specialty.fromJson(Map<String, dynamic> json) => Specialty(
specialtyCount: json["specialty_count"],
specialtyName: json["specialty_name"],
);
Map<String, dynamic> toJson() => {
"specialty_count": specialtyCount,
"specialty_name": specialtyName,
};
}