KonectarApp/lib/contacts_module/model_class/education_model.dart

52 lines
1.2 KiB
Dart
Raw Permalink Normal View History

2024-10-08 12:01:59 +00:00
// To parse this JSON data, do
//
// final edu = eduFromJson(jsonString);
import 'dart:convert';
List<Edu> eduFromJson(String str) =>
List<Edu>.from(json.decode(str).map((x) => Edu.fromJson(x)));
String eduToJson(List<Edu> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Edu {
int id;
int userId;
String educationType;
String institutionName;
String degree;
String specialty;
int timeFrame;
Edu({
required this.id,
required this.userId,
required this.educationType,
required this.institutionName,
required this.degree,
required this.specialty,
required this.timeFrame,
});
factory Edu.fromJson(Map<String, dynamic> json) => Edu(
id: json["id"],
userId: json["user_id"],
educationType: json["Education Type"],
institutionName: json["Institution Name"],
degree: json["Degree"],
specialty: json["Specialty"],
timeFrame: json["Time Frame"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"Education Type": educationType,
"Institution Name": institutionName,
"Degree": degree,
"Specialty": specialty,
"Time Frame": timeFrame,
};
}