various updates
This commit is contained in:
parent
481dc60996
commit
38f43a48ec
@ -18,8 +18,8 @@ import 'package:diameter/screens/bolus/bolus_profile_detail.dart';
|
|||||||
import 'package:diameter/screens/log/log_overview.dart';
|
import 'package:diameter/screens/log/log_overview.dart';
|
||||||
import 'package:diameter/screens/reports/daily_chart.dart';
|
import 'package:diameter/screens/reports/daily_chart.dart';
|
||||||
import 'package:diameter/screens/log/log_entry/log_entry.dart';
|
import 'package:diameter/screens/log/log_entry/log_entry.dart';
|
||||||
import 'package:diameter/screens/log/log_event_detail.dart';
|
import 'package:diameter/screens/log/log_event/log_event_detail.dart';
|
||||||
import 'package:diameter/screens/log/log_event_list.dart';
|
import 'package:diameter/screens/log/log_event/log_event_list.dart';
|
||||||
import 'package:diameter/screens/meal/meal_detail.dart';
|
import 'package:diameter/screens/meal/meal_detail.dart';
|
||||||
import 'package:diameter/screens/meal/meal_list.dart';
|
import 'package:diameter/screens/meal/meal_list.dart';
|
||||||
import 'package:diameter/screens/reports/export.dart';
|
import 'package:diameter/screens/reports/export.dart';
|
||||||
|
@ -68,19 +68,4 @@ class LogEntry {
|
|||||||
String toString() {
|
String toString() {
|
||||||
return DateTimeUtils.displayDateTime(time);
|
return DateTimeUtils.displayDateTime(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<LogEntry> getAllForDate(DateTime date) {
|
|
||||||
DateTime startOfDay = DateTime(date.year, date.month, date.day);
|
|
||||||
DateTime endOfDay = startOfDay.add(const Duration(days: 1));
|
|
||||||
QueryBuilder<LogEntry> builder = box.query(LogEntry_.deleted.equals(false))
|
|
||||||
..order(LogEntry_.time, flags: Order.descending);
|
|
||||||
return builder.build().find().where((entry) {
|
|
||||||
return (entry.time.compareTo(startOfDay) >= 0 && entry.time.isBefore(endOfDay));
|
|
||||||
}).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return DateTimeUtils.displayDateTime(time);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,8 @@ import 'package:diameter/screens/log/log_entry/log_bolus_detail.dart';
|
|||||||
import 'package:diameter/screens/log/log_overview.dart';
|
import 'package:diameter/screens/log/log_overview.dart';
|
||||||
import 'package:diameter/screens/reports/daily_chart.dart';
|
import 'package:diameter/screens/reports/daily_chart.dart';
|
||||||
import 'package:diameter/screens/log/log_entry/log_entry.dart';
|
import 'package:diameter/screens/log/log_entry/log_entry.dart';
|
||||||
import 'package:diameter/screens/log/log_event_detail.dart';
|
import 'package:diameter/screens/log/log_event/log_event_detail.dart';
|
||||||
import 'package:diameter/screens/log/log_event_list.dart';
|
import 'package:diameter/screens/log/log_event/log_event_list.dart';
|
||||||
import 'package:diameter/screens/log/log_entry/log_meal_detail.dart';
|
import 'package:diameter/screens/log/log_entry/log_meal_detail.dart';
|
||||||
import 'package:diameter/screens/meal/meal_detail.dart';
|
import 'package:diameter/screens/meal/meal_detail.dart';
|
||||||
import 'package:diameter/screens/meal/meal_list.dart';
|
import 'package:diameter/screens/meal/meal_list.dart';
|
||||||
|
@ -1087,19 +1087,44 @@
|
|||||||
"lastSequenceId": "0:0",
|
"lastSequenceId": "0:0",
|
||||||
"modelVersion": 5,
|
"modelVersion": 5,
|
||||||
"modelVersionParserMinimum": 5,
|
"modelVersionParserMinimum": 5,
|
||||||
"retiredEntityUids": [3095978685310268382],
|
"retiredEntityUids": [
|
||||||
"retiredIndexUids": [3670661188280692002, 7379712902406481832],
|
3095978685310268382
|
||||||
|
],
|
||||||
|
"retiredIndexUids": [
|
||||||
|
3670661188280692002,
|
||||||
|
7379712902406481832
|
||||||
|
],
|
||||||
"retiredPropertyUids": [
|
"retiredPropertyUids": [
|
||||||
3455702077061719523, 1048198814030724077, 9003780003858349085,
|
3455702077061719523,
|
||||||
5421422436108145565, 7741631874181070179, 5471636804765937328,
|
1048198814030724077,
|
||||||
6855574218883169324, 5313708456544000157, 3678829169126156351,
|
9003780003858349085,
|
||||||
1568597071506264632, 8795268969829293398, 3247926313599127440,
|
5421422436108145565,
|
||||||
8789440370359282572, 7838546213550447420, 8031421171668506924,
|
7741631874181070179,
|
||||||
1614362036318874174, 1675040259141389754, 7518219134349037920,
|
5471636804765937328,
|
||||||
2172890064639236018, 310032577683835406, 5588897884422150510,
|
6855574218883169324,
|
||||||
7638848982383620744, 3282706593658092097, 596980591281311896,
|
5313708456544000157,
|
||||||
3633551763915044903, 2215708755581938580, 241621230513128588,
|
3678829169126156351,
|
||||||
4678123663117222609, 780211923138281722, 763575433624979013,
|
1568597071506264632,
|
||||||
|
8795268969829293398,
|
||||||
|
3247926313599127440,
|
||||||
|
8789440370359282572,
|
||||||
|
7838546213550447420,
|
||||||
|
8031421171668506924,
|
||||||
|
1614362036318874174,
|
||||||
|
1675040259141389754,
|
||||||
|
7518219134349037920,
|
||||||
|
2172890064639236018,
|
||||||
|
310032577683835406,
|
||||||
|
5588897884422150510,
|
||||||
|
7638848982383620744,
|
||||||
|
3282706593658092097,
|
||||||
|
596980591281311896,
|
||||||
|
3633551763915044903,
|
||||||
|
2215708755581938580,
|
||||||
|
241621230513128588,
|
||||||
|
4678123663117222609,
|
||||||
|
780211923138281722,
|
||||||
|
763575433624979013,
|
||||||
1225271130099322691
|
1225271130099322691
|
||||||
],
|
],
|
||||||
"retiredRelationUids": [],
|
"retiredRelationUids": [],
|
||||||
|
@ -1234,7 +1234,7 @@ ModelDefinition getObjectBoxModel() {
|
|||||||
final buffer = fb.BufferContext(fbData);
|
final buffer = fb.BufferContext(fbData);
|
||||||
final rootOffset = buffer.derefObject(0);
|
final rootOffset = buffer.derefObject(0);
|
||||||
|
|
||||||
final object = LogEventType(
|
final object = Bolus(
|
||||||
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
||||||
deleted: const fb.BoolReader()
|
deleted: const fb.BoolReader()
|
||||||
.vTableGet(buffer, rootOffset, 20, false),
|
.vTableGet(buffer, rootOffset, 20, false),
|
||||||
@ -1250,6 +1250,190 @@ ModelDefinition getObjectBoxModel() {
|
|||||||
.vTableGetNullable(buffer, rootOffset, 14),
|
.vTableGetNullable(buffer, rootOffset, 14),
|
||||||
mmolPerL: const fb.Float64Reader()
|
mmolPerL: const fb.Float64Reader()
|
||||||
.vTableGetNullable(buffer, rootOffset, 16));
|
.vTableGetNullable(buffer, rootOffset, 16));
|
||||||
|
object.bolusProfile.targetId =
|
||||||
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 18, 0);
|
||||||
|
object.bolusProfile.attach(store);
|
||||||
|
return object;
|
||||||
|
}),
|
||||||
|
BolusProfile: EntityDefinition<BolusProfile>(
|
||||||
|
model: _entities[3],
|
||||||
|
toOneRelations: (BolusProfile object) => [],
|
||||||
|
toManyRelations: (BolusProfile object) => {},
|
||||||
|
getId: (BolusProfile object) => object.id,
|
||||||
|
setId: (BolusProfile object, int id) {
|
||||||
|
object.id = id;
|
||||||
|
},
|
||||||
|
objectToFB: (BolusProfile object, fb.Builder fbb) {
|
||||||
|
final nameOffset = fbb.writeString(object.name);
|
||||||
|
final notesOffset =
|
||||||
|
object.notes == null ? null : fbb.writeString(object.notes!);
|
||||||
|
fbb.startTable(6);
|
||||||
|
fbb.addInt64(0, object.id);
|
||||||
|
fbb.addOffset(1, nameOffset);
|
||||||
|
fbb.addBool(2, object.active);
|
||||||
|
fbb.addOffset(3, notesOffset);
|
||||||
|
fbb.addBool(4, object.deleted);
|
||||||
|
fbb.finish(fbb.endTable());
|
||||||
|
return object.id;
|
||||||
|
},
|
||||||
|
objectFromFB: (Store store, ByteData fbData) {
|
||||||
|
final buffer = fb.BufferContext(fbData);
|
||||||
|
final rootOffset = buffer.derefObject(0);
|
||||||
|
|
||||||
|
final object = BolusProfile(
|
||||||
|
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
||||||
|
deleted: const fb.BoolReader()
|
||||||
|
.vTableGet(buffer, rootOffset, 12, false),
|
||||||
|
name: const fb.StringReader(asciiOptimization: true)
|
||||||
|
.vTableGet(buffer, rootOffset, 6, ''),
|
||||||
|
active:
|
||||||
|
const fb.BoolReader().vTableGet(buffer, rootOffset, 8, false),
|
||||||
|
notes: const fb.StringReader(asciiOptimization: true)
|
||||||
|
.vTableGetNullable(buffer, rootOffset, 10));
|
||||||
|
|
||||||
|
return object;
|
||||||
|
}),
|
||||||
|
LogEntry: EntityDefinition<LogEntry>(
|
||||||
|
model: _entities[4],
|
||||||
|
toOneRelations: (LogEntry object) => [],
|
||||||
|
toManyRelations: (LogEntry object) => {},
|
||||||
|
getId: (LogEntry object) => object.id,
|
||||||
|
setId: (LogEntry object, int id) {
|
||||||
|
object.id = id;
|
||||||
|
},
|
||||||
|
objectToFB: (LogEntry object, fb.Builder fbb) {
|
||||||
|
final notesOffset =
|
||||||
|
object.notes == null ? null : fbb.writeString(object.notes!);
|
||||||
|
fbb.startTable(11);
|
||||||
|
fbb.addInt64(0, object.id);
|
||||||
|
fbb.addInt64(1, object.time.millisecondsSinceEpoch);
|
||||||
|
fbb.addInt64(2, object.mgPerDl);
|
||||||
|
fbb.addFloat64(3, object.mmolPerL);
|
||||||
|
fbb.addOffset(7, notesOffset);
|
||||||
|
fbb.addBool(8, object.deleted);
|
||||||
|
fbb.addFloat64(9, object.glucoseTrend);
|
||||||
|
fbb.finish(fbb.endTable());
|
||||||
|
return object.id;
|
||||||
|
},
|
||||||
|
objectFromFB: (Store store, ByteData fbData) {
|
||||||
|
final buffer = fb.BufferContext(fbData);
|
||||||
|
final rootOffset = buffer.derefObject(0);
|
||||||
|
|
||||||
|
final object = LogEntry(
|
||||||
|
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
||||||
|
deleted: const fb.BoolReader()
|
||||||
|
.vTableGet(buffer, rootOffset, 20, false),
|
||||||
|
time: DateTime.fromMillisecondsSinceEpoch(
|
||||||
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0)),
|
||||||
|
mgPerDl: const fb.Int64Reader()
|
||||||
|
.vTableGetNullable(buffer, rootOffset, 8),
|
||||||
|
mmolPerL: const fb.Float64Reader()
|
||||||
|
.vTableGetNullable(buffer, rootOffset, 10),
|
||||||
|
glucoseTrend: const fb.Float64Reader()
|
||||||
|
.vTableGetNullable(buffer, rootOffset, 22),
|
||||||
|
notes: const fb.StringReader(asciiOptimization: true)
|
||||||
|
.vTableGetNullable(buffer, rootOffset, 18));
|
||||||
|
|
||||||
|
return object;
|
||||||
|
}),
|
||||||
|
LogEvent: EntityDefinition<LogEvent>(
|
||||||
|
model: _entities[5],
|
||||||
|
toOneRelations: (LogEvent object) =>
|
||||||
|
[object.eventType, object.bolusProfile, object.basalProfile],
|
||||||
|
toManyRelations: (LogEvent object) => {},
|
||||||
|
getId: (LogEvent object) => object.id,
|
||||||
|
setId: (LogEvent object, int id) {
|
||||||
|
object.id = id;
|
||||||
|
},
|
||||||
|
objectToFB: (LogEvent object, fb.Builder fbb) {
|
||||||
|
final notesOffset =
|
||||||
|
object.notes == null ? null : fbb.writeString(object.notes!);
|
||||||
|
fbb.startTable(13);
|
||||||
|
fbb.addInt64(0, object.id);
|
||||||
|
fbb.addInt64(1, object.time.millisecondsSinceEpoch);
|
||||||
|
fbb.addInt64(2, object.endTime?.millisecondsSinceEpoch);
|
||||||
|
fbb.addBool(3, object.hasEndTime);
|
||||||
|
fbb.addOffset(4, notesOffset);
|
||||||
|
fbb.addInt64(7, object.eventType.targetId);
|
||||||
|
fbb.addBool(8, object.deleted);
|
||||||
|
fbb.addInt64(9, object.bolusProfile.targetId);
|
||||||
|
fbb.addInt64(10, object.basalProfile.targetId);
|
||||||
|
fbb.addInt64(11, object.reminderDuration);
|
||||||
|
fbb.finish(fbb.endTable());
|
||||||
|
return object.id;
|
||||||
|
},
|
||||||
|
objectFromFB: (Store store, ByteData fbData) {
|
||||||
|
final buffer = fb.BufferContext(fbData);
|
||||||
|
final rootOffset = buffer.derefObject(0);
|
||||||
|
final endTimeValue =
|
||||||
|
const fb.Int64Reader().vTableGetNullable(buffer, rootOffset, 8);
|
||||||
|
final object = LogEvent(
|
||||||
|
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
||||||
|
deleted: const fb.BoolReader()
|
||||||
|
.vTableGet(buffer, rootOffset, 20, false),
|
||||||
|
time: DateTime.fromMillisecondsSinceEpoch(
|
||||||
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0)),
|
||||||
|
endTime: endTimeValue == null
|
||||||
|
? null
|
||||||
|
: DateTime.fromMillisecondsSinceEpoch(endTimeValue),
|
||||||
|
hasEndTime: const fb.BoolReader()
|
||||||
|
.vTableGet(buffer, rootOffset, 10, false),
|
||||||
|
reminderDuration: const fb.Int64Reader()
|
||||||
|
.vTableGetNullable(buffer, rootOffset, 26),
|
||||||
|
notes: const fb.StringReader(asciiOptimization: true)
|
||||||
|
.vTableGetNullable(buffer, rootOffset, 12));
|
||||||
|
object.eventType.targetId =
|
||||||
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 18, 0);
|
||||||
|
object.eventType.attach(store);
|
||||||
|
object.bolusProfile.targetId =
|
||||||
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 22, 0);
|
||||||
|
object.bolusProfile.attach(store);
|
||||||
|
object.basalProfile.targetId =
|
||||||
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 24, 0);
|
||||||
|
object.basalProfile.attach(store);
|
||||||
|
return object;
|
||||||
|
}),
|
||||||
|
LogEventType: EntityDefinition<LogEventType>(
|
||||||
|
model: _entities[6],
|
||||||
|
toOneRelations: (LogEventType object) =>
|
||||||
|
[object.bolusProfile, object.basalProfile],
|
||||||
|
toManyRelations: (LogEventType object) => {},
|
||||||
|
getId: (LogEventType object) => object.id,
|
||||||
|
setId: (LogEventType object, int id) {
|
||||||
|
object.id = id;
|
||||||
|
},
|
||||||
|
objectToFB: (LogEventType object, fb.Builder fbb) {
|
||||||
|
final valueOffset = fbb.writeString(object.value);
|
||||||
|
final notesOffset =
|
||||||
|
object.notes == null ? null : fbb.writeString(object.notes!);
|
||||||
|
fbb.startTable(9);
|
||||||
|
fbb.addInt64(0, object.id);
|
||||||
|
fbb.addOffset(1, valueOffset);
|
||||||
|
fbb.addBool(2, object.hasEndTime);
|
||||||
|
fbb.addInt64(3, object.defaultReminderDuration);
|
||||||
|
fbb.addOffset(4, notesOffset);
|
||||||
|
fbb.addBool(5, object.deleted);
|
||||||
|
fbb.addInt64(6, object.bolusProfile.targetId);
|
||||||
|
fbb.addInt64(7, object.basalProfile.targetId);
|
||||||
|
fbb.finish(fbb.endTable());
|
||||||
|
return object.id;
|
||||||
|
},
|
||||||
|
objectFromFB: (Store store, ByteData fbData) {
|
||||||
|
final buffer = fb.BufferContext(fbData);
|
||||||
|
final rootOffset = buffer.derefObject(0);
|
||||||
|
|
||||||
|
final object = LogEventType(
|
||||||
|
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
||||||
|
deleted: const fb.BoolReader()
|
||||||
|
.vTableGet(buffer, rootOffset, 14, false),
|
||||||
|
value: const fb.StringReader(asciiOptimization: true)
|
||||||
|
.vTableGet(buffer, rootOffset, 6, ''),
|
||||||
|
hasEndTime:
|
||||||
|
const fb.BoolReader().vTableGet(buffer, rootOffset, 8, false),
|
||||||
|
defaultReminderDuration: const fb.Int64Reader()
|
||||||
|
.vTableGetNullable(buffer, rootOffset, 10),
|
||||||
|
notes: const fb.StringReader(asciiOptimization: true)
|
||||||
|
.vTableGetNullable(buffer, rootOffset, 12));
|
||||||
object.bolusProfile.targetId =
|
object.bolusProfile.targetId =
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 16, 0);
|
const fb.Int64Reader().vTableGet(buffer, rootOffset, 16, 0);
|
||||||
object.bolusProfile.attach(store);
|
object.bolusProfile.attach(store);
|
||||||
@ -1303,353 +1487,6 @@ ModelDefinition getObjectBoxModel() {
|
|||||||
final rootOffset = buffer.derefObject(0);
|
final rootOffset = buffer.derefObject(0);
|
||||||
|
|
||||||
final object = LogMeal(
|
final object = LogMeal(
|
||||||
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
|
||||||
deleted: const fb.BoolReader()
|
|
||||||
.vTableGet(buffer, rootOffset, 36, false),
|
|
||||||
value:
|
|
||||||
const fb.StringReader().vTableGet(buffer, rootOffset, 6, ''),
|
|
||||||
amount:
|
|
||||||
const fb.Float64Reader().vTableGet(buffer, rootOffset, 38, 0),
|
|
||||||
carbsRatio: const fb.Float64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 8),
|
|
||||||
portionSize: const fb.Float64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 10),
|
|
||||||
totalCarbs: const fb.Float64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 40),
|
|
||||||
notes: const fb.StringReader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 20))
|
|
||||||
..bolus = const fb.Float64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 14);
|
|
||||||
object.logEntry.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 22, 0);
|
|
||||||
object.logEntry.attach(store);
|
|
||||||
object.meal.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 24, 0);
|
|
||||||
object.meal.attach(store);
|
|
||||||
object.mealSource.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 26, 0);
|
|
||||||
object.mealSource.attach(store);
|
|
||||||
object.mealCategory.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 28, 0);
|
|
||||||
object.mealCategory.attach(store);
|
|
||||||
object.mealPortionType.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 30, 0);
|
|
||||||
object.mealPortionType.attach(store);
|
|
||||||
object.portionSizeAccuracy.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 32, 0);
|
|
||||||
object.portionSizeAccuracy.attach(store);
|
|
||||||
object.carbsRatioAccuracy.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 34, 0);
|
|
||||||
object.carbsRatioAccuracy.attach(store);
|
|
||||||
return object;
|
|
||||||
}),
|
|
||||||
Meal: EntityDefinition<Meal>(
|
|
||||||
model: _entities[8],
|
|
||||||
toOneRelations: (Meal object) => [
|
|
||||||
object.mealSource,
|
|
||||||
object.mealCategory,
|
|
||||||
object.mealPortionType,
|
|
||||||
object.portionSizeAccuracy,
|
|
||||||
object.carbsRatioAccuracy
|
|
||||||
],
|
|
||||||
toManyRelations: (Meal object) => {},
|
|
||||||
getId: (Meal object) => object.id,
|
|
||||||
setId: (Meal object, int id) {
|
|
||||||
object.id = id;
|
|
||||||
},
|
|
||||||
objectToFB: (Meal object, fb.Builder fbb) {
|
|
||||||
final valueOffset = fbb.writeString(object.value);
|
|
||||||
final notesOffset =
|
|
||||||
object.notes == null ? null : fbb.writeString(object.notes!);
|
|
||||||
fbb.startTable(16);
|
|
||||||
fbb.addInt64(0, object.id);
|
|
||||||
fbb.addOffset(1, valueOffset);
|
|
||||||
fbb.addFloat64(2, object.carbsRatio);
|
|
||||||
fbb.addFloat64(3, object.portionSize);
|
|
||||||
fbb.addFloat64(4, object.carbsPerPortion);
|
|
||||||
fbb.addInt64(5, object.delayedBolusDuration);
|
|
||||||
fbb.addOffset(7, notesOffset);
|
|
||||||
fbb.addInt64(8, object.mealSource.targetId);
|
|
||||||
fbb.addInt64(9, object.mealCategory.targetId);
|
|
||||||
fbb.addInt64(10, object.mealPortionType.targetId);
|
|
||||||
fbb.addInt64(11, object.portionSizeAccuracy.targetId);
|
|
||||||
fbb.addInt64(12, object.carbsRatioAccuracy.targetId);
|
|
||||||
fbb.addBool(13, object.deleted);
|
|
||||||
fbb.addFloat64(14, object.delayedBolusPercentage);
|
|
||||||
fbb.finish(fbb.endTable());
|
|
||||||
return object.id;
|
|
||||||
},
|
|
||||||
objectFromFB: (Store store, ByteData fbData) {
|
|
||||||
final buffer = fb.BufferContext(fbData);
|
|
||||||
final rootOffset = buffer.derefObject(0);
|
|
||||||
|
|
||||||
final object = Meal(
|
|
||||||
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
|
||||||
deleted: const fb.BoolReader()
|
|
||||||
.vTableGet(buffer, rootOffset, 30, false),
|
|
||||||
value:
|
|
||||||
const fb.StringReader().vTableGet(buffer, rootOffset, 6, ''),
|
|
||||||
carbsRatio: const fb.Float64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 8),
|
|
||||||
portionSize: const fb.Float64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 10),
|
|
||||||
carbsPerPortion: const fb.Float64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 12),
|
|
||||||
delayedBolusDuration: const fb.Int64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 14),
|
|
||||||
delayedBolusPercentage: const fb.Float64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 32),
|
|
||||||
notes: const fb.StringReader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 18));
|
|
||||||
object.mealSource.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 20, 0);
|
|
||||||
object.mealSource.attach(store);
|
|
||||||
object.mealCategory.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 22, 0);
|
|
||||||
object.mealCategory.attach(store);
|
|
||||||
object.mealPortionType.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 24, 0);
|
|
||||||
object.mealPortionType.attach(store);
|
|
||||||
object.portionSizeAccuracy.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 26, 0);
|
|
||||||
object.portionSizeAccuracy.attach(store);
|
|
||||||
object.carbsRatioAccuracy.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 28, 0);
|
|
||||||
object.carbsRatioAccuracy.attach(store);
|
|
||||||
return object;
|
|
||||||
}),
|
|
||||||
BolusProfile: EntityDefinition<BolusProfile>(
|
|
||||||
model: _entities[3],
|
|
||||||
toOneRelations: (BolusProfile object) => [],
|
|
||||||
toManyRelations: (BolusProfile object) => {},
|
|
||||||
getId: (BolusProfile object) => object.id,
|
|
||||||
setId: (BolusProfile object, int id) {
|
|
||||||
object.id = id;
|
|
||||||
},
|
|
||||||
objectToFB: (MealCategory object, fb.Builder fbb) {
|
|
||||||
final valueOffset = fbb.writeString(object.value);
|
|
||||||
final notesOffset =
|
|
||||||
object.notes == null ? null : fbb.writeString(object.notes!);
|
|
||||||
fbb.startTable(6);
|
|
||||||
fbb.addInt64(0, object.id);
|
|
||||||
fbb.addOffset(1, nameOffset);
|
|
||||||
fbb.addBool(2, object.active);
|
|
||||||
fbb.addOffset(3, notesOffset);
|
|
||||||
fbb.addBool(4, object.deleted);
|
|
||||||
fbb.finish(fbb.endTable());
|
|
||||||
return object.id;
|
|
||||||
},
|
|
||||||
objectFromFB: (Store store, ByteData fbData) {
|
|
||||||
final buffer = fb.BufferContext(fbData);
|
|
||||||
final rootOffset = buffer.derefObject(0);
|
|
||||||
|
|
||||||
final object = MealCategory(
|
|
||||||
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
|
||||||
deleted: const fb.BoolReader()
|
|
||||||
.vTableGet(buffer, rootOffset, 12, false),
|
|
||||||
name: const fb.StringReader(asciiOptimization: true)
|
|
||||||
.vTableGet(buffer, rootOffset, 6, ''),
|
|
||||||
active:
|
|
||||||
const fb.BoolReader().vTableGet(buffer, rootOffset, 8, false),
|
|
||||||
notes: const fb.StringReader(asciiOptimization: true)
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 10));
|
|
||||||
|
|
||||||
return object;
|
|
||||||
}),
|
|
||||||
LogEntry: EntityDefinition<LogEntry>(
|
|
||||||
model: _entities[4],
|
|
||||||
toOneRelations: (LogEntry object) => [],
|
|
||||||
toManyRelations: (LogEntry object) => {},
|
|
||||||
getId: (LogEntry object) => object.id,
|
|
||||||
setId: (LogEntry object, int id) {
|
|
||||||
object.id = id;
|
|
||||||
},
|
|
||||||
objectToFB: (MealPortionType object, fb.Builder fbb) {
|
|
||||||
final valueOffset = fbb.writeString(object.value);
|
|
||||||
final notesOffset =
|
|
||||||
object.notes == null ? null : fbb.writeString(object.notes!);
|
|
||||||
fbb.startTable(11);
|
|
||||||
fbb.addInt64(0, object.id);
|
|
||||||
fbb.addInt64(1, object.time.millisecondsSinceEpoch);
|
|
||||||
fbb.addInt64(2, object.mgPerDl);
|
|
||||||
fbb.addFloat64(3, object.mmolPerL);
|
|
||||||
fbb.addOffset(7, notesOffset);
|
|
||||||
fbb.addBool(8, object.deleted);
|
|
||||||
fbb.addFloat64(9, object.glucoseTrend);
|
|
||||||
fbb.finish(fbb.endTable());
|
|
||||||
return object.id;
|
|
||||||
},
|
|
||||||
objectFromFB: (Store store, ByteData fbData) {
|
|
||||||
final buffer = fb.BufferContext(fbData);
|
|
||||||
final rootOffset = buffer.derefObject(0);
|
|
||||||
|
|
||||||
final object = MealPortionType(
|
|
||||||
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
|
||||||
deleted: const fb.BoolReader()
|
|
||||||
.vTableGet(buffer, rootOffset, 20, false),
|
|
||||||
time: DateTime.fromMillisecondsSinceEpoch(
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0)),
|
|
||||||
mgPerDl: const fb.Int64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 8),
|
|
||||||
mmolPerL: const fb.Float64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 10),
|
|
||||||
glucoseTrend: const fb.Float64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 22),
|
|
||||||
notes: const fb.StringReader(asciiOptimization: true)
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 18));
|
|
||||||
|
|
||||||
return object;
|
|
||||||
}),
|
|
||||||
LogEvent: EntityDefinition<LogEvent>(
|
|
||||||
model: _entities[5],
|
|
||||||
toOneRelations: (LogEvent object) =>
|
|
||||||
[object.eventType, object.bolusProfile, object.basalProfile],
|
|
||||||
toManyRelations: (LogEvent object) => {},
|
|
||||||
getId: (LogEvent object) => object.id,
|
|
||||||
setId: (LogEvent object, int id) {
|
|
||||||
object.id = id;
|
|
||||||
},
|
|
||||||
objectToFB: (MealSource object, fb.Builder fbb) {
|
|
||||||
final valueOffset = fbb.writeString(object.value);
|
|
||||||
final notesOffset =
|
|
||||||
object.notes == null ? null : fbb.writeString(object.notes!);
|
|
||||||
fbb.startTable(13);
|
|
||||||
fbb.addInt64(0, object.id);
|
|
||||||
fbb.addInt64(1, object.time.millisecondsSinceEpoch);
|
|
||||||
fbb.addInt64(2, object.endTime?.millisecondsSinceEpoch);
|
|
||||||
fbb.addBool(3, object.hasEndTime);
|
|
||||||
fbb.addOffset(4, notesOffset);
|
|
||||||
fbb.addInt64(7, object.eventType.targetId);
|
|
||||||
fbb.addBool(8, object.deleted);
|
|
||||||
fbb.addInt64(9, object.bolusProfile.targetId);
|
|
||||||
fbb.addInt64(10, object.basalProfile.targetId);
|
|
||||||
fbb.addInt64(11, object.reminderDuration);
|
|
||||||
fbb.finish(fbb.endTable());
|
|
||||||
return object.id;
|
|
||||||
},
|
|
||||||
objectFromFB: (Store store, ByteData fbData) {
|
|
||||||
final buffer = fb.BufferContext(fbData);
|
|
||||||
final rootOffset = buffer.derefObject(0);
|
|
||||||
|
|
||||||
final object = MealSource(
|
|
||||||
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
|
||||||
deleted: const fb.BoolReader()
|
|
||||||
.vTableGet(buffer, rootOffset, 20, false),
|
|
||||||
time: DateTime.fromMillisecondsSinceEpoch(
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0)),
|
|
||||||
endTime: endTimeValue == null
|
|
||||||
? null
|
|
||||||
: DateTime.fromMillisecondsSinceEpoch(endTimeValue),
|
|
||||||
hasEndTime: const fb.BoolReader()
|
|
||||||
.vTableGet(buffer, rootOffset, 10, false),
|
|
||||||
reminderDuration: const fb.Int64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 26),
|
|
||||||
notes: const fb.StringReader(asciiOptimization: true)
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 12));
|
|
||||||
object.eventType.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 18, 0);
|
|
||||||
object.eventType.attach(store);
|
|
||||||
object.bolusProfile.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 22, 0);
|
|
||||||
object.bolusProfile.attach(store);
|
|
||||||
object.basalProfile.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 24, 0);
|
|
||||||
object.basalProfile.attach(store);
|
|
||||||
return object;
|
|
||||||
}),
|
|
||||||
LogEventType: EntityDefinition<LogEventType>(
|
|
||||||
model: _entities[6],
|
|
||||||
toOneRelations: (LogEventType object) =>
|
|
||||||
[object.bolusProfile, object.basalProfile],
|
|
||||||
toManyRelations: (LogEventType object) => {},
|
|
||||||
getId: (LogEventType object) => object.id,
|
|
||||||
setId: (LogEventType object, int id) {
|
|
||||||
object.id = id;
|
|
||||||
},
|
|
||||||
objectToFB: (LogBolus object, fb.Builder fbb) {
|
|
||||||
final notesOffset =
|
|
||||||
object.notes == null ? null : fbb.writeString(object.notes!);
|
|
||||||
fbb.startTable(9);
|
|
||||||
fbb.addInt64(0, object.id);
|
|
||||||
fbb.addOffset(1, valueOffset);
|
|
||||||
fbb.addBool(2, object.hasEndTime);
|
|
||||||
fbb.addInt64(3, object.defaultReminderDuration);
|
|
||||||
fbb.addOffset(4, notesOffset);
|
|
||||||
fbb.addBool(5, object.deleted);
|
|
||||||
fbb.addInt64(6, object.bolusProfile.targetId);
|
|
||||||
fbb.addInt64(7, object.basalProfile.targetId);
|
|
||||||
fbb.finish(fbb.endTable());
|
|
||||||
return object.id;
|
|
||||||
},
|
|
||||||
objectFromFB: (Store store, ByteData fbData) {
|
|
||||||
final buffer = fb.BufferContext(fbData);
|
|
||||||
final rootOffset = buffer.derefObject(0);
|
|
||||||
|
|
||||||
final object = LogBolus(
|
|
||||||
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
|
||||||
deleted: const fb.BoolReader()
|
|
||||||
.vTableGet(buffer, rootOffset, 14, false),
|
|
||||||
value: const fb.StringReader(asciiOptimization: true)
|
|
||||||
.vTableGet(buffer, rootOffset, 6, ''),
|
|
||||||
hasEndTime:
|
|
||||||
const fb.BoolReader().vTableGet(buffer, rootOffset, 8, false),
|
|
||||||
defaultReminderDuration: const fb.Int64Reader()
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 10),
|
|
||||||
notes: const fb.StringReader(asciiOptimization: true)
|
|
||||||
.vTableGetNullable(buffer, rootOffset, 12));
|
|
||||||
object.bolusProfile.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 16, 0);
|
|
||||||
object.bolusProfile.attach(store);
|
|
||||||
object.basalProfile.targetId =
|
|
||||||
const fb.Int64Reader().vTableGet(buffer, rootOffset, 18, 0);
|
|
||||||
object.basalProfile.attach(store);
|
|
||||||
return object;
|
|
||||||
}),
|
|
||||||
LogMeal: EntityDefinition<LogMeal>(
|
|
||||||
model: _entities[7],
|
|
||||||
toOneRelations: (LogMeal object) => [
|
|
||||||
object.logEntry,
|
|
||||||
object.meal,
|
|
||||||
object.mealSource,
|
|
||||||
object.mealCategory,
|
|
||||||
object.mealPortionType,
|
|
||||||
object.portionSizeAccuracy,
|
|
||||||
object.carbsRatioAccuracy
|
|
||||||
],
|
|
||||||
toManyRelations: (LogMeal object) => {},
|
|
||||||
getId: (LogMeal object) => object.id,
|
|
||||||
setId: (LogMeal object, int id) {
|
|
||||||
object.id = id;
|
|
||||||
},
|
|
||||||
objectToFB: (Accuracy object, fb.Builder fbb) {
|
|
||||||
final valueOffset = fbb.writeString(object.value);
|
|
||||||
final notesOffset =
|
|
||||||
object.notes == null ? null : fbb.writeString(object.notes!);
|
|
||||||
fbb.startTable(20);
|
|
||||||
fbb.addInt64(0, object.id);
|
|
||||||
fbb.addOffset(1, valueOffset);
|
|
||||||
fbb.addFloat64(2, object.carbsRatio);
|
|
||||||
fbb.addFloat64(3, object.portionSize);
|
|
||||||
fbb.addFloat64(5, object.bolus);
|
|
||||||
fbb.addOffset(8, notesOffset);
|
|
||||||
fbb.addInt64(9, object.logEntry.targetId);
|
|
||||||
fbb.addInt64(10, object.meal.targetId);
|
|
||||||
fbb.addInt64(11, object.mealSource.targetId);
|
|
||||||
fbb.addInt64(12, object.mealCategory.targetId);
|
|
||||||
fbb.addInt64(13, object.mealPortionType.targetId);
|
|
||||||
fbb.addInt64(14, object.portionSizeAccuracy.targetId);
|
|
||||||
fbb.addInt64(15, object.carbsRatioAccuracy.targetId);
|
|
||||||
fbb.addBool(16, object.deleted);
|
|
||||||
fbb.addFloat64(17, object.amount);
|
|
||||||
fbb.addFloat64(18, object.totalCarbs);
|
|
||||||
fbb.finish(fbb.endTable());
|
|
||||||
return object.id;
|
|
||||||
},
|
|
||||||
objectFromFB: (Store store, ByteData fbData) {
|
|
||||||
final buffer = fb.BufferContext(fbData);
|
|
||||||
final rootOffset = buffer.derefObject(0);
|
|
||||||
|
|
||||||
final object = Accuracy(
|
|
||||||
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
id: const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0),
|
||||||
deleted: const fb.BoolReader()
|
deleted: const fb.BoolReader()
|
||||||
.vTableGet(buffer, rootOffset, 36, false),
|
.vTableGet(buffer, rootOffset, 36, false),
|
||||||
|
12
pubspec.lock
12
pubspec.lock
@ -249,6 +249,11 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_web_plugins:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
frontend_server_client:
|
frontend_server_client:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -270,6 +275,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
|
http:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.13.4"
|
||||||
http_multi_server:
|
http_multi_server:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
Loading…
Reference in New Issue
Block a user