refactoring

This commit is contained in:
SomnusVeritas
2023-11-13 18:51:25 +01:00
parent 64e983bc59
commit 8835c83081
6 changed files with 42 additions and 13 deletions

View File

@@ -169,7 +169,8 @@ class _IngredientsBottomsheetState extends State<IngredientsBottomsheet> {
}
bool _submit() {
final ingredient = Ingredient(title: _ingredientController.text);
final ingredient = Ingredient(
title: _ingredientController.text, type: IngredientType.other);
final unit = selectedUnit;
final amount = int.tryParse(_amountController.text);
if (ingredient.title.isEmpty || unit == null || amount == null) {