diff --git a/integration_test/5_nutritional_plan.dart b/integration_test/5_nutritional_plan.dart index 78a2993ff..d45a6def9 100644 --- a/integration_test/5_nutritional_plan.dart +++ b/integration_test/5_nutritional_plan.dart @@ -14,7 +14,7 @@ import 'package:wger/theme/theme.dart'; import '../test/user/provider_test.mocks.dart'; Widget createNutritionalPlanScreen({locale = 'en'}) { - var mockBaseProvider = MockWgerBaseProvider(); + final mockBaseProvider = MockWgerBaseProvider(); final key = GlobalKey(); diff --git a/lib/providers/gallery.dart b/lib/providers/gallery.dart index f4ad1f4ba..ce1980b4e 100644 --- a/lib/providers/gallery.dart +++ b/lib/providers/gallery.dart @@ -103,7 +103,7 @@ class GalleryProvider extends WgerBaseProvider with ChangeNotifier { } Future deleteImage(gallery.Image image) async { - var response = await deleteRequest(_galleryUrlPath, image.id!); + final response = await deleteRequest(_galleryUrlPath, image.id!); images.removeWhere((element) => element.id == image.id); notifyListeners(); diff --git a/lib/widgets/core/app_bar.dart b/lib/widgets/core/app_bar.dart index 8f618cd33..06f1c7466 100644 --- a/lib/widgets/core/app_bar.dart +++ b/lib/widgets/core/app_bar.dart @@ -32,7 +32,7 @@ import 'package:wger/widgets/user/forms.dart'; class MainAppBar extends StatelessWidget implements PreferredSizeWidget { final String _title; - MainAppBar(this._title); + const MainAppBar(this._title); @override Widget build(BuildContext context) { @@ -116,7 +116,7 @@ class MainAppBar extends StatelessWidget implements PreferredSizeWidget { class EmptyAppBar extends StatelessWidget implements PreferredSizeWidget { final String _title; - EmptyAppBar(this._title); + const EmptyAppBar(this._title); @override Widget build(BuildContext context) { diff --git a/lib/widgets/core/text_prompt.dart b/lib/widgets/core/text_prompt.dart index c2b14e775..83dbc0f3a 100644 --- a/lib/widgets/core/text_prompt.dart +++ b/lib/widgets/core/text_prompt.dart @@ -13,7 +13,7 @@ class TextPrompt extends StatelessWidget { style: Theme.of(context).textTheme.headlineMedium, ), Padding( - padding: EdgeInsets.only(top: 12), + padding: const EdgeInsets.only(top: 12), child: Text(AppLocalizations.of(context).textPromptSubheading), ), ], diff --git a/lib/widgets/dashboard/widgets.dart b/lib/widgets/dashboard/widgets.dart index 893cc2d2a..be6f74cea 100644 --- a/lib/widgets/dashboard/widgets.dart +++ b/lib/widgets/dashboard/widgets.dart @@ -394,7 +394,7 @@ class _DashboardMeasurementWidgetState extends State child: Container( width: 12.0, height: 12.0, - margin: EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0), + margin: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0), decoration: BoxDecoration( shape: BoxShape.circle, color: (Theme.of(context).brightness == Brightness.dark diff --git a/lib/widgets/exercises/filter_row.dart b/lib/widgets/exercises/filter_row.dart index 8fb4c5eae..d7510dd1b 100644 --- a/lib/widgets/exercises/filter_row.dart +++ b/lib/widgets/exercises/filter_row.dart @@ -25,7 +25,7 @@ import 'package:wger/screens/add_exercise_screen.dart'; import 'filter_modal.dart'; class FilterRow extends StatefulWidget { - FilterRow({Key? key}) : super(key: key); + const FilterRow({Key? key}) : super(key: key); @override _FilterRowState createState() => _FilterRowState(); @@ -89,8 +89,8 @@ class _FilterRowState extends State { itemBuilder: (context) { return [ PopupMenuItem( - child: Text(AppLocalizations.of(context).contributeExercise), value: ExerciseMoreOption.ADD_EXERCISE, + child: Text(AppLocalizations.of(context).contributeExercise), ) ]; }, diff --git a/lib/widgets/measurements/categories_card.dart b/lib/widgets/measurements/categories_card.dart index 772a02dd9..e42dd068f 100644 --- a/lib/widgets/measurements/categories_card.dart +++ b/lib/widgets/measurements/categories_card.dart @@ -1,17 +1,17 @@ import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import '../../models/measurements/measurement_category.dart'; import '../../screens/form_screen.dart'; import '../../screens/measurement_entries_screen.dart'; import '../core/charts.dart'; import 'forms.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; class CategoriesCard extends StatelessWidget { - MeasurementCategory currentCategory; - double? elevation; + final MeasurementCategory currentCategory; + final double? elevation; - CategoriesCard(this.currentCategory, {this.elevation}); + const CategoriesCard(this.currentCategory, {this.elevation}); @override Widget build(BuildContext context) {