KonectarApp/lib/model/specialtymodel.dart

68 lines
1.8 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())),
};
}
class Specialty {
String specialtyCount;
String specialtyName;
Specialty({
required this.specialtyCount,
required 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,
};
}