feat:更新历史记录模块

This commit is contained in:
2025-12-02 20:00:34 +08:00
parent 62108248aa
commit b3bb3378c3
6 changed files with 50 additions and 66 deletions

View File

@@ -17,22 +17,21 @@ class HealthRecordAdapter extends TypeAdapter<HealthRecord> {
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return HealthRecord(
id: fields[0] as int,
sportProject: fields[1] as String,
sportDuration: fields[2] as num,
weight: fields[3] as num,
sleepStartTime: fields[4] as String,
sleepEndTime: fields[5] as String,
date: fields[7] as String,
date: fields[0] as String,
);
}
@override
void write(BinaryWriter writer, HealthRecord obj) {
writer
..writeByte(7)
..writeByte(6)
..writeByte(0)
..write(obj.id)
..write(obj.date)
..writeByte(1)
..write(obj.sportProject)
..writeByte(2)
@@ -42,9 +41,7 @@ class HealthRecordAdapter extends TypeAdapter<HealthRecord> {
..writeByte(4)
..write(obj.sleepStartTime)
..writeByte(5)
..write(obj.sleepEndTime)
..writeByte(7)
..write(obj.date);
..write(obj.sleepEndTime);
}
@override