mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Automatic linting
This commit is contained in:
@@ -31,8 +31,7 @@ class GalleryProvider extends WgerBaseProvider with ChangeNotifier {
|
||||
|
||||
List<gallery.Image> images = [];
|
||||
|
||||
GalleryProvider(super.auth, List<gallery.Image> entries, [super.client])
|
||||
: images = entries;
|
||||
GalleryProvider(super.auth, List<gallery.Image> entries, [super.client]) : images = entries;
|
||||
|
||||
/// Clears all lists
|
||||
void clear() {
|
||||
|
||||
@@ -18,41 +18,39 @@ class PreviewExerciseImages extends StatelessWidget with ExerciseImagePickerMixi
|
||||
return SizedBox(
|
||||
height: 300,
|
||||
child: ListView(scrollDirection: Axis.horizontal, children: [
|
||||
...selectedImages
|
||||
.map(
|
||||
(file) => SizedBox(
|
||||
height: 200,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Stack(
|
||||
children: [
|
||||
Image.file(file),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(3.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey.withOpacity(0.5),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||
),
|
||||
child: IconButton(
|
||||
iconSize: 20,
|
||||
onPressed: () =>
|
||||
context.read<AddExerciseProvider>().removeExercise(file.path),
|
||||
color: Colors.white,
|
||||
icon: const Icon(Icons.delete),
|
||||
),
|
||||
),
|
||||
...selectedImages.map(
|
||||
(file) => SizedBox(
|
||||
height: 200,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Stack(
|
||||
children: [
|
||||
Image.file(file),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(3.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey.withOpacity(0.5),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||
),
|
||||
child: IconButton(
|
||||
iconSize: 20,
|
||||
onPressed: () =>
|
||||
context.read<AddExerciseProvider>().removeExercise(file.path),
|
||||
color: Colors.white,
|
||||
icon: const Icon(Icons.delete),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
|
||||
@@ -28,44 +28,37 @@ class Step2Variations extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
// Exercise bases with variations
|
||||
...exerciseProvider.exerciseBasesByVariation.keys
|
||||
.map(
|
||||
(key) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
//mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
...exerciseProvider.exerciseBasesByVariation[key]!
|
||||
.map(
|
||||
(base) => Text(
|
||||
base
|
||||
.getExercise(
|
||||
Localizations.localeOf(context).languageCode)
|
||||
.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
)
|
||||
,
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
...exerciseProvider.exerciseBasesByVariation.keys.map(
|
||||
(key) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
//mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
...exerciseProvider.exerciseBasesByVariation[key]!.map(
|
||||
(base) => Text(
|
||||
base
|
||||
.getExercise(Localizations.localeOf(context).languageCode)
|
||||
.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
Consumer<AddExerciseProvider>(
|
||||
builder: (ctx, provider, __) => Switch(
|
||||
value: provider.variationId == key,
|
||||
onChanged: (state) => provider.variationId = key),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
,
|
||||
Consumer<AddExerciseProvider>(
|
||||
builder: (ctx, provider, __) => Switch(
|
||||
value: provider.variationId == key,
|
||||
onChanged: (state) => provider.variationId = key),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Exercise bases without variations
|
||||
...exerciseProvider.bases
|
||||
.where((b) => b.variationId == null)
|
||||
.map(
|
||||
...exerciseProvider.bases.where((b) => b.variationId == null).map(
|
||||
(base) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@@ -92,8 +85,7 @@ class Step2Variations extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -250,27 +250,25 @@ class _DashboardCalendarWidgetState extends State<DashboardCalendarWidget>
|
||||
valueListenable: _selectedEvents,
|
||||
builder: (context, value, _) => Column(
|
||||
children: [
|
||||
...value
|
||||
.map((event) => ListTile(
|
||||
title: Text((() {
|
||||
switch (event.type) {
|
||||
case EventType.caloriesDiary:
|
||||
return AppLocalizations.of(context).nutritionalDiary;
|
||||
...value.map((event) => ListTile(
|
||||
title: Text((() {
|
||||
switch (event.type) {
|
||||
case EventType.caloriesDiary:
|
||||
return AppLocalizations.of(context).nutritionalDiary;
|
||||
|
||||
case EventType.session:
|
||||
return AppLocalizations.of(context).workoutSession;
|
||||
case EventType.session:
|
||||
return AppLocalizations.of(context).workoutSession;
|
||||
|
||||
case EventType.weight:
|
||||
return AppLocalizations.of(context).weight;
|
||||
case EventType.weight:
|
||||
return AppLocalizations.of(context).weight;
|
||||
|
||||
case EventType.measurement:
|
||||
return AppLocalizations.of(context).measurement;
|
||||
}
|
||||
})()),
|
||||
subtitle: Text(event.description),
|
||||
//onTap: () => print('$event tapped!'),
|
||||
))
|
||||
|
||||
case EventType.measurement:
|
||||
return AppLocalizations.of(context).measurement;
|
||||
}
|
||||
})()),
|
||||
subtitle: Text(event.description),
|
||||
//onTap: () => print('$event tapped!'),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -341,12 +341,9 @@ class MuscleWidget extends StatelessWidget {
|
||||
return Stack(
|
||||
children: [
|
||||
SvgPicture.asset('assets/images/muscles/$background.svg'),
|
||||
...muscles
|
||||
.map((m) => SvgPicture.asset('assets/images/muscles/main/muscle-${m.id}.svg'))
|
||||
,
|
||||
...muscles.map((m) => SvgPicture.asset('assets/images/muscles/main/muscle-${m.id}.svg')),
|
||||
...musclesSecondary
|
||||
.map((m) => SvgPicture.asset('assets/images/muscles/secondary/muscle-${m.id}.svg'))
|
||||
,
|
||||
.map((m) => SvgPicture.asset('assets/images/muscles/secondary/muscle-${m.id}.svg')),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ class NutritionalDiaryChartWidgetFl extends StatefulWidget {
|
||||
const NutritionalDiaryChartWidgetFl({
|
||||
super.key,
|
||||
required NutritionalPlan nutritionalPlan,
|
||||
}) : _nutritionalPlan = nutritionalPlan;
|
||||
}) : _nutritionalPlan = nutritionalPlan;
|
||||
|
||||
final NutritionalPlan _nutritionalPlan;
|
||||
|
||||
@@ -397,7 +397,7 @@ class FlNutritionalDiaryChartWidget extends StatefulWidget {
|
||||
const FlNutritionalDiaryChartWidget({
|
||||
super.key,
|
||||
required NutritionalPlan nutritionalPlan,
|
||||
}) : _nutritionalPlan = nutritionalPlan;
|
||||
}) : _nutritionalPlan = nutritionalPlan;
|
||||
|
||||
final Color barColor = Colors.red;
|
||||
final Color touchedBarColor = Colors.deepOrange;
|
||||
|
||||
@@ -131,16 +131,14 @@ class _WorkoutDayWidgetState extends State<WorkoutDayWidget> {
|
||||
child: Column(
|
||||
children: [
|
||||
if (set.comment != '') MutedText(set.comment),
|
||||
...set.settingsFiltered
|
||||
.map(
|
||||
(setting) => SettingWidget(
|
||||
set: set,
|
||||
setting: setting,
|
||||
expanded: _expanded,
|
||||
toggle: _toggleExpanded,
|
||||
),
|
||||
)
|
||||
,
|
||||
...set.settingsFiltered.map(
|
||||
(setting) => SettingWidget(
|
||||
set: set,
|
||||
setting: setting,
|
||||
expanded: _expanded,
|
||||
toggle: _toggleExpanded,
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -124,23 +124,21 @@ class _DayLogWidgetState extends State<DayLogWidget> {
|
||||
)
|
||||
else
|
||||
Container(),
|
||||
...widget._exerciseData[base]!
|
||||
.map(
|
||||
(log) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(log.singleLogRepTextNoNl),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete),
|
||||
onPressed: () async {
|
||||
showDeleteDialog(
|
||||
context, exercise.name, log, exercise, widget._exerciseData);
|
||||
},
|
||||
),
|
||||
],
|
||||
...widget._exerciseData[base]!.map(
|
||||
(log) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(log.singleLogRepTextNoNl),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete),
|
||||
onPressed: () async {
|
||||
showDeleteDialog(
|
||||
context, exercise.name, log, exercise, widget._exerciseData);
|
||||
},
|
||||
),
|
||||
)
|
||||
,
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||
child: ExerciseLogChart(base, widget._date),
|
||||
|
||||
Reference in New Issue
Block a user