aboutsummaryrefslogtreecommitdiff
path: root/lib/models/recipe_class.dart
diff options
context:
space:
mode:
Diffstat (limited to 'lib/models/recipe_class.dart')
-rw-r--r--lib/models/recipe_class.dart20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/models/recipe_class.dart b/lib/models/recipe_class.dart
index e02ed87..7143547 100644
--- a/lib/models/recipe_class.dart
+++ b/lib/models/recipe_class.dart
@@ -20,7 +20,7 @@ class Recipe {
List<Recipe> _list = remote ? RecipeData.remoteRecipeList : RecipeData.recipeList;
for (Recipe recipe in _list) {
- if (this.title == recipe.title && this.image == recipe.image && this.description == recipe.description) {
+ if (title == recipe.title && image == recipe.image && description == recipe.description) {
return true;
}
}
@@ -29,24 +29,24 @@ class Recipe {
}
bool isDefault() {
- if (this.title != null) return false;
- if (this.image != null) return false;
- if (this.description != null) return false;
- if (this.favorite != false) return false;
- if (this.rating != 0) return false;
+ if (title != null) return false;
+ if (image != null) return false;
+ if (description != null) return false;
+ if (favorite != false) return false;
+ if (rating != 0) return false;
return true;
}
void toggleFavorite() {
- this.favorite = !this.favorite;
+ favorite = !favorite;
}
void updateRating() {
- if (this.rating == 5) {
- this.rating = 0;
+ if (rating == 5) {
+ rating = 0;
} else {
- this.rating++;
+ rating++;
}
}
}