mobdr/lib/db/box_log.dart

26 lines
553 B
Dart

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 Log {
// specify the id
@Id()
int id = 0;
String type;
DateTime date;
String module;
String libelle;
int duree;
int uploaded;
Log(this.type, this.module, this.libelle, this.duree,
{this.id = 0, DateTime? date, this.uploaded = 0})
: date = date ?? DateTime.now();
String get dateFormat => DateFormat('dd.MM.yyyy hh:mm:ss').format(date);
}