diff options
author | davidpkj <davidpenkow1@gmail.com> | 2023-03-05 13:05:25 +0100 |
---|---|---|
committer | davidpkj <davidpenkow1@gmail.com> | 2023-03-05 13:05:25 +0100 |
commit | 14e4496de4138c317791030215803e7d57ec85bc (patch) | |
tree | 0d165667f1026325a7688c0f40bae4be6d7115f2 /lib/models/recipe_class.dart | |
parent | 45e4c5426a9090407dc1d210361c22ca83d8aa65 (diff) |
Refactored according to flutter lint
Diffstat (limited to 'lib/models/recipe_class.dart')
-rw-r--r-- | lib/models/recipe_class.dart | 20 |
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++; } } } |