2024-09-02 13:39:56 +01:00
|
|
|
import 'package:latlong2/latlong.dart';
|
|
|
|
|
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-27 11:16:07 +01:00
|
|
|
|
|
|
|
factory Favorite.fromJson(Map<String, dynamic> json) {
|
|
|
|
return Favorite(
|
|
|
|
json['id'],
|
|
|
|
json['user_id'],
|
|
|
|
json['lat'],
|
|
|
|
json['lng'],
|
|
|
|
json['name'],
|
|
|
|
json['description'],
|
|
|
|
);
|
|
|
|
}
|
2024-08-22 12:28:24 +01:00
|
|
|
}
|
|
|
|
|
2024-09-03 12:33:50 +01:00
|
|
|
class Review {
|
|
|
|
int id;
|
|
|
|
String userId;
|
|
|
|
double lat;
|
|
|
|
double lng;
|
|
|
|
String place_name;
|
|
|
|
String place_description;
|
|
|
|
String title;
|
2024-09-04 10:53:32 +01:00
|
|
|
String content;
|
2024-09-03 12:33:50 +01:00
|
|
|
int rating;
|
|
|
|
|
2024-09-04 10:53:32 +01:00
|
|
|
Review(this.id, this.userId, this.lat, this.lng, this.place_name, this.place_description, this.title, this.content, this.rating);
|
2024-09-03 12:33:50 +01:00
|
|
|
|
|
|
|
factory Review.fromJson(Map<String, dynamic> json) {
|
|
|
|
return Review(
|
|
|
|
json['id'],
|
|
|
|
json['user_id'],
|
|
|
|
json['lat'],
|
|
|
|
json['lng'],
|
|
|
|
json['place_name'],
|
|
|
|
json['place_description'],
|
|
|
|
json['title'],
|
2024-09-04 10:53:32 +01:00
|
|
|
json['content'],
|
|
|
|
json['rating'],
|
2024-09-03 12:33:50 +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-09-02 10:39:03 +01:00
|
|
|
String refreshToken;
|
2024-08-23 14:19:15 +01:00
|
|
|
|
2024-09-02 10:39:03 +01:00
|
|
|
Login(this.token, this.id, this.refreshToken);
|
2024-08-23 14:19:15 +01:00
|
|
|
|
|
|
|
factory Login.fromJson(Map<String, dynamic> json) {
|
|
|
|
return Login(
|
|
|
|
json['token'],
|
|
|
|
json['id'],
|
2024-09-02 10:39:03 +01:00
|
|
|
json['refreshToken'],
|
2024-08-23 14:19:15 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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']),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2024-09-02 13:39:56 +01:00
|
|
|
|
|
|
|
class SearchResults{
|
|
|
|
LatLng location;
|
|
|
|
String name;
|
|
|
|
String description;
|
|
|
|
|
|
|
|
SearchResults(this.location, this.name, this.description);
|
|
|
|
}
|