From 14e4496de4138c317791030215803e7d57ec85bc Mon Sep 17 00:00:00 2001 From: davidpkj Date: Sun, 5 Mar 2023 13:05:25 +0100 Subject: Refactored according to flutter lint --- lib/models/recipe_class.dart | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lib/models/recipe_class.dart') 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 _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++; } } } -- cgit v1.2.3