aboutsummaryrefslogtreecommitdiff
path: root/lib/widgets/recipe_card_widget.dart
diff options
context:
space:
mode:
authordavidpkj <davidpenkow1@gmail.com>2023-03-05 13:05:25 +0100
committerdavidpkj <davidpenkow1@gmail.com>2023-03-05 13:05:25 +0100
commit14e4496de4138c317791030215803e7d57ec85bc (patch)
tree0d165667f1026325a7688c0f40bae4be6d7115f2 /lib/widgets/recipe_card_widget.dart
parent45e4c5426a9090407dc1d210361c22ca83d8aa65 (diff)
Refactored according to flutter lint
Diffstat (limited to 'lib/widgets/recipe_card_widget.dart')
-rw-r--r--lib/widgets/recipe_card_widget.dart16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/widgets/recipe_card_widget.dart b/lib/widgets/recipe_card_widget.dart
index 4828b9a..a3db5f7 100644
--- a/lib/widgets/recipe_card_widget.dart
+++ b/lib/widgets/recipe_card_widget.dart
@@ -19,10 +19,10 @@ class RecipeCard extends StatefulWidget {
final Function? showToastCallback;
@override
- _RecipeCardState createState() => _RecipeCardState();
+ RecipeCardState createState() => RecipeCardState();
}
-class _RecipeCardState extends State<RecipeCard> {
+class RecipeCardState extends State<RecipeCard> {
@override
void dispose() {
super.dispose();
@@ -68,7 +68,7 @@ class _RecipeCardState extends State<RecipeCard> {
widget.redrawCallback!();
} catch (e) {
- print(e);
+ debugPrint("$e");
}
}
@@ -97,7 +97,7 @@ class _RecipeCardState extends State<RecipeCard> {
}
class _RecipeInfo extends StatefulWidget {
- _RecipeInfo({Key? key, required this.recipe}) : super(key: key);
+ const _RecipeInfo({Key? key, required this.recipe}) : super(key: key);
final Recipe recipe;
@@ -112,7 +112,7 @@ class _RecipeInfoState extends State<_RecipeInfo> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_buildRecipeInfo(),
- _buildFavortiteIcon(),
+ _buildFavoriteIcon(),
],
);
}
@@ -123,7 +123,7 @@ class _RecipeInfoState extends State<_RecipeInfo> {
if (rating == 0) return _result;
for (int i = 0; i < 5; i++) {
- _result.add(rating >= 1 ? Icon(Icons.star_rounded) : Icon(Icons.star_border_rounded));
+ _result.add(rating >= 1 ? const Icon(Icons.star_rounded) : const Icon(Icons.star_border_rounded));
rating--;
}
@@ -163,9 +163,9 @@ class _RecipeInfoState extends State<_RecipeInfo> {
);
}
- Widget _buildFavortiteIcon() {
+ Widget _buildFavoriteIcon() {
return IconButton(
- icon: widget.recipe.favorite ? Icon(Icons.favorite_rounded, color: Colors.red) : Icon(Icons.favorite_border_rounded),
+ icon: widget.recipe.favorite ? const Icon(Icons.favorite_rounded, color: Colors.red) : const Icon(Icons.favorite_border_rounded),
onPressed: () {
widget.recipe.toggleFavorite();
RecipeData.save();