feat:更新目标模块
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user