create appointment object
This commit is contained in:
parent
cb7b584b63
commit
0f02ade8ff
1 changed files with 39 additions and 0 deletions
39
Frontend/lib/mih_objects/appointment.dart
Normal file
39
Frontend/lib/mih_objects/appointment.dart
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
class Appointment {
|
||||||
|
final int idappointments;
|
||||||
|
final String app_id;
|
||||||
|
final String business_id;
|
||||||
|
final String date_time;
|
||||||
|
final String title;
|
||||||
|
final String description;
|
||||||
|
|
||||||
|
const Appointment({
|
||||||
|
required this.idappointments,
|
||||||
|
required this.app_id,
|
||||||
|
required this.business_id,
|
||||||
|
required this.date_time,
|
||||||
|
required this.title,
|
||||||
|
required this.description,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory Appointment.fromJson(Map<String, dynamic> json) {
|
||||||
|
return switch (json) {
|
||||||
|
{
|
||||||
|
"idappointments": int idappointments,
|
||||||
|
'app_id': String app_id,
|
||||||
|
'business_id': String business_id,
|
||||||
|
'date_time': String date_time,
|
||||||
|
'title': String title,
|
||||||
|
'description': String description,
|
||||||
|
} =>
|
||||||
|
Appointment(
|
||||||
|
idappointments: idappointments,
|
||||||
|
app_id: app_id,
|
||||||
|
business_id: business_id,
|
||||||
|
date_time: date_time,
|
||||||
|
title: title,
|
||||||
|
description: description,
|
||||||
|
),
|
||||||
|
_ => throw const FormatException('Failed to load album.'),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue