implemented get hashcode and cleanup

This commit is contained in:
SomnusVeritas committed 2023-11-05 15:01:24 +01:00
1 parent ebe2cb8970
commit 1580ec723a
3 files changed
+13 -3

No files matched your search

+5
View File
@@ -16,4 +16,9 @@ class Ingredient {
Ingredient i = other as Ingredient; Ingredient i = other as Ingredient;
return title == i.title; return title == i.title;
} }
@override
int get hashCode {
return Object.hash(title, null);
}
} }
+5
View File
@@ -14,4 +14,9 @@ class IngredientListEntry {
final i = other as IngredientListEntry; final i = other as IngredientListEntry;
return ingredient == i.ingredient; return ingredient == i.ingredient;
} }
@override
int get hashCode {
return Object.hash(ingredient, null);
}
} }
+3 -3
View File
@@ -24,10 +24,10 @@ class _IngredientsBottomsheetState extends State<IngredientsBottomsheet> {
Unit? selectedUnit; Unit? selectedUnit;
final List<DropdownMenuEntry<Unit>> unitEntries = []; final List<DropdownMenuEntry<Unit>> unitEntries = [];
TextEditingController _amountController = TextEditingController(); final TextEditingController _amountController = TextEditingController();
TextEditingController _ingredientController = TextEditingController(); final TextEditingController _ingredientController = TextEditingController();
bool _isOptional = false; bool _isOptional = false;
TextEditingController _unitController = TextEditingController(); final TextEditingController _unitController = TextEditingController();
@override @override
void initState() { void initState() {