mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Consts and finals where possible
This commit is contained in:
@@ -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<NavigatorState>();
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ class GalleryProvider extends WgerBaseProvider with ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<void> 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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -394,7 +394,7 @@ class _DashboardMeasurementWidgetState extends State<DashboardMeasurementWidget>
|
||||
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
|
||||
|
||||
@@ -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<FilterRow> {
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem<ExerciseMoreOption>(
|
||||
child: Text(AppLocalizations.of(context).contributeExercise),
|
||||
value: ExerciseMoreOption.ADD_EXERCISE,
|
||||
child: Text(AppLocalizations.of(context).contributeExercise),
|
||||
)
|
||||
];
|
||||
},
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user