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 photo; 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_photo, this.id_visite, this.id_photo_typologie, this.photo, this.id_photo_mp4, this.photo_privee, this.photo_principale, this.photo_tag1, this.photo_tag2, this.photo_tag3, this.photo_tag4, {this.id = 0, 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); }