fix:remove notebox
parent
a42c0847b8
commit
fc93673bb6
|
|
@ -1,22 +0,0 @@
|
|||
import 'package:intl/intl.dart';
|
||||
import 'package:objectbox/objectbox.dart';
|
||||
|
||||
import 'objectbox.g.dart';
|
||||
|
||||
// ignore_for_file: public_member_api_docs
|
||||
|
||||
@Entity()
|
||||
class Note {
|
||||
int id;
|
||||
|
||||
String text;
|
||||
String? comment;
|
||||
|
||||
/// Note: Stored in milliseconds without time zone info.
|
||||
DateTime date;
|
||||
|
||||
Note(this.text, {this.id = 0, this.comment, DateTime? date})
|
||||
: date = date ?? DateTime.now();
|
||||
|
||||
String get dateFormat => DateFormat('dd.MM.yyyy hh:mm:ss').format(date);
|
||||
}
|
||||
|
|
@ -3,35 +3,6 @@
|
|||
"_note2": "ObjectBox manages crucial IDs for your object model. See docs for details.",
|
||||
"_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
|
||||
"entities": [
|
||||
{
|
||||
"id": "1:2802681814019499133",
|
||||
"lastPropertyId": "4:6451339597165131221",
|
||||
"name": "Note",
|
||||
"properties": [
|
||||
{
|
||||
"id": "1:3178873177797362769",
|
||||
"name": "id",
|
||||
"type": 6,
|
||||
"flags": 1
|
||||
},
|
||||
{
|
||||
"id": "2:4285343053028527696",
|
||||
"name": "text",
|
||||
"type": 9
|
||||
},
|
||||
{
|
||||
"id": "3:2606273611209948020",
|
||||
"name": "comment",
|
||||
"type": 9
|
||||
},
|
||||
{
|
||||
"id": "4:6451339597165131221",
|
||||
"name": "date",
|
||||
"type": 10
|
||||
}
|
||||
],
|
||||
"relations": []
|
||||
},
|
||||
{
|
||||
"id": "3:6664528022814238868",
|
||||
"lastPropertyId": "6:1514784951041121129",
|
||||
|
|
@ -412,7 +383,8 @@
|
|||
6788844671665652158,
|
||||
2910300629980903548,
|
||||
8290500625256822711,
|
||||
637444607663700174
|
||||
637444607663700174,
|
||||
2802681814019499133
|
||||
],
|
||||
"retiredIndexUids": [
|
||||
7907819717055295102
|
||||
|
|
@ -469,7 +441,11 @@
|
|||
1526411175344533047,
|
||||
1603887098520719919,
|
||||
427077651567855068,
|
||||
7039119413270734559
|
||||
7039119413270734559,
|
||||
3178873177797362769,
|
||||
4285343053028527696,
|
||||
2606273611209948020,
|
||||
6451339597165131221
|
||||
],
|
||||
"retiredRelationUids": [],
|
||||
"version": 1
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import 'package:mobdr/db/box_photo_typology.dart';
|
|||
|
||||
import 'package:mobdr/service/logger_util.dart';
|
||||
|
||||
import 'model.dart';
|
||||
import 'objectbox.g.dart'; // created by `flutter pub run build_runner build`
|
||||
|
||||
/// Provides access to the ObjectBox Store throughout the app.
|
||||
|
|
@ -19,9 +18,6 @@ class ObjectBox {
|
|||
/// The Store of this app.
|
||||
late final Store store;
|
||||
|
||||
/// A Box of notes.
|
||||
late final Box<Note> noteBox;
|
||||
|
||||
/// A Box of user
|
||||
late final Box<User> userBox;
|
||||
|
||||
|
|
@ -47,7 +43,6 @@ class ObjectBox {
|
|||
late final Box<Log> logBox;
|
||||
|
||||
ObjectBox._create(this.store) {
|
||||
noteBox = Box<Note>(store);
|
||||
userBox = Box<User>(store);
|
||||
etabBox = Box<Etab>(store);
|
||||
etabCompetitorBox = Box<EtabCompetitor>(store);
|
||||
|
|
@ -65,40 +60,6 @@ class ObjectBox {
|
|||
return ObjectBox._create(store);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: A SUPPRIMER + Box note
|
||||
*/
|
||||
Stream<List<Note>> getNotes() {
|
||||
// Query for all notes, sorted by their date.
|
||||
// https://docs.objectbox.io/queries
|
||||
final builder = noteBox.query().order(Note_.date, flags: Order.descending);
|
||||
// Build and watch the query,
|
||||
// set triggerImmediately to emit the query immediately on listen.
|
||||
return builder
|
||||
.watch(triggerImmediately: true)
|
||||
// Map it to a list of notes to be used by a StreamBuilder.
|
||||
.map((query) => query.find());
|
||||
}
|
||||
|
||||
/// Add a note within a transaction.
|
||||
///
|
||||
/// To avoid frame drops, run ObjectBox operations that take longer than a
|
||||
/// few milliseconds, e.g. putting many objects, in an isolate with its
|
||||
/// own Store instance.
|
||||
/// For this example only a single object is put which would also be fine if
|
||||
/// done here directly.
|
||||
Future<void> addNote(String text) =>
|
||||
store.runInTransactionAsync(TxMode.write, _addNoteInTx, text);
|
||||
|
||||
/// Note: due to [dart-lang/sdk#36983](https://github.com/dart-lang/sdk/issues/36983)
|
||||
/// not using a closure as it may capture more objects than expected.
|
||||
/// These might not be send-able to an isolate. See Store.runAsync for details.
|
||||
static void _addNoteInTx(Store store, String text) {
|
||||
// Perform ObjectBox operations that take longer than a few milliseconds
|
||||
// here. To keep it simple, this example just puts a single object.
|
||||
store.box<Note>().put(Note(text));
|
||||
}
|
||||
|
||||
/// USER ---------------------------------------------------------------------
|
||||
///
|
||||
|
||||
|
|
|
|||
|
|
@ -22,40 +22,10 @@ import 'db/box_user.dart';
|
|||
import 'db/box_visit.dart';
|
||||
import 'db/box_visit_photo.dart';
|
||||
import 'db/box_visit_tag.dart';
|
||||
import 'model.dart';
|
||||
|
||||
export 'package:objectbox/objectbox.dart'; // so that callers only have to import this file
|
||||
|
||||
final _entities = <ModelEntity>[
|
||||
ModelEntity(
|
||||
id: const IdUid(1, 2802681814019499133),
|
||||
name: 'Note',
|
||||
lastPropertyId: const IdUid(4, 6451339597165131221),
|
||||
flags: 0,
|
||||
properties: <ModelProperty>[
|
||||
ModelProperty(
|
||||
id: const IdUid(1, 3178873177797362769),
|
||||
name: 'id',
|
||||
type: 6,
|
||||
flags: 1),
|
||||
ModelProperty(
|
||||
id: const IdUid(2, 4285343053028527696),
|
||||
name: 'text',
|
||||
type: 9,
|
||||
flags: 0),
|
||||
ModelProperty(
|
||||
id: const IdUid(3, 2606273611209948020),
|
||||
name: 'comment',
|
||||
type: 9,
|
||||
flags: 0),
|
||||
ModelProperty(
|
||||
id: const IdUid(4, 6451339597165131221),
|
||||
name: 'date',
|
||||
type: 10,
|
||||
flags: 0)
|
||||
],
|
||||
relations: <ModelRelation>[],
|
||||
backlinks: <ModelBacklink>[]),
|
||||
ModelEntity(
|
||||
id: const IdUid(3, 6664528022814238868),
|
||||
name: 'User',
|
||||
|
|
@ -455,7 +425,8 @@ ModelDefinition getObjectBoxModel() {
|
|||
6788844671665652158,
|
||||
2910300629980903548,
|
||||
8290500625256822711,
|
||||
637444607663700174
|
||||
637444607663700174,
|
||||
2802681814019499133
|
||||
],
|
||||
retiredIndexUids: const [7907819717055295102],
|
||||
retiredPropertyUids: const [
|
||||
|
|
@ -510,7 +481,11 @@ ModelDefinition getObjectBoxModel() {
|
|||
1526411175344533047,
|
||||
1603887098520719919,
|
||||
427077651567855068,
|
||||
7039119413270734559
|
||||
7039119413270734559,
|
||||
3178873177797362769,
|
||||
4285343053028527696,
|
||||
2606273611209948020,
|
||||
6451339597165131221
|
||||
],
|
||||
retiredRelationUids: const [],
|
||||
modelVersion: 5,
|
||||
|
|
@ -518,43 +493,8 @@ ModelDefinition getObjectBoxModel() {
|
|||
version: 1);
|
||||
|
||||
final bindings = <Type, EntityDefinition>{
|
||||
Note: EntityDefinition<Note>(
|
||||
model: _entities[0],
|
||||
toOneRelations: (Note object) => [],
|
||||
toManyRelations: (Note object) => {},
|
||||
getId: (Note object) => object.id,
|
||||
setId: (Note object, int id) {
|
||||
object.id = id;
|
||||
},
|
||||
objectToFB: (Note object, fb.Builder fbb) {
|
||||
final textOffset = fbb.writeString(object.text);
|
||||
final commentOffset =
|
||||
object.comment == null ? null : fbb.writeString(object.comment!);
|
||||
fbb.startTable(5);
|
||||
fbb.addInt64(0, object.id);
|
||||
fbb.addOffset(1, textOffset);
|
||||
fbb.addOffset(2, commentOffset);
|
||||
fbb.addInt64(3, object.date.millisecondsSinceEpoch);
|
||||
fbb.finish(fbb.endTable());
|
||||
return object.id;
|
||||
},
|
||||
objectFromFB: (Store store, ByteData fbData) {
|
||||
final buffer = fb.BufferContext(fbData);
|
||||
final rootOffset = buffer.derefObject(0);
|
||||
|
||||
final object = Note(
|
||||
const fb.StringReader(asciiOptimization: true)
|
||||
.vTableGet(buffer, rootOffset, 6, ''),
|
||||
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
||||
comment: const fb.StringReader(asciiOptimization: true)
|
||||
.vTableGetNullable(buffer, rootOffset, 8),
|
||||
date: DateTime.fromMillisecondsSinceEpoch(
|
||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 10, 0)));
|
||||
|
||||
return object;
|
||||
}),
|
||||
User: EntityDefinition<User>(
|
||||
model: _entities[1],
|
||||
model: _entities[0],
|
||||
toOneRelations: (User object) => [],
|
||||
toManyRelations: (User object) => {},
|
||||
getId: (User object) => object.id,
|
||||
|
|
@ -596,7 +536,7 @@ ModelDefinition getObjectBoxModel() {
|
|||
return object;
|
||||
}),
|
||||
Log: EntityDefinition<Log>(
|
||||
model: _entities[2],
|
||||
model: _entities[1],
|
||||
toOneRelations: (Log object) => [],
|
||||
toManyRelations: (Log object) => {},
|
||||
getId: (Log object) => object.id,
|
||||
|
|
@ -639,7 +579,7 @@ ModelDefinition getObjectBoxModel() {
|
|||
return object;
|
||||
}),
|
||||
Etab: EntityDefinition<Etab>(
|
||||
model: _entities[3],
|
||||
model: _entities[2],
|
||||
toOneRelations: (Etab object) => [],
|
||||
toManyRelations: (Etab object) => {},
|
||||
getId: (Etab object) => object.id,
|
||||
|
|
@ -691,7 +631,7 @@ ModelDefinition getObjectBoxModel() {
|
|||
return object;
|
||||
}),
|
||||
PhotoTypology: EntityDefinition<PhotoTypology>(
|
||||
model: _entities[4],
|
||||
model: _entities[3],
|
||||
toOneRelations: (PhotoTypology object) => [],
|
||||
toManyRelations: (PhotoTypology object) => {},
|
||||
getId: (PhotoTypology object) => object.id,
|
||||
|
|
@ -724,7 +664,7 @@ ModelDefinition getObjectBoxModel() {
|
|||
return object;
|
||||
}),
|
||||
EtabCompetitor: EntityDefinition<EtabCompetitor>(
|
||||
model: _entities[5],
|
||||
model: _entities[4],
|
||||
toOneRelations: (EtabCompetitor object) => [],
|
||||
toManyRelations: (EtabCompetitor object) => {},
|
||||
getId: (EtabCompetitor object) => object.id,
|
||||
|
|
@ -757,7 +697,7 @@ ModelDefinition getObjectBoxModel() {
|
|||
return object;
|
||||
}),
|
||||
VisitPhoto: EntityDefinition<VisitPhoto>(
|
||||
model: _entities[6],
|
||||
model: _entities[5],
|
||||
toOneRelations: (VisitPhoto object) => [],
|
||||
toManyRelations: (VisitPhoto object) => {},
|
||||
getId: (VisitPhoto object) => object.id,
|
||||
|
|
@ -812,7 +752,7 @@ ModelDefinition getObjectBoxModel() {
|
|||
return object;
|
||||
}),
|
||||
Visit: EntityDefinition<Visit>(
|
||||
model: _entities[7],
|
||||
model: _entities[6],
|
||||
toOneRelations: (Visit object) => [],
|
||||
toManyRelations: (Visit object) => {},
|
||||
getId: (Visit object) => object.id,
|
||||
|
|
@ -880,7 +820,7 @@ ModelDefinition getObjectBoxModel() {
|
|||
return object;
|
||||
}),
|
||||
VisitTag: EntityDefinition<VisitTag>(
|
||||
model: _entities[8],
|
||||
model: _entities[7],
|
||||
toOneRelations: (VisitTag object) => [],
|
||||
toManyRelations: (VisitTag object) => {},
|
||||
getId: (VisitTag object) => object.id,
|
||||
|
|
@ -921,255 +861,240 @@ ModelDefinition getObjectBoxModel() {
|
|||
return ModelDefinition(model, bindings);
|
||||
}
|
||||
|
||||
/// [Note] entity fields to define ObjectBox queries.
|
||||
class Note_ {
|
||||
/// see [Note.id]
|
||||
static final id = QueryIntegerProperty<Note>(_entities[0].properties[0]);
|
||||
|
||||
/// see [Note.text]
|
||||
static final text = QueryStringProperty<Note>(_entities[0].properties[1]);
|
||||
|
||||
/// see [Note.comment]
|
||||
static final comment = QueryStringProperty<Note>(_entities[0].properties[2]);
|
||||
|
||||
/// see [Note.date]
|
||||
static final date = QueryIntegerProperty<Note>(_entities[0].properties[3]);
|
||||
}
|
||||
|
||||
/// [User] entity fields to define ObjectBox queries.
|
||||
class User_ {
|
||||
/// see [User.id]
|
||||
static final id = QueryIntegerProperty<User>(_entities[1].properties[0]);
|
||||
static final id = QueryIntegerProperty<User>(_entities[0].properties[0]);
|
||||
|
||||
/// see [User.photo]
|
||||
static final photo = QueryStringProperty<User>(_entities[1].properties[1]);
|
||||
static final photo = QueryStringProperty<User>(_entities[0].properties[1]);
|
||||
|
||||
/// see [User.login]
|
||||
static final login = QueryStringProperty<User>(_entities[1].properties[2]);
|
||||
static final login = QueryStringProperty<User>(_entities[0].properties[2]);
|
||||
|
||||
/// see [User.nom]
|
||||
static final nom = QueryStringProperty<User>(_entities[1].properties[3]);
|
||||
static final nom = QueryStringProperty<User>(_entities[0].properties[3]);
|
||||
|
||||
/// see [User.prenom]
|
||||
static final prenom = QueryStringProperty<User>(_entities[1].properties[4]);
|
||||
static final prenom = QueryStringProperty<User>(_entities[0].properties[4]);
|
||||
|
||||
/// see [User.id_utilisateur]
|
||||
static final id_utilisateur =
|
||||
QueryIntegerProperty<User>(_entities[1].properties[5]);
|
||||
QueryIntegerProperty<User>(_entities[0].properties[5]);
|
||||
}
|
||||
|
||||
/// [Log] entity fields to define ObjectBox queries.
|
||||
class Log_ {
|
||||
/// see [Log.id]
|
||||
static final id = QueryIntegerProperty<Log>(_entities[2].properties[0]);
|
||||
static final id = QueryIntegerProperty<Log>(_entities[1].properties[0]);
|
||||
|
||||
/// see [Log.type]
|
||||
static final type = QueryStringProperty<Log>(_entities[2].properties[1]);
|
||||
static final type = QueryStringProperty<Log>(_entities[1].properties[1]);
|
||||
|
||||
/// see [Log.date]
|
||||
static final date = QueryIntegerProperty<Log>(_entities[2].properties[2]);
|
||||
static final date = QueryIntegerProperty<Log>(_entities[1].properties[2]);
|
||||
|
||||
/// see [Log.module]
|
||||
static final module = QueryStringProperty<Log>(_entities[2].properties[3]);
|
||||
static final module = QueryStringProperty<Log>(_entities[1].properties[3]);
|
||||
|
||||
/// see [Log.libelle]
|
||||
static final libelle = QueryStringProperty<Log>(_entities[2].properties[4]);
|
||||
static final libelle = QueryStringProperty<Log>(_entities[1].properties[4]);
|
||||
|
||||
/// see [Log.duree]
|
||||
static final duree = QueryIntegerProperty<Log>(_entities[2].properties[5]);
|
||||
static final duree = QueryIntegerProperty<Log>(_entities[1].properties[5]);
|
||||
|
||||
/// see [Log.uploaded]
|
||||
static final uploaded = QueryIntegerProperty<Log>(_entities[2].properties[6]);
|
||||
static final uploaded = QueryIntegerProperty<Log>(_entities[1].properties[6]);
|
||||
}
|
||||
|
||||
/// [Etab] entity fields to define ObjectBox queries.
|
||||
class Etab_ {
|
||||
/// see [Etab.id]
|
||||
static final id = QueryIntegerProperty<Etab>(_entities[3].properties[0]);
|
||||
static final id = QueryIntegerProperty<Etab>(_entities[2].properties[0]);
|
||||
|
||||
/// see [Etab.id_etab]
|
||||
static final id_etab = QueryIntegerProperty<Etab>(_entities[3].properties[1]);
|
||||
static final id_etab = QueryIntegerProperty<Etab>(_entities[2].properties[1]);
|
||||
|
||||
/// see [Etab.nom]
|
||||
static final nom = QueryStringProperty<Etab>(_entities[3].properties[2]);
|
||||
static final nom = QueryStringProperty<Etab>(_entities[2].properties[2]);
|
||||
|
||||
/// see [Etab.mail]
|
||||
static final mail = QueryStringProperty<Etab>(_entities[3].properties[3]);
|
||||
static final mail = QueryStringProperty<Etab>(_entities[2].properties[3]);
|
||||
|
||||
/// see [Etab.tel]
|
||||
static final tel = QueryStringProperty<Etab>(_entities[3].properties[4]);
|
||||
static final tel = QueryStringProperty<Etab>(_entities[2].properties[4]);
|
||||
|
||||
/// see [Etab.longitude]
|
||||
static final longitude =
|
||||
QueryStringProperty<Etab>(_entities[3].properties[5]);
|
||||
QueryStringProperty<Etab>(_entities[2].properties[5]);
|
||||
|
||||
/// see [Etab.latitude]
|
||||
static final latitude = QueryStringProperty<Etab>(_entities[3].properties[6]);
|
||||
static final latitude = QueryStringProperty<Etab>(_entities[2].properties[6]);
|
||||
|
||||
/// see [Etab.url_photo_principale]
|
||||
static final url_photo_principale =
|
||||
QueryStringProperty<Etab>(_entities[3].properties[7]);
|
||||
QueryStringProperty<Etab>(_entities[2].properties[7]);
|
||||
}
|
||||
|
||||
/// [PhotoTypology] entity fields to define ObjectBox queries.
|
||||
class PhotoTypology_ {
|
||||
/// see [PhotoTypology.id]
|
||||
static final id =
|
||||
QueryIntegerProperty<PhotoTypology>(_entities[4].properties[0]);
|
||||
QueryIntegerProperty<PhotoTypology>(_entities[3].properties[0]);
|
||||
|
||||
/// see [PhotoTypology.id_photo_typologie]
|
||||
static final id_photo_typologie =
|
||||
QueryIntegerProperty<PhotoTypology>(_entities[4].properties[1]);
|
||||
QueryIntegerProperty<PhotoTypology>(_entities[3].properties[1]);
|
||||
|
||||
/// see [PhotoTypology.libelle]
|
||||
static final libelle =
|
||||
QueryStringProperty<PhotoTypology>(_entities[4].properties[2]);
|
||||
QueryStringProperty<PhotoTypology>(_entities[3].properties[2]);
|
||||
|
||||
/// see [PhotoTypology.ordre]
|
||||
static final ordre =
|
||||
QueryIntegerProperty<PhotoTypology>(_entities[4].properties[3]);
|
||||
QueryIntegerProperty<PhotoTypology>(_entities[3].properties[3]);
|
||||
}
|
||||
|
||||
/// [EtabCompetitor] entity fields to define ObjectBox queries.
|
||||
class EtabCompetitor_ {
|
||||
/// see [EtabCompetitor.id]
|
||||
static final id =
|
||||
QueryIntegerProperty<EtabCompetitor>(_entities[5].properties[0]);
|
||||
QueryIntegerProperty<EtabCompetitor>(_entities[4].properties[0]);
|
||||
|
||||
/// see [EtabCompetitor.id_concurrence_lien]
|
||||
static final id_concurrence_lien =
|
||||
QueryIntegerProperty<EtabCompetitor>(_entities[5].properties[1]);
|
||||
QueryIntegerProperty<EtabCompetitor>(_entities[4].properties[1]);
|
||||
|
||||
/// see [EtabCompetitor.id_etab]
|
||||
static final id_etab =
|
||||
QueryIntegerProperty<EtabCompetitor>(_entities[5].properties[2]);
|
||||
QueryIntegerProperty<EtabCompetitor>(_entities[4].properties[2]);
|
||||
|
||||
/// see [EtabCompetitor.nom]
|
||||
static final nom =
|
||||
QueryStringProperty<EtabCompetitor>(_entities[5].properties[3]);
|
||||
QueryStringProperty<EtabCompetitor>(_entities[4].properties[3]);
|
||||
}
|
||||
|
||||
/// [VisitPhoto] entity fields to define ObjectBox queries.
|
||||
class VisitPhoto_ {
|
||||
/// see [VisitPhoto.id]
|
||||
static final id =
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[6].properties[0]);
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[5].properties[0]);
|
||||
|
||||
/// see [VisitPhoto.id_visite]
|
||||
static final id_visite =
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[6].properties[1]);
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[5].properties[1]);
|
||||
|
||||
/// see [VisitPhoto.id_photo_typologie]
|
||||
static final id_photo_typologie =
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[6].properties[2]);
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[5].properties[2]);
|
||||
|
||||
/// see [VisitPhoto.image_name]
|
||||
static final image_name =
|
||||
QueryStringProperty<VisitPhoto>(_entities[6].properties[3]);
|
||||
QueryStringProperty<VisitPhoto>(_entities[5].properties[3]);
|
||||
|
||||
/// see [VisitPhoto.date_photo]
|
||||
static final date_photo =
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[6].properties[4]);
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[5].properties[4]);
|
||||
|
||||
/// see [VisitPhoto.id_photo_mp4]
|
||||
static final id_photo_mp4 =
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[6].properties[5]);
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[5].properties[5]);
|
||||
|
||||
/// see [VisitPhoto.photo_privee]
|
||||
static final photo_privee =
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[6].properties[6]);
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[5].properties[6]);
|
||||
|
||||
/// see [VisitPhoto.photo_principale]
|
||||
static final photo_principale =
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[6].properties[7]);
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[5].properties[7]);
|
||||
|
||||
/// see [VisitPhoto.tags]
|
||||
static final tags =
|
||||
QueryStringProperty<VisitPhoto>(_entities[6].properties[8]);
|
||||
QueryStringProperty<VisitPhoto>(_entities[5].properties[8]);
|
||||
|
||||
/// see [VisitPhoto.id_concurrence_lien]
|
||||
static final id_concurrence_lien =
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[6].properties[9]);
|
||||
QueryIntegerProperty<VisitPhoto>(_entities[5].properties[9]);
|
||||
|
||||
/// see [VisitPhoto.depuis_galerie]
|
||||
static final depuis_galerie =
|
||||
QueryBooleanProperty<VisitPhoto>(_entities[6].properties[10]);
|
||||
QueryBooleanProperty<VisitPhoto>(_entities[5].properties[10]);
|
||||
}
|
||||
|
||||
/// [Visit] entity fields to define ObjectBox queries.
|
||||
class Visit_ {
|
||||
/// see [Visit.id]
|
||||
static final id = QueryIntegerProperty<Visit>(_entities[7].properties[0]);
|
||||
static final id = QueryIntegerProperty<Visit>(_entities[6].properties[0]);
|
||||
|
||||
/// see [Visit.id_visite]
|
||||
static final id_visite =
|
||||
QueryIntegerProperty<Visit>(_entities[7].properties[1]);
|
||||
QueryIntegerProperty<Visit>(_entities[6].properties[1]);
|
||||
|
||||
/// see [Visit.date_visite]
|
||||
static final date_visite =
|
||||
QueryIntegerProperty<Visit>(_entities[7].properties[2]);
|
||||
QueryIntegerProperty<Visit>(_entities[6].properties[2]);
|
||||
|
||||
/// see [Visit.date_debut]
|
||||
static final date_debut =
|
||||
QueryIntegerProperty<Visit>(_entities[7].properties[3]);
|
||||
QueryIntegerProperty<Visit>(_entities[6].properties[3]);
|
||||
|
||||
/// see [Visit.date_fin]
|
||||
static final date_fin =
|
||||
QueryIntegerProperty<Visit>(_entities[7].properties[4]);
|
||||
QueryIntegerProperty<Visit>(_entities[6].properties[4]);
|
||||
|
||||
/// see [Visit.date_validation]
|
||||
static final date_validation =
|
||||
QueryIntegerProperty<Visit>(_entities[7].properties[5]);
|
||||
QueryIntegerProperty<Visit>(_entities[6].properties[5]);
|
||||
|
||||
/// see [Visit.type_visite]
|
||||
static final type_visite =
|
||||
QueryStringProperty<Visit>(_entities[7].properties[6]);
|
||||
QueryStringProperty<Visit>(_entities[6].properties[6]);
|
||||
|
||||
/// see [Visit.title]
|
||||
static final title = QueryStringProperty<Visit>(_entities[7].properties[7]);
|
||||
static final title = QueryStringProperty<Visit>(_entities[6].properties[7]);
|
||||
|
||||
/// see [Visit.allDay]
|
||||
static final allDay = QueryBooleanProperty<Visit>(_entities[7].properties[8]);
|
||||
static final allDay = QueryBooleanProperty<Visit>(_entities[6].properties[8]);
|
||||
|
||||
/// see [Visit.id_distrib_visite]
|
||||
static final id_distrib_visite =
|
||||
QueryIntegerProperty<Visit>(_entities[7].properties[9]);
|
||||
QueryIntegerProperty<Visit>(_entities[6].properties[9]);
|
||||
|
||||
/// see [Visit.id_etab]
|
||||
static final id_etab =
|
||||
QueryIntegerProperty<Visit>(_entities[7].properties[10]);
|
||||
QueryIntegerProperty<Visit>(_entities[6].properties[10]);
|
||||
|
||||
/// see [Visit.abandon]
|
||||
static final abandon =
|
||||
QueryIntegerProperty<Visit>(_entities[7].properties[11]);
|
||||
QueryIntegerProperty<Visit>(_entities[6].properties[11]);
|
||||
|
||||
/// see [Visit.url_photo_principale]
|
||||
static final url_photo_principale =
|
||||
QueryStringProperty<Visit>(_entities[7].properties[12]);
|
||||
QueryStringProperty<Visit>(_entities[6].properties[12]);
|
||||
|
||||
/// see [Visit.langage]
|
||||
static final langage =
|
||||
QueryStringProperty<Visit>(_entities[7].properties[13]);
|
||||
QueryStringProperty<Visit>(_entities[6].properties[13]);
|
||||
}
|
||||
|
||||
/// [VisitTag] entity fields to define ObjectBox queries.
|
||||
class VisitTag_ {
|
||||
/// see [VisitTag.id]
|
||||
static final id = QueryIntegerProperty<VisitTag>(_entities[8].properties[0]);
|
||||
static final id = QueryIntegerProperty<VisitTag>(_entities[7].properties[0]);
|
||||
|
||||
/// see [VisitTag.id_visite_tag]
|
||||
static final id_visite_tag =
|
||||
QueryIntegerProperty<VisitTag>(_entities[8].properties[1]);
|
||||
QueryIntegerProperty<VisitTag>(_entities[7].properties[1]);
|
||||
|
||||
/// see [VisitTag.id_distrib]
|
||||
static final id_distrib =
|
||||
QueryIntegerProperty<VisitTag>(_entities[8].properties[2]);
|
||||
QueryIntegerProperty<VisitTag>(_entities[7].properties[2]);
|
||||
|
||||
/// see [VisitTag.libelle]
|
||||
static final libelle =
|
||||
QueryStringProperty<VisitTag>(_entities[8].properties[3]);
|
||||
QueryStringProperty<VisitTag>(_entities[7].properties[3]);
|
||||
|
||||
/// see [VisitTag.langage]
|
||||
static final langage =
|
||||
QueryStringProperty<VisitTag>(_entities[8].properties[4]);
|
||||
QueryStringProperty<VisitTag>(_entities[7].properties[4]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,46 +10,43 @@ class LogPage extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _LogPageState extends State<LogPage> {
|
||||
GestureDetector Function(BuildContext, int) _itemBuilder(List<Log> logs) =>
|
||||
(BuildContext context, int index) => GestureDetector(
|
||||
onTap: () => objectbox.noteBox.remove(logs[index].id),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
border:
|
||||
Border(bottom: BorderSide(color: Colors.black12))),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 18.0, horizontal: 10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
logs[index].libelle,
|
||||
Widget Function(BuildContext, int) _itemBuilder(List<Log> logs) =>
|
||||
(BuildContext context, int index) => Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
border:
|
||||
Border(bottom: BorderSide(color: Colors.black12))),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 18.0, horizontal: 10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
logs[index].libelle,
|
||||
style: const TextStyle(
|
||||
fontSize: 15.0,
|
||||
),
|
||||
// Provide a Key for the integration test
|
||||
key: Key('list_log_$index'),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5.0),
|
||||
child: Text(
|
||||
'Added on ${logs[index].dateFormat}',
|
||||
style: const TextStyle(
|
||||
fontSize: 15.0,
|
||||
),
|
||||
// Provide a Key for the integration test
|
||||
key: Key('list_log_$index'),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5.0),
|
||||
child: Text(
|
||||
'Added on ${logs[index].dateFormat}',
|
||||
style: const TextStyle(
|
||||
fontSize: 12.0,
|
||||
),
|
||||
fontSize: 12.0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@override
|
||||
|
|
|
|||
Loading…
Reference in New Issue