feat:更新目标模块

This commit is contained in:
2025-12-02 17:55:43 +08:00
parent 8a71ea542e
commit 86852cc47d
7 changed files with 207 additions and 64 deletions

View File

@@ -8,6 +8,10 @@ class HealthProvider with ChangeNotifier {
RecordType type = RecordType.weight;
bool isEditing = false;
num latestWeight = 0;
num totalSpot = 0;
num avgSleep = 0;
void initForm(HealthRecord record) {
formItem = record;
notifyListeners();
@@ -37,4 +41,19 @@ class HealthProvider with ChangeNotifier {
formItem.sleepEndTime = sleepEndTime;
notifyListeners();
}
void updateLatestWeight(num weight) {
latestWeight = weight;
notifyListeners();
}
void updateTotalSpot(num duration) {
totalSpot = duration;
notifyListeners();
}
void updateAvgSleep(num duration) {
avgSleep = duration;
notifyListeners();
}
}