52 lines
1.3 KiB
Dart
52 lines
1.3 KiB
Dart
// To parse this JSON data, do
|
|
//
|
|
// final traning = traningFromJson(jsonString);
|
|
|
|
import 'dart:convert';
|
|
|
|
List<Traning> traningFromJson(String str) =>
|
|
List<Traning>.from(json.decode(str).map((x) => Traning.fromJson(x)));
|
|
|
|
String traningToJson(List<Traning> data) =>
|
|
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
|
|
|
class Traning {
|
|
int id;
|
|
int userId;
|
|
String educationType;
|
|
String institutionName;
|
|
String degree;
|
|
String specialty;
|
|
String timeFrame;
|
|
|
|
Traning({
|
|
required this.id,
|
|
required this.userId,
|
|
required this.educationType,
|
|
required this.institutionName,
|
|
required this.degree,
|
|
required this.specialty,
|
|
required this.timeFrame,
|
|
});
|
|
|
|
factory Traning.fromJson(Map<String, dynamic> json) => Traning(
|
|
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,
|
|
};
|
|
}
|