skantravels/Mobile/lib/models.dart
Sandertp eaf0a64d72
More favorite changes
Co-authored-by: Reimar<mail@git.reim.ar>
2024-08-26 20:55:53 +02:00

43 lines
729 B
Dart

class Favorite {
int id;
String userId;
double lat;
double lng;
String name;
String description;
Favorite(this.id, this.userId, this.lat, this.lng, this.name, this.description);
}
class Login {
String token;
String id;
Login(this.token, this.id);
factory Login.fromJson(Map<String, dynamic> json) {
return Login(
json['token'],
json['id'],
);
}
}
class User {
String id;
String email;
String username;
DateTime createdAt;
User( this.id, this.email, this.username, this.createdAt);
factory User.fromJson(Map<String, dynamic> json) {
return User(
json['id'],
json['email'],
json['username'],
DateTime.parse(json['createdAt']),
);
}
}