2024-09-06 14:13:30 +01:00
|
|
|
import 'dart:io';
|
|
|
|
|
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-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;
|
2024-09-06 14:13:30 +01:00
|
|
|
String username;
|
|
|
|
File? profilePicture;
|
2024-08-23 11:34:38 +01:00
|
|
|
DateTime createdAt;
|
|
|
|
|
2024-09-06 14:13:30 +01:00
|
|
|
User( this.id, this.email, this.username, this.profilePicture, 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'],
|
2024-09-06 14:13:30 +01:00
|
|
|
json['profilePicture'],
|
2024-08-23 11:34:38 +01:00
|
|
|
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);
|
|
|
|
}
|