Skip to content

Commit 0bc5e8e

Browse files
author
Github-actions
committed
Automatic linting
1 parent 7887f7f commit 0bc5e8e

File tree

8 files changed

+104
-124
lines changed

8 files changed

+104
-124
lines changed

lib/providers/gallery.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ class GalleryProvider extends WgerBaseProvider with ChangeNotifier {
3131

3232
List<gallery.Image> images = [];
3333

34-
GalleryProvider(super.auth, List<gallery.Image> entries, [super.client])
35-
: images = entries;
34+
GalleryProvider(super.auth, List<gallery.Image> entries, [super.client]) : images = entries;
3635

3736
/// Clears all lists
3837
void clear() {

lib/widgets/add_exercise/preview_images.dart

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,39 @@ class PreviewExerciseImages extends StatelessWidget with ExerciseImagePickerMixi
1818
return SizedBox(
1919
height: 300,
2020
child: ListView(scrollDirection: Axis.horizontal, children: [
21-
...selectedImages
22-
.map(
23-
(file) => SizedBox(
24-
height: 200,
25-
child: Padding(
26-
padding: const EdgeInsets.all(8.0),
27-
child: Stack(
28-
children: [
29-
Image.file(file),
30-
Positioned(
31-
bottom: 0,
32-
right: 0,
33-
child: Padding(
34-
padding: const EdgeInsets.all(3.0),
35-
child: Container(
36-
decoration: BoxDecoration(
37-
color: Colors.grey.withOpacity(0.5),
38-
borderRadius: const BorderRadius.all(Radius.circular(20)),
39-
),
40-
child: IconButton(
41-
iconSize: 20,
42-
onPressed: () =>
43-
context.read<AddExerciseProvider>().removeExercise(file.path),
44-
color: Colors.white,
45-
icon: const Icon(Icons.delete),
46-
),
47-
),
21+
...selectedImages.map(
22+
(file) => SizedBox(
23+
height: 200,
24+
child: Padding(
25+
padding: const EdgeInsets.all(8.0),
26+
child: Stack(
27+
children: [
28+
Image.file(file),
29+
Positioned(
30+
bottom: 0,
31+
right: 0,
32+
child: Padding(
33+
padding: const EdgeInsets.all(3.0),
34+
child: Container(
35+
decoration: BoxDecoration(
36+
color: Colors.grey.withOpacity(0.5),
37+
borderRadius: const BorderRadius.all(Radius.circular(20)),
38+
),
39+
child: IconButton(
40+
iconSize: 20,
41+
onPressed: () =>
42+
context.read<AddExerciseProvider>().removeExercise(file.path),
43+
color: Colors.white,
44+
icon: const Icon(Icons.delete),
4845
),
4946
),
50-
],
47+
),
5148
),
52-
),
49+
],
5350
),
54-
)
55-
,
51+
),
52+
),
53+
),
5654
const SizedBox(
5755
width: 10,
5856
),

lib/widgets/add_exercise/steps/step2variations.dart

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -28,44 +28,37 @@ class Step2Variations extends StatelessWidget {
2828
child: Column(
2929
children: [
3030
// Exercise bases with variations
31-
...exerciseProvider.exerciseBasesByVariation.keys
32-
.map(
33-
(key) => Row(
34-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
35-
children: [
36-
Flexible(
37-
child: Column(
38-
crossAxisAlignment: CrossAxisAlignment.start,
39-
//mainAxisSize: MainAxisSize.max,
40-
children: [
41-
...exerciseProvider.exerciseBasesByVariation[key]!
42-
.map(
43-
(base) => Text(
44-
base
45-
.getExercise(
46-
Localizations.localeOf(context).languageCode)
47-
.name,
48-
overflow: TextOverflow.ellipsis,
49-
),
50-
)
51-
,
52-
const SizedBox(height: 20),
53-
],
31+
...exerciseProvider.exerciseBasesByVariation.keys.map(
32+
(key) => Row(
33+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
34+
children: [
35+
Flexible(
36+
child: Column(
37+
crossAxisAlignment: CrossAxisAlignment.start,
38+
//mainAxisSize: MainAxisSize.max,
39+
children: [
40+
...exerciseProvider.exerciseBasesByVariation[key]!.map(
41+
(base) => Text(
42+
base
43+
.getExercise(Localizations.localeOf(context).languageCode)
44+
.name,
45+
overflow: TextOverflow.ellipsis,
46+
),
5447
),
55-
),
56-
Consumer<AddExerciseProvider>(
57-
builder: (ctx, provider, __) => Switch(
58-
value: provider.variationId == key,
59-
onChanged: (state) => provider.variationId = key),
60-
),
61-
],
48+
const SizedBox(height: 20),
49+
],
50+
),
51+
),
52+
Consumer<AddExerciseProvider>(
53+
builder: (ctx, provider, __) => Switch(
54+
value: provider.variationId == key,
55+
onChanged: (state) => provider.variationId = key),
6256
),
63-
)
64-
,
57+
],
58+
),
59+
),
6560
// Exercise bases without variations
66-
...exerciseProvider.bases
67-
.where((b) => b.variationId == null)
68-
.map(
61+
...exerciseProvider.bases.where((b) => b.variationId == null).map(
6962
(base) => Row(
7063
mainAxisAlignment: MainAxisAlignment.spaceBetween,
7164
children: [
@@ -92,8 +85,7 @@ class Step2Variations extends StatelessWidget {
9285
),
9386
],
9487
),
95-
)
96-
,
88+
),
9789
],
9890
),
9991
),

lib/widgets/dashboard/calendar.dart

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -250,27 +250,25 @@ class _DashboardCalendarWidgetState extends State<DashboardCalendarWidget>
250250
valueListenable: _selectedEvents,
251251
builder: (context, value, _) => Column(
252252
children: [
253-
...value
254-
.map((event) => ListTile(
255-
title: Text((() {
256-
switch (event.type) {
257-
case EventType.caloriesDiary:
258-
return AppLocalizations.of(context).nutritionalDiary;
259-
260-
case EventType.session:
261-
return AppLocalizations.of(context).workoutSession;
262-
263-
case EventType.weight:
264-
return AppLocalizations.of(context).weight;
265-
266-
case EventType.measurement:
267-
return AppLocalizations.of(context).measurement;
268-
}
269-
})()),
270-
subtitle: Text(event.description),
271-
//onTap: () => print('$event tapped!'),
272-
))
273-
253+
...value.map((event) => ListTile(
254+
title: Text((() {
255+
switch (event.type) {
256+
case EventType.caloriesDiary:
257+
return AppLocalizations.of(context).nutritionalDiary;
258+
259+
case EventType.session:
260+
return AppLocalizations.of(context).workoutSession;
261+
262+
case EventType.weight:
263+
return AppLocalizations.of(context).weight;
264+
265+
case EventType.measurement:
266+
return AppLocalizations.of(context).measurement;
267+
}
268+
})()),
269+
subtitle: Text(event.description),
270+
//onTap: () => print('$event tapped!'),
271+
))
274272
],
275273
),
276274
),

lib/widgets/exercises/exercises.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,9 @@ class MuscleWidget extends StatelessWidget {
341341
return Stack(
342342
children: [
343343
SvgPicture.asset('assets/images/muscles/$background.svg'),
344-
...muscles
345-
.map((m) => SvgPicture.asset('assets/images/muscles/main/muscle-${m.id}.svg'))
346-
,
344+
...muscles.map((m) => SvgPicture.asset('assets/images/muscles/main/muscle-${m.id}.svg')),
347345
...musclesSecondary
348-
.map((m) => SvgPicture.asset('assets/images/muscles/secondary/muscle-${m.id}.svg'))
349-
,
346+
.map((m) => SvgPicture.asset('assets/images/muscles/secondary/muscle-${m.id}.svg')),
350347
],
351348
);
352349
}

lib/widgets/nutrition/charts.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class NutritionalDiaryChartWidgetFl extends StatefulWidget {
158158
const NutritionalDiaryChartWidgetFl({
159159
super.key,
160160
required NutritionalPlan nutritionalPlan,
161-
}) : _nutritionalPlan = nutritionalPlan;
161+
}) : _nutritionalPlan = nutritionalPlan;
162162

163163
final NutritionalPlan _nutritionalPlan;
164164

@@ -397,7 +397,7 @@ class FlNutritionalDiaryChartWidget extends StatefulWidget {
397397
const FlNutritionalDiaryChartWidget({
398398
super.key,
399399
required NutritionalPlan nutritionalPlan,
400-
}) : _nutritionalPlan = nutritionalPlan;
400+
}) : _nutritionalPlan = nutritionalPlan;
401401

402402
final Color barColor = Colors.red;
403403
final Color touchedBarColor = Colors.deepOrange;

lib/widgets/workouts/day.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,14 @@ class _WorkoutDayWidgetState extends State<WorkoutDayWidget> {
131131
child: Column(
132132
children: [
133133
if (set.comment != '') MutedText(set.comment),
134-
...set.settingsFiltered
135-
.map(
136-
(setting) => SettingWidget(
137-
set: set,
138-
setting: setting,
139-
expanded: _expanded,
140-
toggle: _toggleExpanded,
141-
),
142-
)
143-
,
134+
...set.settingsFiltered.map(
135+
(setting) => SettingWidget(
136+
set: set,
137+
setting: setting,
138+
expanded: _expanded,
139+
toggle: _toggleExpanded,
140+
),
141+
),
144142
const Divider(),
145143
],
146144
),

lib/widgets/workouts/log.dart

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -124,23 +124,21 @@ class _DayLogWidgetState extends State<DayLogWidget> {
124124
)
125125
else
126126
Container(),
127-
...widget._exerciseData[base]!
128-
.map(
129-
(log) => Row(
130-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
131-
children: [
132-
Text(log.singleLogRepTextNoNl),
133-
IconButton(
134-
icon: const Icon(Icons.delete),
135-
onPressed: () async {
136-
showDeleteDialog(
137-
context, exercise.name, log, exercise, widget._exerciseData);
138-
},
139-
),
140-
],
127+
...widget._exerciseData[base]!.map(
128+
(log) => Row(
129+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
130+
children: [
131+
Text(log.singleLogRepTextNoNl),
132+
IconButton(
133+
icon: const Icon(Icons.delete),
134+
onPressed: () async {
135+
showDeleteDialog(
136+
context, exercise.name, log, exercise, widget._exerciseData);
137+
},
141138
),
142-
)
143-
,
139+
],
140+
),
141+
),
144142
Padding(
145143
padding: const EdgeInsets.symmetric(horizontal: 15),
146144
child: ExerciseLogChart(base, widget._date),

0 commit comments

Comments
 (0)