2024-08-22 09:20:59 +01:00
|
|
|
class Favorite {
|
|
|
|
int id;
|
|
|
|
String userId;
|
|
|
|
double lat;
|
|
|
|
double lng;
|
2024-08-26 11:09:47 +01:00
|
|
|
String name;
|
|
|
|
String description;
|
2024-08-22 09:20:59 +01:00
|
|
|
|
2024-08-26 11:09:47 +01:00
|
|
|
Favorite(this.id, this.userId, this.lat, this.lng, this.name, this.description);
|
2024-08-22 12:28:24 +01:00
|
|
|
}
|
|
|
|
|
2024-08-23 14:19:15 +01:00
|
|
|
class Login {
|
2024-08-22 12:28:24 +01:00
|
|
|
String token;
|
2024-08-23 11:34:38 +01:00
|
|
|
String id;
|
2024-08-23 14:19:15 +01:00
|
|
|
|
|
|
|
Login(this.token, this.id);
|
|
|
|
|
|
|
|
factory Login.fromJson(Map<String, dynamic> json) {
|
|
|
|
return Login(
|
|
|
|
json['token'],
|
|
|
|
json['id'],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class User {
|
|
|
|
String id;
|
2024-08-23 11:34:38 +01:00
|
|
|
String email;
|
|
|
|
String username;
|
|
|
|
DateTime createdAt;
|
|
|
|
|
2024-08-23 14:19:15 +01:00
|
|
|
User( this.id, this.email, this.username, this.createdAt);
|
2024-08-23 11:34:38 +01:00
|
|
|
|
|
|
|
factory User.fromJson(Map<String, dynamic> json) {
|
|
|
|
return User(
|
|
|
|
json['id'],
|
|
|
|
json['email'],
|
|
|
|
json['username'],
|
|
|
|
DateTime.parse(json['createdAt']),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|