import 'package:objectbox/objectbox.dart'; import 'package:mobdr/objectbox.g.dart'; import 'package:intl/intl.dart'; // ignore_for_file: public_member_api_docs @Entity() class Photo { // specify the id @Id() int id = 0; int id_photo; int id_visite; int id_photo_typologie; String image; DateTime date_photo; int id_photo_mp4; int photo_privee; int photo_principale; String photo_tag1; String photo_tag2; String photo_tag3; String photo_tag4; int uploaded; Photo( {this.id = 0, required this.id_visite, required this.id_photo_typologie, required this.image, this.id_photo = 0, this.id_photo_mp4 = 0, this.photo_privee = 0, this.photo_principale = 0, this.photo_tag1 = '', this.photo_tag2 = '', this.photo_tag3 = '', this.photo_tag4 = '', DateTime? date_photo, this.uploaded = 0}) : date_photo = date_photo ?? DateTime.now(); String get dateFormat => DateFormat('dd.MM.yyyy hh:mm:ss').format(date_photo); /* Photo.fromJson(Map json) : id_visite = json['id_visite'], id_photo_typologie = json['id_photo_typologie'], image = json['image']; */ }