diff --git a/.github/actions/flutter-common/action.yml b/.github/actions/flutter-common/action.yml
index f3e4a73f..cfeeac9b 100644
--- a/.github/actions/flutter-common/action.yml
+++ b/.github/actions/flutter-common/action.yml
@@ -9,7 +9,7 @@ runs:
uses: subosito/flutter-action@v2
with:
channel: stable
- flutter-version: 3.35.2
+ flutter-version: 3.35.5
cache: true
- name: Install Flutter dependencies
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb
index 163674e2..2b62b5a3 100644
--- a/lib/l10n/app_en.arb
+++ b/lib/l10n/app_en.arb
@@ -155,8 +155,18 @@
"@category": {
"description": "Category for an exercise, ingredient, etc."
},
- "endDate": "End date",
"startDate": "Start date",
+ "@startDate": {
+ "description": "The start date of a nutritional plan or routine"
+ },
+ "dayTypeCustom": "Custom",
+ "dayTypeEnom": "Every minute on the minute",
+ "dayTypeAmrap": "As many rounds as possible",
+ "dayTypeHiit": "High intensity interval training",
+ "dayTypeTabata": "Tabata",
+ "dayTypeEdt": "Escalating density training",
+ "dayTypeRft": "Rounds for time",
+ "dayTypeAfap": "As fast as possible",
"routines": "Routines",
"newRoutine": "New routine",
"noRoutines": "You have no routines",
@@ -387,13 +397,9 @@
"@date": {
"description": "The date of a workout log or body weight entry"
},
- "creationDate": "Start date",
- "@creationDate": {
- "description": "The Start date of a nutritional plan"
- },
"endDate": "End date",
"@endDate": {
- "description": "The End date of a nutritional plan"
+ "description": "The End date of a nutritional plan or routine"
},
"openEnded": "Open ended",
"@openEnded": {
diff --git a/lib/models/workouts/day.dart b/lib/models/workouts/day.dart
index 1126267f..ed7c1cae 100644
--- a/lib/models/workouts/day.dart
+++ b/lib/models/workouts/day.dart
@@ -16,11 +16,40 @@
* along with this program. If not, see .
*/
+import 'package:flutter/widgets.dart';
import 'package:json_annotation/json_annotation.dart';
+import 'package:wger/l10n/generated/app_localizations.dart';
import 'package:wger/models/workouts/slot.dart';
part 'day.g.dart';
+enum DayType { custom, enom, amrap, hiit, tabata, edt, rft, afap }
+
+extension DayTypeExtension on DayType {
+ String i18Label(BuildContext context) {
+ final i18n = AppLocalizations.of(context);
+
+ switch (this) {
+ case DayType.custom:
+ return i18n.dayTypeCustom;
+ case DayType.enom:
+ return i18n.dayTypeEnom;
+ case DayType.amrap:
+ return i18n.dayTypeAmrap;
+ case DayType.hiit:
+ return i18n.dayTypeHiit;
+ case DayType.tabata:
+ return i18n.dayTypeTabata;
+ case DayType.edt:
+ return i18n.dayTypeEdt;
+ case DayType.rft:
+ return i18n.dayTypeRft;
+ case DayType.afap:
+ return i18n.dayTypeAfap;
+ }
+ }
+}
+
@JsonSerializable()
class Day {
static const MIN_LENGTH_NAME = 3;
@@ -39,48 +68,65 @@ class Day {
@JsonKey(required: true)
late String description;
+ @JsonKey(required: true)
+ late DayType type;
+
@JsonKey(required: true, name: 'is_rest')
late bool isRest;
@JsonKey(required: true, name: 'need_logs_to_advance')
late bool needLogsToAdvance;
- @JsonKey(required: true)
- late String type;
-
@JsonKey(required: true)
late num order;
@JsonKey(required: true)
late Object? config;
- @JsonKey(required: false, defaultValue: [], includeFromJson: true, includeToJson: false)
+ @JsonKey(required: false, includeFromJson: true, includeToJson: false)
List slots = [];
Day({
this.id,
required this.routineId,
required this.name,
- required this.description,
+ this.description = '',
this.isRest = false,
this.needLogsToAdvance = false,
- this.type = 'custom',
- this.order = 0,
- this.config = null,
+ this.type = DayType.custom,
+ this.order = 1,
+ this.config,
this.slots = const [],
});
- Day.empty() {
- name = 'new day';
- description = '';
- type = 'custom';
- isRest = false;
- needLogsToAdvance = false;
- order = 0;
- config = {};
- slots = [];
+ Day copyWith({
+ int? id,
+ int? routineId,
+ String? name,
+ String? description,
+ DayType? type,
+ bool? isRest,
+ bool? needLogsToAdvance,
+ num? order,
+ Object? config,
+ List? slots,
+ }) {
+ return Day(
+ id: id ?? this.id,
+ routineId: routineId ?? this.routineId,
+ name: name ?? this.name,
+ description: description ?? this.description,
+ type: type ?? this.type,
+ isRest: isRest ?? this.isRest,
+ needLogsToAdvance: needLogsToAdvance ?? this.needLogsToAdvance,
+ order: order ?? this.order,
+ config: config ?? this.config,
+ slots: slots ?? this.slots,
+ );
}
+ bool get isSpecialType => type != DayType.custom;
+
// Boilerplate
factory Day.fromJson(Map json) => _$DayFromJson(json);
diff --git a/lib/models/workouts/day.g.dart b/lib/models/workouts/day.g.dart
index 000f7331..27f17564 100644
--- a/lib/models/workouts/day.g.dart
+++ b/lib/models/workouts/day.g.dart
@@ -14,24 +14,25 @@ Day _$DayFromJson(Map json) {
'routine',
'name',
'description',
+ 'type',
'is_rest',
'need_logs_to_advance',
- 'type',
'order',
- 'config'
+ 'config',
],
);
return Day(
id: (json['id'] as num?)?.toInt(),
routineId: (json['routine'] as num).toInt(),
name: json['name'] as String,
- description: json['description'] as String,
+ description: json['description'] as String? ?? '',
isRest: json['is_rest'] as bool? ?? false,
needLogsToAdvance: json['need_logs_to_advance'] as bool? ?? false,
- type: json['type'] as String? ?? 'custom',
- order: json['order'] as num? ?? 0,
- config: json['config'] ?? null,
- slots: (json['slots'] as List?)
+ type: $enumDecodeNullable(_$DayTypeEnumMap, json['type']) ?? DayType.custom,
+ order: json['order'] as num? ?? 1,
+ config: json['config'],
+ slots:
+ (json['slots'] as List?)
?.map((e) => Slot.fromJson(e as Map))
.toList() ??
[],
@@ -39,12 +40,23 @@ Day _$DayFromJson(Map json) {
}
Map _$DayToJson(Day instance) => {
- 'routine': instance.routineId,
- 'name': instance.name,
- 'description': instance.description,
- 'is_rest': instance.isRest,
- 'need_logs_to_advance': instance.needLogsToAdvance,
- 'type': instance.type,
- 'order': instance.order,
- 'config': instance.config,
- };
+ 'routine': instance.routineId,
+ 'name': instance.name,
+ 'description': instance.description,
+ 'type': _$DayTypeEnumMap[instance.type]!,
+ 'is_rest': instance.isRest,
+ 'need_logs_to_advance': instance.needLogsToAdvance,
+ 'order': instance.order,
+ 'config': instance.config,
+};
+
+const _$DayTypeEnumMap = {
+ DayType.custom: 'custom',
+ DayType.enom: 'enom',
+ DayType.amrap: 'amrap',
+ DayType.hiit: 'hiit',
+ DayType.tabata: 'tabata',
+ DayType.edt: 'edt',
+ DayType.rft: 'rft',
+ DayType.afap: 'afap',
+};
diff --git a/lib/models/workouts/day_data.g.dart b/lib/models/workouts/day_data.g.dart
index 08e08e19..4744c90b 100644
--- a/lib/models/workouts/day_data.g.dart
+++ b/lib/models/workouts/day_data.g.dart
@@ -7,16 +7,14 @@ part of 'day_data.dart';
// **************************************************************************
DayData _$DayDataFromJson(Map json) {
- $checkKeys(
- json,
- requiredKeys: const ['iteration', 'date', 'label'],
- );
+ $checkKeys(json, requiredKeys: const ['iteration', 'date', 'label']);
return DayData(
iteration: (json['iteration'] as num).toInt(),
date: DateTime.parse(json['date'] as String),
label: json['label'] as String? ?? '',
day: json['day'] == null ? null : Day.fromJson(json['day'] as Map),
- slots: (json['slots'] as List?)
+ slots:
+ (json['slots'] as List?)
?.map((e) => SlotData.fromJson(e as Map))
.toList() ??
const [],
@@ -24,9 +22,9 @@ DayData _$DayDataFromJson(Map json) {
}
Map _$DayDataToJson(DayData instance) => {
- 'iteration': instance.iteration,
- 'date': instance.date.toIso8601String(),
- 'label': instance.label,
- 'day': instance.day,
- 'slots': instance.slots,
- };
+ 'iteration': instance.iteration,
+ 'date': instance.date.toIso8601String(),
+ 'label': instance.label,
+ 'day': instance.day,
+ 'slots': instance.slots,
+};
diff --git a/lib/models/workouts/slot.g.dart b/lib/models/workouts/slot.g.dart
index 0d1085af..c059c53a 100644
--- a/lib/models/workouts/slot.g.dart
+++ b/lib/models/workouts/slot.g.dart
@@ -7,25 +7,24 @@ part of 'slot.dart';
// **************************************************************************
Slot _$SlotFromJson(Map json) {
- $checkKeys(
- json,
- requiredKeys: const ['id', 'order', 'comment', 'config'],
- );
+ $checkKeys(json, requiredKeys: const ['id', 'order', 'comment', 'config']);
return Slot(
- id: (json['id'] as num?)?.toInt(),
- day: (json['day'] as num).toInt(),
- comment: json['comment'] as String? ?? '',
- order: (json['order'] as num).toInt(),
- config: json['config'],
- )..entries = (json['entries'] as List?)
- ?.map((e) => SlotEntry.fromJson(e as Map))
- .toList() ??
- [];
+ id: (json['id'] as num?)?.toInt(),
+ day: (json['day'] as num).toInt(),
+ comment: json['comment'] as String? ?? '',
+ order: (json['order'] as num).toInt(),
+ config: json['config'],
+ )
+ ..entries =
+ (json['entries'] as List?)
+ ?.map((e) => SlotEntry.fromJson(e as Map))
+ .toList() ??
+ [];
}
Map _$SlotToJson(Slot instance) => {
- 'day': instance.day,
- 'order': instance.order,
- 'comment': instance.comment,
- 'config': instance.config,
- };
+ 'day': instance.day,
+ 'order': instance.order,
+ 'comment': instance.comment,
+ 'config': instance.config,
+};
diff --git a/lib/models/workouts/slot_data.g.dart b/lib/models/workouts/slot_data.g.dart
index cafada4a..29b7ebaa 100644
--- a/lib/models/workouts/slot_data.g.dart
+++ b/lib/models/workouts/slot_data.g.dart
@@ -7,16 +7,14 @@ part of 'slot_data.dart';
// **************************************************************************
SlotData _$SlotDataFromJson(Map json) {
- $checkKeys(
- json,
- requiredKeys: const ['comment', 'is_superset', 'exercises', 'sets'],
- );
+ $checkKeys(json, requiredKeys: const ['comment', 'is_superset', 'exercises', 'sets']);
return SlotData(
comment: json['comment'] as String,
isSuperset: json['is_superset'] as bool,
exerciseIds:
(json['exercises'] as List?)?.map((e) => (e as num).toInt()).toList() ?? const [],
- setConfigs: (json['sets'] as List?)
+ setConfigs:
+ (json['sets'] as List?)
?.map((e) => SetConfigData.fromJson(e as Map))
.toList() ??
const [],
@@ -24,8 +22,8 @@ SlotData _$SlotDataFromJson(Map json) {
}
Map _$SlotDataToJson(SlotData instance) => {
- 'comment': instance.comment,
- 'is_superset': instance.isSuperset,
- 'exercises': instance.exerciseIds,
- 'sets': instance.setConfigs,
- };
+ 'comment': instance.comment,
+ 'is_superset': instance.isSuperset,
+ 'exercises': instance.exerciseIds,
+ 'sets': instance.setConfigs,
+};
diff --git a/lib/models/workouts/slot_entry.dart b/lib/models/workouts/slot_entry.dart
index 2b57e22f..ef07e966 100644
--- a/lib/models/workouts/slot_entry.dart
+++ b/lib/models/workouts/slot_entry.dart
@@ -26,6 +26,8 @@ import 'package:wger/models/workouts/weight_unit.dart';
part 'slot_entry.g.dart';
+enum SlotEntryType { normal, dropset, myo, partial, forced, tut, iso, jump }
+
enum ConfigType {
weight,
maxWeight,
@@ -163,9 +165,9 @@ class SlotEntry {
String? type,
required Exercise exercise,
int? weightUnitId,
- num? weightRounding,
+ this.weightRounding,
int? repetitionUnitId,
- num? repetitionRounding,
+ this.repetitionRounding,
}) {
this.order = order ?? 1;
this.comment = comment ?? '';
@@ -174,13 +176,11 @@ class SlotEntry {
exerciseObj = exercise;
exerciseId = exercise.id!;
this.weightUnitId = weightUnitId ?? WEIGHT_UNIT_KG;
- this.weightRounding = weightRounding;
this.repetitionUnitId = repetitionUnitId ?? REP_UNIT_REPETITIONS_ID;
- this.repetitionRounding = repetitionRounding;
}
- get rir {
+ String get rir {
return 'DELETE ME! RIR';
}
diff --git a/lib/models/workouts/slot_entry.g.dart b/lib/models/workouts/slot_entry.g.dart
index 71be96ab..5de52481 100644
--- a/lib/models/workouts/slot_entry.g.dart
+++ b/lib/models/workouts/slot_entry.g.dart
@@ -20,7 +20,7 @@ SlotEntry _$SlotEntryFromJson(Map json) {
'repetition_rounding',
'weight_unit',
'weight_rounding',
- 'config'
+ 'config',
],
);
return SlotEntry(
@@ -34,43 +34,53 @@ SlotEntry _$SlotEntryFromJson(Map json) {
weightUnitId: (json['weight_unit'] as num?)?.toInt(),
weightRounding: stringToNumNull(json['weight_rounding'] as String?),
comment: json['comment'] as String,
- weightConfigs: (json['weight_configs'] as List?)
+ weightConfigs:
+ (json['weight_configs'] as List?)
?.map((e) => BaseConfig.fromJson(e as Map))
.toList() ??
[],
- maxWeightConfigs: (json['max_weight_configs'] as List?)
+ maxWeightConfigs:
+ (json['max_weight_configs'] as List?)
?.map((e) => BaseConfig.fromJson(e as Map))
.toList() ??
[],
- nrOfSetsConfigs: (json['set_nr_configs'] as List?)
+ nrOfSetsConfigs:
+ (json['set_nr_configs'] as List?)
?.map((e) => BaseConfig.fromJson(e as Map))
.toList() ??
[],
- maxNrOfSetsConfigs: (json['max_set_nr_configs'] as List?)
+ maxNrOfSetsConfigs:
+ (json['max_set_nr_configs'] as List?)
?.map((e) => BaseConfig.fromJson(e as Map))
.toList() ??
[],
- rirConfigs: (json['rir_configs'] as List?)
+ rirConfigs:
+ (json['rir_configs'] as List?)
?.map((e) => BaseConfig.fromJson(e as Map))
.toList() ??
[],
- maxRirConfigs: (json['max_rir_configs'] as List?)
+ maxRirConfigs:
+ (json['max_rir_configs'] as List?)
?.map((e) => BaseConfig.fromJson(e as Map))
.toList() ??
[],
- restTimeConfigs: (json['rest_configs'] as List?)
+ restTimeConfigs:
+ (json['rest_configs'] as List?)
?.map((e) => BaseConfig.fromJson(e as Map))
.toList() ??
[],
- maxRestTimeConfigs: (json['max_rest_configs'] as List?)
+ maxRestTimeConfigs:
+ (json['max_rest_configs'] as List?)
?.map((e) => BaseConfig.fromJson(e as Map))
.toList() ??
[],
- repetitionsConfigs: (json['repetitions_configs'] as List?)
+ repetitionsConfigs:
+ (json['repetitions_configs'] as List?)
?.map((e) => BaseConfig.fromJson(e as Map))
.toList() ??
[],
- maxRepetitionsConfigs: (json['max_repetitions_configs'] as List?)
+ maxRepetitionsConfigs:
+ (json['max_repetitions_configs'] as List?)
?.map((e) => BaseConfig.fromJson(e as Map))
.toList() ??
[],
@@ -78,14 +88,14 @@ SlotEntry _$SlotEntryFromJson(Map json) {
}
Map _$SlotEntryToJson(SlotEntry instance) => {
- 'slot': instance.slotId,
- 'order': instance.order,
- 'comment': instance.comment,
- 'type': instance.type,
- 'exercise': instance.exerciseId,
- 'repetition_unit': instance.repetitionUnitId,
- 'repetition_rounding': instance.repetitionRounding,
- 'weight_unit': instance.weightUnitId,
- 'weight_rounding': instance.weightRounding,
- 'config': instance.config,
- };
+ 'slot': instance.slotId,
+ 'order': instance.order,
+ 'comment': instance.comment,
+ 'type': instance.type,
+ 'exercise': instance.exerciseId,
+ 'repetition_unit': instance.repetitionUnitId,
+ 'repetition_rounding': instance.repetitionRounding,
+ 'weight_unit': instance.weightUnitId,
+ 'weight_rounding': instance.weightRounding,
+ 'config': instance.config,
+};
diff --git a/lib/widgets/routines/day.dart b/lib/widgets/routines/day.dart
index 46bc5e3c..875f6a92 100644
--- a/lib/widgets/routines/day.dart
+++ b/lib/widgets/routines/day.dart
@@ -39,10 +39,7 @@ class SetConfigDataWidget extends StatelessWidget {
return ListTile(
leading: InkWell(
- child: SizedBox(
- width: 45,
- child: ExerciseImageWidget(image: exercise.getMainImage),
- ),
+ child: SizedBox(width: 45, child: ExerciseImageWidget(image: exercise.getMainImage)),
onTap: () {
showDialog(
context: context,
@@ -52,9 +49,7 @@ class SetConfigDataWidget extends StatelessWidget {
content: ExerciseDetail(exercise),
actions: [
TextButton(
- child: Text(
- MaterialLocalizations.of(context).closeButtonLabel,
- ),
+ child: Text(MaterialLocalizations.of(context).closeButtonLabel),
onPressed: () {
Navigator.of(context).pop();
},
@@ -128,9 +123,9 @@ class DayHeader extends StatelessWidget {
final bool _viewMode;
const DayHeader({required DayData day, required int routineId, bool viewMode = false})
- : _dayData = day,
- _viewMode = viewMode,
- _routineId = routineId;
+ : _dayData = day,
+ _viewMode = viewMode,
+ _routineId = routineId;
@override
Widget build(BuildContext context) {
@@ -151,11 +146,15 @@ class DayHeader extends StatelessWidget {
);
}
+ final dayTypeLabel = _dayData.day!.isSpecialType
+ ? '\n(${_dayData.day!.type.name.toUpperCase()})'
+ : '';
+
return ListTile(
tileColor: Theme.of(context).focusColor,
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
title: Text(
- _dayData.day!.name,
+ '${_dayData.day!.name}$dayTypeLabel',
style: Theme.of(context).textTheme.headlineSmall,
overflow: TextOverflow.ellipsis,
),
diff --git a/lib/widgets/routines/forms/day.dart b/lib/widgets/routines/forms/day.dart
index d5a6fc38..e5374f77 100644
--- a/lib/widgets/routines/forms/day.dart
+++ b/lib/widgets/routines/forms/day.dart
@@ -102,10 +102,7 @@ class _ReorderableDaysListState extends State {
),
IconButton(
icon: const Icon(Icons.delete),
- onPressed: () => widget._showDeleteConfirmationDialog(
- context,
- day,
- ),
+ onPressed: () => widget._showDeleteConfirmationDialog(context, day),
),
],
),
@@ -149,7 +146,11 @@ class _ReorderableDaysListState extends State {
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () async {
- final day = Day.empty();
+ final day = Day(
+ routineId: widget.routineId,
+ name: '${i18n.newDay} ${widget.days.length + 1}',
+ order: widget.days.length + 1,
+ );
day.name = '${i18n.newDay} ${widget.days.length + 1}';
day.routineId = widget.routineId;
day.order = widget.days.length + 1;
@@ -165,11 +166,10 @@ class _ReorderableDaysListState extends State {
}
class DayFormWidget extends StatefulWidget {
- final int routineId;
late final Day day;
- DayFormWidget({required this.routineId, required this.day, super.key}) {
- day.routineId = routineId;
+ DayFormWidget({required Day day, super.key}) {
+ this.day = day.copyWith();
}
@override
@@ -181,8 +181,6 @@ class _DayFormWidgetState extends State {
final descriptionController = TextEditingController();
final nameController = TextEditingController();
- late bool isRestDay;
- late bool needLogsToAdvance;
bool isSaving = false;
final _form = GlobalKey();
@@ -190,8 +188,6 @@ class _DayFormWidgetState extends State {
@override
void initState() {
super.initState();
- isRestDay = widget.day.isRest;
- needLogsToAdvance = widget.day.needLogsToAdvance;
descriptionController.text = widget.day.description;
nameController.text = widget.day.name;
}
@@ -221,11 +217,13 @@ class _DayFormWidgetState extends State {
key: const Key('field-is-rest-day'),
title: Text(i18n.isRestDay),
subtitle: Text(i18n.isRestDayHelp),
- value: isRestDay,
+ value: widget.day.isRest,
contentPadding: const EdgeInsets.all(4),
onChanged: (value) {
setState(() {
- isRestDay = value;
+ widget.day.isRest = value;
+ widget.day.type = DayType.custom;
+ widget.day.needLogsToAdvance = false;
nameController.clear();
descriptionController.clear();
});
@@ -235,9 +233,7 @@ class _DayFormWidgetState extends State {
TextFormField(
enabled: !widget.day.isRest,
key: const Key('field-name'),
- decoration: InputDecoration(
- labelText: i18n.name,
- ),
+ decoration: InputDecoration(labelText: i18n.name),
controller: nameController,
onSaved: (value) {
widget.day.name = value!;
@@ -259,6 +255,7 @@ class _DayFormWidgetState extends State {
return null;
},
),
+
TextFormField(
key: const Key('field-description'),
enabled: !widget.day.isRest,
@@ -281,19 +278,36 @@ class _DayFormWidgetState extends State {
return null;
},
),
+ DropdownButtonFormField(
+ key: const Key('field-day-type'),
+ initialValue: widget.day.type,
+ decoration: const InputDecoration(labelText: 'Typ'),
+ items: DayType.values.map((type) {
+ return DropdownMenuItem(
+ value: type,
+ child: Text('${type.name.toUpperCase()} - ${type.i18Label(context)}'),
+ );
+ }).toList(),
+ onChanged: widget.day.isRest
+ ? null
+ : (value) {
+ setState(() {
+ widget.day.type = value!;
+ });
+ },
+ ),
SwitchListTile(
key: const Key('field-need-logs-to-advance'),
title: Text(i18n.needsLogsToAdvance),
subtitle: Text(i18n.needsLogsToAdvanceHelp),
- value: needLogsToAdvance,
+ value: widget.day.needLogsToAdvance,
contentPadding: const EdgeInsets.all(4),
onChanged: widget.day.isRest
? null
: (value) {
setState(() {
- needLogsToAdvance = value;
+ widget.day.needLogsToAdvance = value;
});
- widget.day.needLogsToAdvance = value;
},
),
const SizedBox(height: 5),
@@ -309,8 +323,10 @@ class _DayFormWidgetState extends State {
setState(() => isSaving = true);
try {
- await Provider.of(context, listen: false)
- .editDay(widget.day);
+ await Provider.of(
+ context,
+ listen: false,
+ ).editDay(widget.day);
if (context.mounted) {
setState(() {
errorMessage = const SizedBox.shrink();
@@ -330,8 +346,9 @@ class _DayFormWidgetState extends State {
}
}
},
- child:
- isSaving ? const FormProgressIndicator() : Text(AppLocalizations.of(context).save),
+ child: isSaving
+ ? const FormProgressIndicator()
+ : Text(AppLocalizations.of(context).save),
),
const SizedBox(height: 5),
ReorderableSlotList(widget.day.slots, widget.day),
diff --git a/lib/widgets/routines/forms/rir.dart b/lib/widgets/routines/forms/rir.dart
index 5c70da03..254a3603 100644
--- a/lib/widgets/routines/forms/rir.dart
+++ b/lib/widgets/routines/forms/rir.dart
@@ -30,11 +30,11 @@ class RiRInputWidget extends StatefulWidget {
static const SLIDER_START = -0.5;
RiRInputWidget(this._initialValue, {required this.onChanged}) {
- dropdownValue = _initialValue != null ? _initialValue!.toString() : SlotEntry.DEFAULT_RIR;
+ dropdownValue = _initialValue != null ? _initialValue.toString() : SlotEntry.DEFAULT_RIR;
// Read string RiR into a double
if (_initialValue != null) {
- _currentSetSliderValue = _initialValue!.toDouble();
+ _currentSetSliderValue = _initialValue.toDouble();
} else {
_currentSetSliderValue = SLIDER_START;
}
diff --git a/lib/widgets/routines/gym_mode/start_page.dart b/lib/widgets/routines/gym_mode/start_page.dart
index 6afef502..15a9eab4 100644
--- a/lib/widgets/routines/gym_mode/start_page.dart
+++ b/lib/widgets/routines/gym_mode/start_page.dart
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:wger/l10n/generated/app_localizations.dart';
import 'package:wger/models/exercises/exercise.dart';
+import 'package:wger/models/workouts/day.dart';
import 'package:wger/models/workouts/day_data.dart';
import 'package:wger/widgets/exercises/images.dart';
import 'package:wger/widgets/routines/gym_mode/navigation.dart';
@@ -24,6 +25,17 @@ class StartPage extends StatelessWidget {
Expanded(
child: ListView(
children: [
+ if (_dayData.day!.isSpecialType)
+ Center(
+ child: Padding(
+ padding: const EdgeInsets.all(15),
+ child: Text(
+ '${_dayData.day!.type.name.toUpperCase()}\n${_dayData.day!.type.i18Label(context)}',
+ textAlign: TextAlign.center,
+ style: Theme.of(context).textTheme.headlineSmall,
+ ),
+ ),
+ ),
..._dayData.slots.map((slotData) {
return Column(
children: [
@@ -42,9 +54,11 @@ class StartPage extends StatelessWidget {
width: 45,
child: ExerciseImageWidget(image: exercise.getMainImage),
),
- title: Text(exercise
- .getTranslation(Localizations.localeOf(context).languageCode)
- .name),
+ title: Text(
+ exercise
+ .getTranslation(Localizations.localeOf(context).languageCode)
+ .name,
+ ),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: entry.value.map((text) => Text(text)).toList(),
diff --git a/lib/widgets/routines/routine_edit.dart b/lib/widgets/routines/routine_edit.dart
index 67fb9844..081f88f4 100644
--- a/lib/widgets/routines/routine_edit.dart
+++ b/lib/widgets/routines/routine_edit.dart
@@ -53,10 +53,7 @@ class _RoutineEditState extends State {
children: [
RoutineForm(widget._routine, useListView: false),
Container(height: 10),
- Text(
- i18n.routineDays,
- style: Theme.of(context).textTheme.titleLarge,
- ),
+ Text(i18n.routineDays, style: Theme.of(context).textTheme.titleLarge),
ReorderableDaysList(
routineId: widget._routine.id!,
days: widget._routine.days.where((day) => day.id != null).toList(),
@@ -71,17 +68,9 @@ class _RoutineEditState extends State {
});
},
),
- if (selectedDay != null)
- DayFormWidget(
- key: ValueKey(selectedDayId),
- day: selectedDay,
- routineId: widget._routine.id!,
- ),
+ if (selectedDay != null) DayFormWidget(key: ValueKey(selectedDayId), day: selectedDay),
const SizedBox(height: 25),
- Text(
- i18n.resultingRoutine,
- style: Theme.of(context).textTheme.titleLarge,
- ),
+ Text(i18n.resultingRoutine, style: Theme.of(context).textTheme.titleLarge),
const Divider(),
RoutineDetail(widget._routine, viewMode: true),
],
diff --git a/test/auth/auth_screen_test.mocks.dart b/test/auth/auth_screen_test.mocks.dart
index 3d3e2163..f303de9d 100644
--- a/test/auth/auth_screen_test.mocks.dart
+++ b/test/auth/auth_screen_test.mocks.dart
@@ -27,23 +27,12 @@ import 'package:mockito/src/dummies.dart' as _i5;
// ignore_for_file: invalid_use_of_internal_member
class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response {
- _FakeResponse_0(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeResponse_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeStreamedResponse_1 extends _i1.SmartFake implements _i2.StreamedResponse {
- _FakeStreamedResponse_1(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeStreamedResponse_1(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
/// A class which mocks [Client].
@@ -55,46 +44,24 @@ class MockClient extends _i1.Mock implements _i2.Client {
}
@override
- _i3.Future<_i2.Response> head(
- Uri? url, {
- Map? headers,
- }) =>
+ _i3.Future<_i2.Response> head(Uri? url, {Map? headers}) =>
(super.noSuchMethod(
- Invocation.method(
- #head,
- [url],
- {#headers: headers},
- ),
- returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
- this,
- Invocation.method(
- #head,
- [url],
- {#headers: headers},
- ),
- )),
- ) as _i3.Future<_i2.Response>);
+ Invocation.method(#head, [url], {#headers: headers}),
+ returnValue: _i3.Future<_i2.Response>.value(
+ _FakeResponse_0(this, Invocation.method(#head, [url], {#headers: headers})),
+ ),
+ )
+ as _i3.Future<_i2.Response>);
@override
- _i3.Future<_i2.Response> get(
- Uri? url, {
- Map? headers,
- }) =>
+ _i3.Future<_i2.Response> get(Uri? url, {Map? headers}) =>
(super.noSuchMethod(
- Invocation.method(
- #get,
- [url],
- {#headers: headers},
- ),
- returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
- this,
- Invocation.method(
- #get,
- [url],
- {#headers: headers},
- ),
- )),
- ) as _i3.Future<_i2.Response>);
+ Invocation.method(#get, [url], {#headers: headers}),
+ returnValue: _i3.Future<_i2.Response>.value(
+ _FakeResponse_0(this, Invocation.method(#get, [url], {#headers: headers})),
+ ),
+ )
+ as _i3.Future<_i2.Response>);
@override
_i3.Future<_i2.Response> post(
@@ -104,28 +71,19 @@ class MockClient extends _i1.Mock implements _i2.Client {
_i4.Encoding? encoding,
}) =>
(super.noSuchMethod(
- Invocation.method(
- #post,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
- this,
- Invocation.method(
- #post,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- )),
- ) as _i3.Future<_i2.Response>);
+ Invocation.method(#post, [url], {#headers: headers, #body: body, #encoding: encoding}),
+ returnValue: _i3.Future<_i2.Response>.value(
+ _FakeResponse_0(
+ this,
+ Invocation.method(
+ #post,
+ [url],
+ {#headers: headers, #body: body, #encoding: encoding},
+ ),
+ ),
+ ),
+ )
+ as _i3.Future<_i2.Response>);
@override
_i3.Future<_i2.Response> put(
@@ -135,28 +93,19 @@ class MockClient extends _i1.Mock implements _i2.Client {
_i4.Encoding? encoding,
}) =>
(super.noSuchMethod(
- Invocation.method(
- #put,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
- this,
- Invocation.method(
- #put,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- )),
- ) as _i3.Future<_i2.Response>);
+ Invocation.method(#put, [url], {#headers: headers, #body: body, #encoding: encoding}),
+ returnValue: _i3.Future<_i2.Response>.value(
+ _FakeResponse_0(
+ this,
+ Invocation.method(
+ #put,
+ [url],
+ {#headers: headers, #body: body, #encoding: encoding},
+ ),
+ ),
+ ),
+ )
+ as _i3.Future<_i2.Response>);
@override
_i3.Future<_i2.Response> patch(
@@ -166,28 +115,19 @@ class MockClient extends _i1.Mock implements _i2.Client {
_i4.Encoding? encoding,
}) =>
(super.noSuchMethod(
- Invocation.method(
- #patch,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
- this,
- Invocation.method(
- #patch,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- )),
- ) as _i3.Future<_i2.Response>);
+ Invocation.method(#patch, [url], {#headers: headers, #body: body, #encoding: encoding}),
+ returnValue: _i3.Future<_i2.Response>.value(
+ _FakeResponse_0(
+ this,
+ Invocation.method(
+ #patch,
+ [url],
+ {#headers: headers, #body: body, #encoding: encoding},
+ ),
+ ),
+ ),
+ )
+ as _i3.Future<_i2.Response>);
@override
_i3.Future<_i2.Response> delete(
@@ -197,85 +137,53 @@ class MockClient extends _i1.Mock implements _i2.Client {
_i4.Encoding? encoding,
}) =>
(super.noSuchMethod(
- Invocation.method(
- #delete,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
- this,
- Invocation.method(
- #delete,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- )),
- ) as _i3.Future<_i2.Response>);
+ Invocation.method(
+ #delete,
+ [url],
+ {#headers: headers, #body: body, #encoding: encoding},
+ ),
+ returnValue: _i3.Future<_i2.Response>.value(
+ _FakeResponse_0(
+ this,
+ Invocation.method(
+ #delete,
+ [url],
+ {#headers: headers, #body: body, #encoding: encoding},
+ ),
+ ),
+ ),
+ )
+ as _i3.Future<_i2.Response>);
@override
- _i3.Future read(
- Uri? url, {
- Map? headers,
- }) =>
+ _i3.Future read(Uri? url, {Map? headers}) =>
(super.noSuchMethod(
- Invocation.method(
- #read,
- [url],
- {#headers: headers},
- ),
- returnValue: _i3.Future.value(_i5.dummyValue(
- this,
- Invocation.method(
- #read,
- [url],
- {#headers: headers},
- ),
- )),
- ) as _i3.Future);
+ Invocation.method(#read, [url], {#headers: headers}),
+ returnValue: _i3.Future.value(
+ _i5.dummyValue(this, Invocation.method(#read, [url], {#headers: headers})),
+ ),
+ )
+ as _i3.Future);
@override
- _i3.Future<_i6.Uint8List> readBytes(
- Uri? url, {
- Map? headers,
- }) =>
+ _i3.Future<_i6.Uint8List> readBytes(Uri? url, {Map? headers}) =>
(super.noSuchMethod(
- Invocation.method(
- #readBytes,
- [url],
- {#headers: headers},
- ),
- returnValue: _i3.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
- ) as _i3.Future<_i6.Uint8List>);
+ Invocation.method(#readBytes, [url], {#headers: headers}),
+ returnValue: _i3.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
+ )
+ as _i3.Future<_i6.Uint8List>);
@override
- _i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod(
- Invocation.method(
- #send,
- [request],
- ),
- returnValue: _i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1(
- this,
- Invocation.method(
- #send,
- [request],
- ),
- )),
- ) as _i3.Future<_i2.StreamedResponse>);
+ _i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) =>
+ (super.noSuchMethod(
+ Invocation.method(#send, [request]),
+ returnValue: _i3.Future<_i2.StreamedResponse>.value(
+ _FakeStreamedResponse_1(this, Invocation.method(#send, [request])),
+ ),
+ )
+ as _i3.Future<_i2.StreamedResponse>);
@override
- void close() => super.noSuchMethod(
- Invocation.method(
- #close,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void close() =>
+ super.noSuchMethod(Invocation.method(#close, []), returnValueForMissingStub: null);
}
diff --git a/test/core/settings_test.mocks.dart b/test/core/settings_test.mocks.dart
index 5f661123..f6a3f1b5 100644
--- a/test/core/settings_test.mocks.dart
+++ b/test/core/settings_test.mocks.dart
@@ -44,173 +44,78 @@ import 'package:wger/providers/user.dart' as _i21;
// ignore_for_file: invalid_use_of_internal_member
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
- _FakeWgerBaseProvider_0(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
class _FakeExerciseDatabase_1 extends _i1.SmartFake implements _i3.ExerciseDatabase {
- _FakeExerciseDatabase_1(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeExerciseDatabase_1(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
class _FakeExercise_2 extends _i1.SmartFake implements _i4.Exercise {
- _FakeExercise_2(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeExercise_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeExerciseCategory_3 extends _i1.SmartFake implements _i5.ExerciseCategory {
- _FakeExerciseCategory_3(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeExerciseCategory_3(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
class _FakeEquipment_4 extends _i1.SmartFake implements _i6.Equipment {
- _FakeEquipment_4(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeEquipment_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeMuscle_5 extends _i1.SmartFake implements _i7.Muscle {
- _FakeMuscle_5(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeMuscle_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeLanguage_6 extends _i1.SmartFake implements _i8.Language {
- _FakeLanguage_6(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeLanguage_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeIngredientDatabase_7 extends _i1.SmartFake implements _i9.IngredientDatabase {
- _FakeIngredientDatabase_7(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeIngredientDatabase_7(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
class _FakeNutritionalPlan_8 extends _i1.SmartFake implements _i10.NutritionalPlan {
- _FakeNutritionalPlan_8(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeNutritionalPlan_8(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
class _FakeMeal_9 extends _i1.SmartFake implements _i11.Meal {
- _FakeMeal_9(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeMeal_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeMealItem_10 extends _i1.SmartFake implements _i12.MealItem {
- _FakeMealItem_10(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeMealItem_10(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeIngredient_11 extends _i1.SmartFake implements _i13.Ingredient {
- _FakeIngredient_11(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeIngredient_11(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeSharedPreferencesAsync_12 extends _i1.SmartFake implements _i14.SharedPreferencesAsync {
- _FakeSharedPreferencesAsync_12(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeSharedPreferencesAsync_12(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
class _FakeAuthProvider_13 extends _i1.SmartFake implements _i15.AuthProvider {
- _FakeAuthProvider_13(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeAuthProvider_13(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
class _FakeClient_14 extends _i1.SmartFake implements _i16.Client {
- _FakeClient_14(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeClient_14(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeUri_15 extends _i1.SmartFake implements Uri {
- _FakeUri_15(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeUri_15(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeResponse_16 extends _i1.SmartFake implements _i16.Response {
- _FakeResponse_16(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeResponse_16(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
/// A class which mocks [ExercisesProvider].
@@ -222,292 +127,211 @@ class MockExercisesProvider extends _i1.Mock implements _i17.ExercisesProvider {
}
@override
- _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
- Invocation.getter(#baseProvider),
- returnValue: _FakeWgerBaseProvider_0(
- this,
- Invocation.getter(#baseProvider),
- ),
- ) as _i2.WgerBaseProvider);
+ _i2.WgerBaseProvider get baseProvider =>
+ (super.noSuchMethod(
+ Invocation.getter(#baseProvider),
+ returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)),
+ )
+ as _i2.WgerBaseProvider);
@override
- _i3.ExerciseDatabase get database => (super.noSuchMethod(
- Invocation.getter(#database),
- returnValue: _FakeExerciseDatabase_1(
- this,
- Invocation.getter(#database),
- ),
- ) as _i3.ExerciseDatabase);
+ _i3.ExerciseDatabase get database =>
+ (super.noSuchMethod(
+ Invocation.getter(#database),
+ returnValue: _FakeExerciseDatabase_1(this, Invocation.getter(#database)),
+ )
+ as _i3.ExerciseDatabase);
@override
- List<_i4.Exercise> get exercises => (super.noSuchMethod(
- Invocation.getter(#exercises),
- returnValue: <_i4.Exercise>[],
- ) as List<_i4.Exercise>);
+ List<_i4.Exercise> get exercises =>
+ (super.noSuchMethod(Invocation.getter(#exercises), returnValue: <_i4.Exercise>[])
+ as List<_i4.Exercise>);
@override
- List<_i4.Exercise> get filteredExercises => (super.noSuchMethod(
- Invocation.getter(#filteredExercises),
- returnValue: <_i4.Exercise>[],
- ) as List<_i4.Exercise>);
+ List<_i4.Exercise> get filteredExercises =>
+ (super.noSuchMethod(Invocation.getter(#filteredExercises), returnValue: <_i4.Exercise>[])
+ as List<_i4.Exercise>);
@override
- Map> get exerciseByVariation => (super.noSuchMethod(
- Invocation.getter(#exerciseByVariation),
- returnValue: >{},
- ) as Map>);
+ Map> get exerciseByVariation =>
+ (super.noSuchMethod(
+ Invocation.getter(#exerciseByVariation),
+ returnValue: >{},
+ )
+ as Map>);
@override
- List<_i5.ExerciseCategory> get categories => (super.noSuchMethod(
- Invocation.getter(#categories),
- returnValue: <_i5.ExerciseCategory>[],
- ) as List<_i5.ExerciseCategory>);
+ List<_i5.ExerciseCategory> get categories =>
+ (super.noSuchMethod(Invocation.getter(#categories), returnValue: <_i5.ExerciseCategory>[])
+ as List<_i5.ExerciseCategory>);
@override
- List<_i7.Muscle> get muscles => (super.noSuchMethod(
- Invocation.getter(#muscles),
- returnValue: <_i7.Muscle>[],
- ) as List<_i7.Muscle>);
+ List<_i7.Muscle> get muscles =>
+ (super.noSuchMethod(Invocation.getter(#muscles), returnValue: <_i7.Muscle>[])
+ as List<_i7.Muscle>);
@override
- List<_i6.Equipment> get equipment => (super.noSuchMethod(
- Invocation.getter(#equipment),
- returnValue: <_i6.Equipment>[],
- ) as List<_i6.Equipment>);
+ List<_i6.Equipment> get equipment =>
+ (super.noSuchMethod(Invocation.getter(#equipment), returnValue: <_i6.Equipment>[])
+ as List<_i6.Equipment>);
@override
- List<_i8.Language> get languages => (super.noSuchMethod(
- Invocation.getter(#languages),
- returnValue: <_i8.Language>[],
- ) as List<_i8.Language>);
+ List<_i8.Language> get languages =>
+ (super.noSuchMethod(Invocation.getter(#languages), returnValue: <_i8.Language>[])
+ as List<_i8.Language>);
@override
- set database(_i3.ExerciseDatabase? value) => super.noSuchMethod(
- Invocation.setter(
- #database,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set database(_i3.ExerciseDatabase? value) =>
+ super.noSuchMethod(Invocation.setter(#database, value), returnValueForMissingStub: null);
@override
- set exercises(List<_i4.Exercise>? value) => super.noSuchMethod(
- Invocation.setter(
- #exercises,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set exercises(List<_i4.Exercise>? value) =>
+ super.noSuchMethod(Invocation.setter(#exercises, value), returnValueForMissingStub: null);
@override
set filteredExercises(List<_i4.Exercise>? newFilteredExercises) => super.noSuchMethod(
- Invocation.setter(
- #filteredExercises,
- newFilteredExercises,
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.setter(#filteredExercises, newFilteredExercises),
+ returnValueForMissingStub: null,
+ );
@override
- set languages(List<_i8.Language>? languages) => super.noSuchMethod(
- Invocation.setter(
- #languages,
- languages,
- ),
- returnValueForMissingStub: null,
- );
+ set languages(List<_i8.Language>? languages) =>
+ super.noSuchMethod(Invocation.setter(#languages, languages), returnValueForMissingStub: null);
@override
- bool get hasListeners => (super.noSuchMethod(
- Invocation.getter(#hasListeners),
- returnValue: false,
- ) as bool);
+ bool get hasListeners =>
+ (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool);
@override
- _i18.Future setFilters(_i17.Filters? newFilters) => (super.noSuchMethod(
- Invocation.method(
- #setFilters,
- [newFilters],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
-
- @override
- void initFilters() => super.noSuchMethod(
- Invocation.method(
- #initFilters,
- [],
- ),
- returnValueForMissingStub: null,
- );
-
- @override
- _i18.Future findByFilters() => (super.noSuchMethod(
- Invocation.method(
- #findByFilters,
- [],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
-
- @override
- void clear() => super.noSuchMethod(
- Invocation.method(
- #clear,
- [],
- ),
- returnValueForMissingStub: null,
- );
-
- @override
- _i4.Exercise findExerciseById(int? id) => (super.noSuchMethod(
- Invocation.method(
- #findExerciseById,
- [id],
- ),
- returnValue: _FakeExercise_2(
- this,
- Invocation.method(
- #findExerciseById,
- [id],
- ),
- ),
- ) as _i4.Exercise);
-
- @override
- List<_i4.Exercise> findExercisesByVariationId(
- int? variationId, {
- int? exerciseIdToExclude,
- }) =>
+ _i18.Future setFilters(_i17.Filters? newFilters) =>
(super.noSuchMethod(
- Invocation.method(
- #findExercisesByVariationId,
- [variationId],
- {#exerciseIdToExclude: exerciseIdToExclude},
- ),
- returnValue: <_i4.Exercise>[],
- ) as List<_i4.Exercise>);
+ Invocation.method(#setFilters, [newFilters]),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
@override
- _i5.ExerciseCategory findCategoryById(int? id) => (super.noSuchMethod(
- Invocation.method(
- #findCategoryById,
- [id],
- ),
- returnValue: _FakeExerciseCategory_3(
- this,
- Invocation.method(
- #findCategoryById,
- [id],
- ),
- ),
- ) as _i5.ExerciseCategory);
+ void initFilters() =>
+ super.noSuchMethod(Invocation.method(#initFilters, []), returnValueForMissingStub: null);
@override
- _i6.Equipment findEquipmentById(int? id) => (super.noSuchMethod(
- Invocation.method(
- #findEquipmentById,
- [id],
- ),
- returnValue: _FakeEquipment_4(
- this,
- Invocation.method(
- #findEquipmentById,
- [id],
- ),
- ),
- ) as _i6.Equipment);
+ _i18.Future findByFilters() =>
+ (super.noSuchMethod(
+ Invocation.method(#findByFilters, []),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
@override
- _i7.Muscle findMuscleById(int? id) => (super.noSuchMethod(
- Invocation.method(
- #findMuscleById,
- [id],
- ),
- returnValue: _FakeMuscle_5(
- this,
- Invocation.method(
- #findMuscleById,
- [id],
- ),
- ),
- ) as _i7.Muscle);
+ void clear() =>
+ super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null);
@override
- _i8.Language findLanguageById(int? id) => (super.noSuchMethod(
- Invocation.method(
- #findLanguageById,
- [id],
- ),
- returnValue: _FakeLanguage_6(
- this,
- Invocation.method(
- #findLanguageById,
- [id],
- ),
- ),
- ) as _i8.Language);
+ _i4.Exercise findExerciseById(int? id) =>
+ (super.noSuchMethod(
+ Invocation.method(#findExerciseById, [id]),
+ returnValue: _FakeExercise_2(this, Invocation.method(#findExerciseById, [id])),
+ )
+ as _i4.Exercise);
@override
- _i18.Future fetchAndSetCategoriesFromApi() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetCategoriesFromApi,
- [],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ List<_i4.Exercise> findExercisesByVariationId(int? variationId, {int? exerciseIdToExclude}) =>
+ (super.noSuchMethod(
+ Invocation.method(
+ #findExercisesByVariationId,
+ [variationId],
+ {#exerciseIdToExclude: exerciseIdToExclude},
+ ),
+ returnValue: <_i4.Exercise>[],
+ )
+ as List<_i4.Exercise>);
@override
- _i18.Future fetchAndSetMusclesFromApi() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetMusclesFromApi,
- [],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ _i5.ExerciseCategory findCategoryById(int? id) =>
+ (super.noSuchMethod(
+ Invocation.method(#findCategoryById, [id]),
+ returnValue: _FakeExerciseCategory_3(this, Invocation.method(#findCategoryById, [id])),
+ )
+ as _i5.ExerciseCategory);
@override
- _i18.Future fetchAndSetEquipmentsFromApi() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetEquipmentsFromApi,
- [],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ _i6.Equipment findEquipmentById(int? id) =>
+ (super.noSuchMethod(
+ Invocation.method(#findEquipmentById, [id]),
+ returnValue: _FakeEquipment_4(this, Invocation.method(#findEquipmentById, [id])),
+ )
+ as _i6.Equipment);
@override
- _i18.Future fetchAndSetLanguagesFromApi() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetLanguagesFromApi,
- [],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ _i7.Muscle findMuscleById(int? id) =>
+ (super.noSuchMethod(
+ Invocation.method(#findMuscleById, [id]),
+ returnValue: _FakeMuscle_5(this, Invocation.method(#findMuscleById, [id])),
+ )
+ as _i7.Muscle);
@override
- _i18.Future fetchAndSetAllExercises() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetAllExercises,
- [],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ _i8.Language findLanguageById(int? id) =>
+ (super.noSuchMethod(
+ Invocation.method(#findLanguageById, [id]),
+ returnValue: _FakeLanguage_6(this, Invocation.method(#findLanguageById, [id])),
+ )
+ as _i8.Language);
@override
- _i18.Future<_i4.Exercise?> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetExercise,
- [exerciseId],
- ),
- returnValue: _i18.Future<_i4.Exercise?>.value(),
- ) as _i18.Future<_i4.Exercise?>);
+ _i18.Future fetchAndSetCategoriesFromApi() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetCategoriesFromApi, []),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
+
+ @override
+ _i18.Future fetchAndSetMusclesFromApi() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetMusclesFromApi, []),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
+
+ @override
+ _i18.Future fetchAndSetEquipmentsFromApi() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetEquipmentsFromApi, []),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
+
+ @override
+ _i18.Future fetchAndSetLanguagesFromApi() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetLanguagesFromApi, []),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
+
+ @override
+ _i18.Future fetchAndSetAllExercises() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetAllExercises, []),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
+
+ @override
+ _i18.Future<_i4.Exercise?> fetchAndSetExercise(int? exerciseId) =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetExercise, [exerciseId]),
+ returnValue: _i18.Future<_i4.Exercise?>.value(),
+ )
+ as _i18.Future<_i4.Exercise?>);
@override
_i18.Future<_i4.Exercise> handleUpdateExerciseFromApi(
@@ -515,55 +339,42 @@ class MockExercisesProvider extends _i1.Mock implements _i17.ExercisesProvider {
int? exerciseId,
) =>
(super.noSuchMethod(
- Invocation.method(
- #handleUpdateExerciseFromApi,
- [
- database,
- exerciseId,
- ],
- ),
- returnValue: _i18.Future<_i4.Exercise>.value(_FakeExercise_2(
- this,
- Invocation.method(
- #handleUpdateExerciseFromApi,
- [
- database,
- exerciseId,
- ],
- ),
- )),
- ) as _i18.Future<_i4.Exercise>);
+ Invocation.method(#handleUpdateExerciseFromApi, [database, exerciseId]),
+ returnValue: _i18.Future<_i4.Exercise>.value(
+ _FakeExercise_2(
+ this,
+ Invocation.method(#handleUpdateExerciseFromApi, [database, exerciseId]),
+ ),
+ ),
+ )
+ as _i18.Future<_i4.Exercise>);
@override
- _i18.Future initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod(
- Invocation.method(
- #initCacheTimesLocalPrefs,
- [],
- {#forceInit: forceInit},
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ _i18.Future initCacheTimesLocalPrefs({dynamic forceInit = false}) =>
+ (super.noSuchMethod(
+ Invocation.method(#initCacheTimesLocalPrefs, [], {#forceInit: forceInit}),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
@override
- _i18.Future clearAllCachesAndPrefs() => (super.noSuchMethod(
- Invocation.method(
- #clearAllCachesAndPrefs,
- [],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ _i18.Future clearAllCachesAndPrefs() =>
+ (super.noSuchMethod(
+ Invocation.method(#clearAllCachesAndPrefs, []),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
@override
- _i18.Future fetchAndSetInitialData() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetInitialData,
- [],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ _i18.Future fetchAndSetInitialData() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetInitialData, []),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
@override
_i18.Future setExercisesFromDatabase(
@@ -571,64 +382,60 @@ class MockExercisesProvider extends _i1.Mock implements _i17.ExercisesProvider {
bool? forceDeleteCache = false,
}) =>
(super.noSuchMethod(
- Invocation.method(
- #setExercisesFromDatabase,
- [database],
- {#forceDeleteCache: forceDeleteCache},
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ Invocation.method(
+ #setExercisesFromDatabase,
+ [database],
+ {#forceDeleteCache: forceDeleteCache},
+ ),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
@override
- _i18.Future updateExerciseCache(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
- Invocation.method(
- #updateExerciseCache,
- [database],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ _i18.Future updateExerciseCache(_i3.ExerciseDatabase? database) =>
+ (super.noSuchMethod(
+ Invocation.method(#updateExerciseCache, [database]),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
@override
- _i18.Future fetchAndSetMuscles(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetMuscles,
- [database],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ _i18.Future fetchAndSetMuscles(_i3.ExerciseDatabase? database) =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetMuscles, [database]),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
@override
- _i18.Future fetchAndSetCategories(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetCategories,
- [database],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ _i18.Future fetchAndSetCategories(_i3.ExerciseDatabase? database) =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetCategories, [database]),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
@override
- _i18.Future fetchAndSetLanguages(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetLanguages,
- [database],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ _i18.Future fetchAndSetLanguages(_i3.ExerciseDatabase? database) =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetLanguages, [database]),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
@override
- _i18.Future fetchAndSetEquipments(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetEquipments,
- [database],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
+ _i18.Future fetchAndSetEquipments(_i3.ExerciseDatabase? database) =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetEquipments, [database]),
+ returnValue: _i18.Future.value(),
+ returnValueForMissingStub: _i18.Future.value(),
+ )
+ as _i18.Future);
@override
_i18.Future> searchExercise(
@@ -637,52 +444,34 @@ class MockExercisesProvider extends _i1.Mock implements _i17.ExercisesProvider {
bool? searchEnglish = false,
}) =>
(super.noSuchMethod(
- Invocation.method(
- #searchExercise,
- [name],
- {
- #languageCode: languageCode,
- #searchEnglish: searchEnglish,
- },
- ),
- returnValue: _i18.Future>.value(<_i4.Exercise>[]),
- ) as _i18.Future>);
+ Invocation.method(
+ #searchExercise,
+ [name],
+ {#languageCode: languageCode, #searchEnglish: searchEnglish},
+ ),
+ returnValue: _i18.Future>.value(<_i4.Exercise>[]),
+ )
+ as _i18.Future>);
@override
void addListener(_i19.VoidCallback? listener) => super.noSuchMethod(
- Invocation.method(
- #addListener,
- [listener],
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.method(#addListener, [listener]),
+ returnValueForMissingStub: null,
+ );
@override
void removeListener(_i19.VoidCallback? listener) => super.noSuchMethod(
- Invocation.method(
- #removeListener,
- [listener],
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.method(#removeListener, [listener]),
+ returnValueForMissingStub: null,
+ );
@override
- void dispose() => super.noSuchMethod(
- Invocation.method(
- #dispose,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void dispose() =>
+ super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null);
@override
- void notifyListeners() => super.noSuchMethod(
- Invocation.method(
- #notifyListeners,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void notifyListeners() =>
+ super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null);
}
/// A class which mocks [NutritionPlansProvider].
@@ -694,268 +483,181 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i20.NutritionPlans
}
@override
- _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
- Invocation.getter(#baseProvider),
- returnValue: _FakeWgerBaseProvider_0(
- this,
- Invocation.getter(#baseProvider),
- ),
- ) as _i2.WgerBaseProvider);
-
- @override
- _i9.IngredientDatabase get database => (super.noSuchMethod(
- Invocation.getter(#database),
- returnValue: _FakeIngredientDatabase_7(
- this,
- Invocation.getter(#database),
- ),
- ) as _i9.IngredientDatabase);
-
- @override
- List<_i13.Ingredient> get ingredients => (super.noSuchMethod(
- Invocation.getter(#ingredients),
- returnValue: <_i13.Ingredient>[],
- ) as List<_i13.Ingredient>);
-
- @override
- List<_i10.NutritionalPlan> get items => (super.noSuchMethod(
- Invocation.getter(#items),
- returnValue: <_i10.NutritionalPlan>[],
- ) as List<_i10.NutritionalPlan>);
-
- @override
- set database(_i9.IngredientDatabase? value) => super.noSuchMethod(
- Invocation.setter(
- #database,
- value,
- ),
- returnValueForMissingStub: null,
- );
-
- @override
- set ingredients(List<_i13.Ingredient>? value) => super.noSuchMethod(
- Invocation.setter(
- #ingredients,
- value,
- ),
- returnValueForMissingStub: null,
- );
-
- @override
- bool get hasListeners => (super.noSuchMethod(
- Invocation.getter(#hasListeners),
- returnValue: false,
- ) as bool);
-
- @override
- void clear() => super.noSuchMethod(
- Invocation.method(
- #clear,
- [],
- ),
- returnValueForMissingStub: null,
- );
-
- @override
- _i10.NutritionalPlan findById(int? id) => (super.noSuchMethod(
- Invocation.method(
- #findById,
- [id],
- ),
- returnValue: _FakeNutritionalPlan_8(
- this,
- Invocation.method(
- #findById,
- [id],
- ),
- ),
- ) as _i10.NutritionalPlan);
-
- @override
- _i11.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(
- #findMealById,
- [id],
- )) as _i11.Meal?);
-
- @override
- _i18.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetAllPlansSparse,
- [],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
-
- @override
- _i18.Future fetchAndSetAllPlansFull() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetAllPlansFull,
- [],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
-
- @override
- _i18.Future<_i10.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetPlanSparse,
- [planId],
- ),
- returnValue: _i18.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
- this,
- Invocation.method(
- #fetchAndSetPlanSparse,
- [planId],
- ),
- )),
- ) as _i18.Future<_i10.NutritionalPlan>);
-
- @override
- _i18.Future<_i10.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetPlanFull,
- [planId],
- ),
- returnValue: _i18.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
- this,
- Invocation.method(
- #fetchAndSetPlanFull,
- [planId],
- ),
- )),
- ) as _i18.Future<_i10.NutritionalPlan>);
-
- @override
- _i18.Future<_i10.NutritionalPlan> addPlan(_i10.NutritionalPlan? planData) => (super.noSuchMethod(
- Invocation.method(
- #addPlan,
- [planData],
- ),
- returnValue: _i18.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
- this,
- Invocation.method(
- #addPlan,
- [planData],
- ),
- )),
- ) as _i18.Future<_i10.NutritionalPlan>);
-
- @override
- _i18.Future editPlan(_i10.NutritionalPlan? plan) => (super.noSuchMethod(
- Invocation.method(
- #editPlan,
- [plan],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future);
-
- @override
- _i18.Future deletePlan(int? id) => (super.noSuchMethod(
- Invocation.method(
- #deletePlan,
- [id],
- ),
- returnValue: _i18.Future.value(),
- returnValueForMissingStub: _i18.Future.value(),
- ) as _i18.Future