feat:更新历史记录模块
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import 'package:fitnote/models/health.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_common/flutter_common.dart';
|
||||
|
||||
class HealthProvider with ChangeNotifier {
|
||||
late HealthRecord formItem;
|
||||
HealthRecord formItem = HealthRecord.getEmpty(DateTime.now());
|
||||
HealthRecord currentRecord = HealthRecord.getEmpty(DateTime.now());
|
||||
DateTime selectedDate = DateTime.now();
|
||||
DateTime focusedDate = DateTime.now();
|
||||
RecordType type = RecordType.weight;
|
||||
bool isEditing = false;
|
||||
|
||||
@@ -18,6 +17,16 @@ class HealthProvider with ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void updateRecord(HealthRecord record) {
|
||||
currentRecord = record;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void updateSelectDate(DateTime date) {
|
||||
selectedDate = date;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void updateWeight(num weight) {
|
||||
formItem.weight = weight;
|
||||
notifyListeners();
|
||||
|
||||
Reference in New Issue
Block a user