Small fix
This commit is contained in:
@@ -73,7 +73,7 @@ class HiveService {
|
||||
final tagBox = tags;
|
||||
if (tagBox.isEmpty) {
|
||||
_logger.i('Filling initial tags');
|
||||
await tagBox.addAll(TagUtils.getDefaultTags());
|
||||
await tagBox.addAll(TagUtils.getDefaultTags(_defaultUserId));
|
||||
await tagBox.flush();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,17 +16,23 @@ class TagAdapter extends TypeAdapter<Tag> {
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return Tag(id: fields[0] as String?, name: fields[1] as String);
|
||||
return Tag(
|
||||
id: fields[0] as String?,
|
||||
name: fields[1] as String,
|
||||
userId: fields[2] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, Tag obj) {
|
||||
writer
|
||||
..writeByte(2)
|
||||
..writeByte(3)
|
||||
..writeByte(0)
|
||||
..write(obj.id)
|
||||
..writeByte(1)
|
||||
..write(obj.name);
|
||||
..write(obj.name)
|
||||
..writeByte(2)
|
||||
..write(obj.userId);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -24,13 +24,14 @@ class TransactionRecordAdapter extends TypeAdapter<TransactionRecord> {
|
||||
dateTime: fields[4] as DateTime,
|
||||
vendor: fields[5] as String,
|
||||
currency: fields[6] as String,
|
||||
userId: fields[7] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, TransactionRecord obj) {
|
||||
writer
|
||||
..writeByte(7)
|
||||
..writeByte(8)
|
||||
..writeByte(0)
|
||||
..write(obj.id)
|
||||
..writeByte(1)
|
||||
@@ -44,7 +45,9 @@ class TransactionRecordAdapter extends TypeAdapter<TransactionRecord> {
|
||||
..writeByte(5)
|
||||
..write(obj.vendor)
|
||||
..writeByte(6)
|
||||
..write(obj.currency);
|
||||
..write(obj.currency)
|
||||
..writeByte(7)
|
||||
..write(obj.userId);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user