fix:修复首次编辑会清空数值的问题

This commit is contained in:
2025-12-10 09:26:41 +08:00
parent 190963f079
commit 2b334edf2f
2 changed files with 3 additions and 5 deletions

View File

@@ -29,7 +29,9 @@ class _GoalProgressState extends State<GoalProgress> {
provider.avgSleep = service.getAvgSleep();
provider.latestWeight = service.getLatestWeight();
provider.updateRecord(service.getRecordByDate(provider.selectedDate));
HealthRecord record = service.getRecordByDate(provider.selectedDate);
provider.updateRecord(record);
provider.initForm(record);
});
}

View File

@@ -35,10 +35,6 @@ class _RecordFormState extends State<RecordForm> {
);
}
Widget _buildFiledTitle(String title) {
return Text(title, style: TextStyle(fontSize: 16));
}
Widget _buildSleepDuration(HealthRecord record) {
final startTime = record.sleepStartTime;
final endTime = record.sleepEndTime;