feat:更新菜谱表单
This commit is contained in:
@@ -13,6 +13,7 @@ import 'package:food_hub_app/views/record.dart';
|
||||
class FoodProvider with ChangeNotifier {
|
||||
late RecordTab currentRecordTab = RecordTab.recipe;
|
||||
late FoodRecord recordFormItem;
|
||||
late Recipe recipeFormItem;
|
||||
late Moment momentFormItem;
|
||||
|
||||
late bool isEditing;
|
||||
@@ -55,6 +56,16 @@ class FoodProvider with ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void resetRecipeForm() {
|
||||
recipeFormItem = Recipe.getEmpty();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void initRecipeForm(Recipe recipe) {
|
||||
recipeFormItem = recipe;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void updateRecordFormItem({String? name, String? date, String? imageUrl}) {
|
||||
if (name != null) recordFormItem.name = name;
|
||||
if (date != null) recordFormItem.date = date;
|
||||
|
||||
Reference in New Issue
Block a user