60 lines
1.4 KiB
Dart
60 lines
1.4 KiB
Dart
|
// To parse this JSON data, do
|
||
|
//
|
||
|
// final cer = cerFromJson(jsonString);
|
||
|
|
||
|
import 'dart:convert';
|
||
|
|
||
|
List<Cer> cerFromJson(String str) =>
|
||
|
List<Cer>.from(json.decode(str).map((x) => Cer.fromJson(x)));
|
||
|
|
||
|
String cerToJson(List<Cer> data) =>
|
||
|
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||
|
|
||
|
class Cer {
|
||
|
int id;
|
||
|
int userId;
|
||
|
String educationType;
|
||
|
String institutionName;
|
||
|
String degree;
|
||
|
String specialty;
|
||
|
int timeFrame;
|
||
|
String url1;
|
||
|
String url2;
|
||
|
|
||
|
Cer({
|
||
|
required this.id,
|
||
|
required this.userId,
|
||
|
required this.educationType,
|
||
|
required this.institutionName,
|
||
|
required this.degree,
|
||
|
required this.specialty,
|
||
|
required this.timeFrame,
|
||
|
required this.url1,
|
||
|
required this.url2,
|
||
|
});
|
||
|
|
||
|
factory Cer.fromJson(Map<String, dynamic> json) => Cer(
|
||
|
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"],
|
||
|
url1: json["Url1"],
|
||
|
url2: json["Url2"],
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> toJson() => {
|
||
|
"id": id,
|
||
|
"user_id": userId,
|
||
|
"Education Type": educationType,
|
||
|
"Institution Name": institutionName,
|
||
|
"Degree": degree,
|
||
|
"Specialty": specialty,
|
||
|
"Time Frame": timeFrame,
|
||
|
"Url1": url1,
|
||
|
"Url2": url2,
|
||
|
};
|
||
|
}
|