KonectarEvents/lib/contacts_module/model_class/affiliations.dart

64 lines
1.6 KiB
Dart
Raw Permalink Normal View History

2024-10-08 12:01:59 +00:00
// To parse this JSON data, do
//
// final affiliations = affiliationsFromJson(jsonString);
import 'dart:convert';
List<Affiliations> affiliationsFromJson(String str) => List<Affiliations>.from(
json.decode(str).map((x) => Affiliations.fromJson(x)));
String affiliationsToJson(List<Affiliations> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Affiliations {
int id;
int userId;
String orgName;
String dept;
String role;
String timeFrame;
String orgType;
String emgType;
dynamic createdAt;
dynamic updatedAt;
Affiliations({
required this.id,
required this.userId,
required this.orgName,
required this.dept,
required this.role,
required this.timeFrame,
required this.orgType,
required this.emgType,
required this.createdAt,
required this.updatedAt,
});
factory Affiliations.fromJson(Map<String, dynamic> json) => Affiliations(
id: json["id"],
userId: json["user_id"],
orgName: json["org_name"],
dept: json["dept"],
role: json["role"],
timeFrame: json["time_frame"],
orgType: json["org_type"],
emgType: json["emg_type"],
createdAt: json["created_at"],
updatedAt: json["updated_at"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"org_name": orgName,
"dept": dept,
"role": role,
"time_frame": timeFrame,
"org_type": orgType,
"emg_type": emgType,
"created_at": createdAt,
"updated_at": updatedAt,
};
}