import 'package:mobdr/main.dart'; class VisiteModel { late int id; late String name; late int photo; late String date; late String image; late String type_visite; late double price; late double rating; late int review; late int sale; late int stock; late String location; VisiteModel({ required this.id, required this.name, required this.photo, required this.date, required this.image, required this.type_visite, required this.price, required this.rating, required this.review, required this.sale, required this.stock, required this.location, }); static Future> getAllVisites() async { // Retrieve all visits from the database using the getAllVisites() method final visites = await objectbox.getAllVisites(); // Map each retrieved visit to VisiteModel final visiteModels = visites .map((visite) => VisiteModel( id: visite.id, name: visite.title, photo: 1, date: visite.date_visite.toString(), image: visite.url_photo_principale, type_visite: visite.type_visite, price: 0, rating: 0, review: 0, sale: 0, stock: 10, location: "")) .toList(); // Return the list of VisiteModel return visiteModels; } }