From 6146201531b4878c53ae043375fe733c49b1eb40 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 9 Oct 2025 16:36:06 +0200 Subject: [PATCH] Allow setting the slot entry type as well --- lib/l10n/app_en.arb | 8 + lib/models/workouts/day.dart | 7 +- lib/models/workouts/day.g.dart | 2 +- lib/models/workouts/day_data.g.dart | 4 +- lib/models/workouts/set_config_data.dart | 9 +- lib/models/workouts/set_config_data.g.dart | 35 +- lib/models/workouts/slot_data.g.dart | 10 +- lib/models/workouts/slot_entry.dart | 38 +- lib/models/workouts/slot_entry.g.dart | 21 +- lib/models/workouts/weight_unit.g.dart | 16 +- lib/widgets/routines/day.dart | 11 +- lib/widgets/routines/forms/day.dart | 3 +- lib/widgets/routines/forms/slot_entry.dart | 52 ++- lib/widgets/routines/forms/weight_unit.dart | 18 +- lib/widgets/routines/gym_mode/start_page.dart | 2 +- test/routine/day_form_test.dart | 10 +- test/routine/day_form_test.mocks.dart | 193 ++++++-- test/routine/gym_mode_screen_test.mocks.dart | 420 +++++++++++++----- .../gym_mode_session_screen_test.mocks.dart | 193 ++++++-- .../repetition_unit_form_widget_test.dart | 6 +- ...epetition_unit_form_widget_test.mocks.dart | 193 ++++++-- .../routine_edit_screen_test.mocks.dart | 193 ++++++-- test/routine/routine_edit_test.mocks.dart | 193 ++++++-- test/routine/routine_form_test.mocks.dart | 193 ++++++-- .../routine_logs_screen_test.mocks.dart | 193 ++++++-- test/routine/routine_screen_test.mocks.dart | 53 ++- .../routine/routines_provider_test.mocks.dart | 225 +++++++--- test/routine/routines_screen_test.mocks.dart | 53 ++- test/routine/slot_entry_form_test.dart | 74 ++- test/routine/slot_entry_form_test.mocks.dart | 193 ++++++-- .../routine/weight_unit_form_widget_test.dart | 2 - .../weight_unit_form_widget_test.mocks.dart | 193 ++++++-- test_data/routines.dart | 45 +- 33 files changed, 2108 insertions(+), 753 deletions(-) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 2b62b5a3..061d08a9 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -167,6 +167,14 @@ "dayTypeEdt": "Escalating density training", "dayTypeRft": "Rounds for time", "dayTypeAfap": "As fast as possible", + "slotEntryTypeNormal": "Normal", + "slotEntryTypeDropset": "Dropset", + "slotEntryTypeMyo": "Myo", + "slotEntryTypePartial": "Partial", + "slotEntryTypeForced": "Forced", + "slotEntryTypeTut": "Time under Tension", + "slotEntryTypeIso": "Isometric hold", + "slotEntryTypeJump": "Jump", "routines": "Routines", "newRoutine": "New routine", "noRoutines": "You have no routines", diff --git a/lib/models/workouts/day.dart b/lib/models/workouts/day.dart index ed7c1cae..25ed717e 100644 --- a/lib/models/workouts/day.dart +++ b/lib/models/workouts/day.dart @@ -16,7 +16,6 @@ * 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'; @@ -26,9 +25,7 @@ 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); - + String i18Label(AppLocalizations i18n) { switch (this) { case DayType.custom: return i18n.dayTypeCustom; @@ -127,6 +124,8 @@ class Day { bool get isSpecialType => type != DayType.custom; + String typeLabel() => isSpecialType ? '\n(${type.name.toUpperCase()})' : ''; + // 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 27f17564..8497895c 100644 --- a/lib/models/workouts/day.g.dart +++ b/lib/models/workouts/day.g.dart @@ -35,7 +35,7 @@ Day _$DayFromJson(Map json) { (json['slots'] as List?) ?.map((e) => Slot.fromJson(e as Map)) .toList() ?? - [], + const [], ); } diff --git a/lib/models/workouts/day_data.g.dart b/lib/models/workouts/day_data.g.dart index 4744c90b..8fb13e8b 100644 --- a/lib/models/workouts/day_data.g.dart +++ b/lib/models/workouts/day_data.g.dart @@ -12,7 +12,9 @@ DayData _$DayDataFromJson(Map json) { 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), + day: json['day'] == null + ? null + : Day.fromJson(json['day'] as Map), slots: (json['slots'] as List?) ?.map((e) => SlotData.fromJson(e as Map)) diff --git a/lib/models/workouts/set_config_data.dart b/lib/models/workouts/set_config_data.dart index 57d11cda..77893c07 100644 --- a/lib/models/workouts/set_config_data.dart +++ b/lib/models/workouts/set_config_data.dart @@ -21,6 +21,7 @@ import 'package:wger/helpers/consts.dart'; import 'package:wger/helpers/json.dart'; import 'package:wger/models/exercises/exercise.dart'; import 'package:wger/models/workouts/repetition_unit.dart'; +import 'package:wger/models/workouts/slot_entry.dart'; import 'package:wger/models/workouts/weight_unit.dart'; part 'set_config_data.g.dart'; @@ -37,7 +38,7 @@ class SetConfigData { late int slotEntryId; @JsonKey(required: true) - late String type; + late SlotEntryType type; @JsonKey(required: true, name: 'text_repr') late String textRepr; @@ -99,17 +100,17 @@ class SetConfigData { SetConfigData({ required this.exerciseId, required this.slotEntryId, - this.type = 'normal', + this.type = SlotEntryType.normal, required this.nrOfSets, this.maxNrOfSets, required this.weight, this.maxWeight, this.weightUnitId = WEIGHT_UNIT_KG, - this.weightRounding = null, + this.weightRounding, required this.repetitions, this.maxRepetitions, this.repetitionsUnitId = REP_UNIT_REPETITIONS_ID, - this.repetitionsRounding = null, + this.repetitionsRounding, required this.rir, this.maxRir, required this.rpe, diff --git a/lib/models/workouts/set_config_data.g.dart b/lib/models/workouts/set_config_data.g.dart index d2a65835..3e87f7d2 100644 --- a/lib/models/workouts/set_config_data.g.dart +++ b/lib/models/workouts/set_config_data.g.dart @@ -29,27 +29,28 @@ SetConfigData _$SetConfigDataFromJson(Map json) { 'rpe', 'rest', 'max_rest', - 'comment' + 'comment', ], ); return SetConfigData( exerciseId: (json['exercise'] as num).toInt(), slotEntryId: (json['slot_entry_id'] as num).toInt(), - type: json['type'] as String? ?? 'normal', + type: + $enumDecodeNullable(_$SlotEntryTypeEnumMap, json['type']) ?? + SlotEntryType.normal, nrOfSets: json['sets'] as num?, maxNrOfSets: json['max_sets'] as num?, weight: stringToNumNull(json['weight'] as String?), maxWeight: stringToNumNull(json['max_weight'] as String?), weightUnitId: (json['weight_unit'] as num?)?.toInt() ?? WEIGHT_UNIT_KG, - weightRounding: json['weight_rounding'] == null - ? null - : stringToNumNull(json['weight_rounding'] as String?), + weightRounding: stringToNumNull(json['weight_rounding'] as String?), repetitions: stringToNumNull(json['repetitions'] as String?), maxRepetitions: stringToNumNull(json['max_repetitions'] as String?), - repetitionsUnitId: (json['repetitions_unit'] as num?)?.toInt() ?? REP_UNIT_REPETITIONS_ID, - repetitionsRounding: json['repetitions_rounding'] == null - ? null - : stringToNumNull(json['repetitions_rounding'] as String?), + repetitionsUnitId: + (json['repetitions_unit'] as num?)?.toInt() ?? REP_UNIT_REPETITIONS_ID, + repetitionsRounding: stringToNumNull( + json['repetitions_rounding'] as String?, + ), rir: stringToNumNull(json['rir'] as String?), maxRir: stringToNumNull(json['max_rir'] as String?), rpe: stringToNumNull(json['rpe'] as String?), @@ -60,10 +61,11 @@ SetConfigData _$SetConfigDataFromJson(Map json) { ); } -Map _$SetConfigDataToJson(SetConfigData instance) => { +Map _$SetConfigDataToJson(SetConfigData instance) => + { 'exercise': instance.exerciseId, 'slot_entry_id': instance.slotEntryId, - 'type': instance.type, + 'type': _$SlotEntryTypeEnumMap[instance.type]!, 'text_repr': instance.textRepr, 'sets': instance.nrOfSets, 'max_sets': instance.maxNrOfSets, @@ -82,3 +84,14 @@ Map _$SetConfigDataToJson(SetConfigData instance) => 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 [], + (json['exercises'] as List?) + ?.map((e) => (e as num).toInt()) + .toList() ?? + const [], setConfigs: (json['sets'] as List?) ?.map((e) => SetConfigData.fromJson(e as Map)) diff --git a/lib/models/workouts/slot_entry.dart b/lib/models/workouts/slot_entry.dart index ef07e966..13fee755 100644 --- a/lib/models/workouts/slot_entry.dart +++ b/lib/models/workouts/slot_entry.dart @@ -19,6 +19,7 @@ import 'package:json_annotation/json_annotation.dart'; import 'package:wger/helpers/consts.dart'; import 'package:wger/helpers/json.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/exercises/exercise.dart'; import 'package:wger/models/workouts/base_config.dart'; import 'package:wger/models/workouts/repetition_unit.dart'; @@ -28,6 +29,31 @@ part 'slot_entry.g.dart'; enum SlotEntryType { normal, dropset, myo, partial, forced, tut, iso, jump } +extension SlotEntryTypeExtension on SlotEntryType { + String i18Label(AppLocalizations i18n) { + switch (this) { + case SlotEntryType.normal: + return i18n.slotEntryTypeNormal; + case SlotEntryType.dropset: + return i18n.slotEntryTypeDropset; + case SlotEntryType.myo: + return i18n.slotEntryTypeMyo; + case SlotEntryType.partial: + return i18n.slotEntryTypePartial; + case SlotEntryType.forced: + return i18n.slotEntryTypeForced; + case SlotEntryType.tut: + return i18n.slotEntryTypeTut; + case SlotEntryType.iso: + return i18n.slotEntryTypeIso; + case SlotEntryType.jump: + return i18n.slotEntryTypeJump; + } + } + + String get typeLabel => this != SlotEntryType.normal ? ' (${name.toUpperCase()})' : ''; +} + enum ConfigType { weight, maxWeight, @@ -61,7 +87,7 @@ class SlotEntry { late String comment; @JsonKey(required: true) - late String type; + late SlotEntryType type; @JsonKey(includeFromJson: false, includeToJson: false) late Exercise exerciseObj; @@ -123,14 +149,14 @@ class SlotEntry { SlotEntry({ this.id, required this.slotId, - required this.order, - required this.type, + this.order = 1, + this.type = SlotEntryType.normal, required this.exerciseId, required this.repetitionUnitId, required this.repetitionRounding, required this.weightUnitId, required this.weightRounding, - required this.comment, + this.comment = '', this.weightConfigs = const [], this.maxWeightConfigs = const [], this.nrOfSetsConfigs = const [], @@ -162,7 +188,7 @@ class SlotEntry { required this.slotId, String? comment, int? order, - String? type, + SlotEntryType? type, required Exercise exercise, int? weightUnitId, this.weightRounding, @@ -172,7 +198,7 @@ class SlotEntry { this.order = order ?? 1; this.comment = comment ?? ''; config = null; - this.type = type ?? 'normal'; + this.type = type ?? SlotEntryType.normal; exerciseObj = exercise; exerciseId = exercise.id!; this.weightUnitId = weightUnitId ?? WEIGHT_UNIT_KG; diff --git a/lib/models/workouts/slot_entry.g.dart b/lib/models/workouts/slot_entry.g.dart index 5de52481..0cc2848c 100644 --- a/lib/models/workouts/slot_entry.g.dart +++ b/lib/models/workouts/slot_entry.g.dart @@ -26,14 +26,16 @@ SlotEntry _$SlotEntryFromJson(Map json) { return SlotEntry( id: (json['id'] as num?)?.toInt(), slotId: (json['slot'] as num).toInt(), - order: (json['order'] as num).toInt(), - type: json['type'] as String, + order: (json['order'] as num?)?.toInt() ?? 1, + type: + $enumDecodeNullable(_$SlotEntryTypeEnumMap, json['type']) ?? + SlotEntryType.normal, exerciseId: (json['exercise'] as num).toInt(), repetitionUnitId: (json['repetition_unit'] as num?)?.toInt(), repetitionRounding: stringToNumNull(json['repetition_rounding'] as String?), weightUnitId: (json['weight_unit'] as num?)?.toInt(), weightRounding: stringToNumNull(json['weight_rounding'] as String?), - comment: json['comment'] as String, + comment: json['comment'] as String? ?? '', weightConfigs: (json['weight_configs'] as List?) ?.map((e) => BaseConfig.fromJson(e as Map)) @@ -91,7 +93,7 @@ Map _$SlotEntryToJson(SlotEntry instance) => { 'slot': instance.slotId, 'order': instance.order, 'comment': instance.comment, - 'type': instance.type, + 'type': _$SlotEntryTypeEnumMap[instance.type]!, 'exercise': instance.exerciseId, 'repetition_unit': instance.repetitionUnitId, 'repetition_rounding': instance.repetitionRounding, @@ -99,3 +101,14 @@ Map _$SlotEntryToJson(SlotEntry instance) => { 'weight_rounding': instance.weightRounding, 'config': instance.config, }; + +const _$SlotEntryTypeEnumMap = { + SlotEntryType.normal: 'normal', + SlotEntryType.dropset: 'dropset', + SlotEntryType.myo: 'myo', + SlotEntryType.partial: 'partial', + SlotEntryType.forced: 'forced', + SlotEntryType.tut: 'tut', + SlotEntryType.iso: 'iso', + SlotEntryType.jump: 'jump', +}; diff --git a/lib/models/workouts/weight_unit.g.dart b/lib/models/workouts/weight_unit.g.dart index ba89171d..7caef784 100644 --- a/lib/models/workouts/weight_unit.g.dart +++ b/lib/models/workouts/weight_unit.g.dart @@ -7,17 +7,11 @@ part of 'weight_unit.dart'; // ************************************************************************** WeightUnit _$WeightUnitFromJson(Map json) { - $checkKeys( - json, - requiredKeys: const ['id', 'name'], - ); - return WeightUnit( - id: (json['id'] as num).toInt(), - name: json['name'] as String, - ); + $checkKeys(json, requiredKeys: const ['id', 'name']); + return WeightUnit(id: (json['id'] as num).toInt(), name: json['name'] as String); } Map _$WeightUnitToJson(WeightUnit instance) => { - 'id': instance.id, - 'name': instance.name, - }; + 'id': instance.id, + 'name': instance.name, +}; diff --git a/lib/widgets/routines/day.dart b/lib/widgets/routines/day.dart index 875f6a92..f4820ac5 100644 --- a/lib/widgets/routines/day.dart +++ b/lib/widgets/routines/day.dart @@ -22,6 +22,7 @@ import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/exercises/exercise.dart'; import 'package:wger/models/workouts/day_data.dart'; import 'package:wger/models/workouts/slot_data.dart'; +import 'package:wger/models/workouts/slot_entry.dart'; import 'package:wger/screens/gym_mode.dart'; import 'package:wger/widgets/core/core.dart'; import 'package:wger/widgets/exercises/exercises.dart'; @@ -82,7 +83,9 @@ class RoutineDayWidget extends StatelessWidget { // the one exercise and don't show separate rows for each one. ...slotData.setConfigs .fold>>({}, (acc, entry) { - acc.putIfAbsent(entry.exercise, () => []).add(entry.textRepr); + acc + .putIfAbsent(entry.exercise, () => []) + .add('${entry.textRepr}${entry.type.typeLabel}'); return acc; }) .entries @@ -146,15 +149,11 @@ 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}$dayTypeLabel', + '${_dayData.day!.name}${_dayData.day!.typeLabel()}', 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 e5374f77..a0ae3c25 100644 --- a/lib/widgets/routines/forms/day.dart +++ b/lib/widgets/routines/forms/day.dart @@ -284,8 +284,9 @@ class _DayFormWidgetState extends State { decoration: const InputDecoration(labelText: 'Typ'), items: DayType.values.map((type) { return DropdownMenuItem( + key: Key('day-type-option-${type.name}'), value: type, - child: Text('${type.name.toUpperCase()} - ${type.i18Label(context)}'), + child: Text('${type.name.toUpperCase()} - ${type.i18Label(i18n)}'), ); }).toList(), onChanged: widget.day.isRest diff --git a/lib/widgets/routines/forms/slot_entry.dart b/lib/widgets/routines/forms/slot_entry.dart index ec4d8aae..94ccd7f5 100644 --- a/lib/widgets/routines/forms/slot_entry.dart +++ b/lib/widgets/routines/forms/slot_entry.dart @@ -85,8 +85,9 @@ class _SlotEntryFormState extends State { repetitionsController.text = widget.entry.repetitionsConfigs.first.value.round().toString(); } if (widget.entry.maxRepetitionsConfigs.isNotEmpty) { - maxRepetitionsController.text = - widget.entry.maxRepetitionsConfigs.first.value.round().toString(); + maxRepetitionsController.text = widget.entry.maxRepetitionsConfigs.first.value + .round() + .toString(); } if (widget.entry.restTimeConfigs.isNotEmpty) { @@ -195,6 +196,24 @@ class _SlotEntryFormState extends State { ), ], ), + if (!widget.simpleMode) + DropdownButtonFormField( + key: const Key('field-slot-entry-type'), + initialValue: widget.entry.type, + decoration: const InputDecoration(labelText: 'Typ'), + items: SlotEntryType.values.map((type) { + return DropdownMenuItem( + key: Key('slot-entry-type-option-${type.name}'), + value: type, + child: Text('${type.name.toUpperCase()} - ${type.i18Label(i18n)}'), + ); + }).toList(), + onChanged: (value) { + setState(() { + widget.entry.type = value!; + }); + }, + ), if (!widget.simpleMode) WeightUnitInputWidget( widget.entry.weightUnitId, @@ -207,6 +226,7 @@ class _SlotEntryFormState extends State { children: [ Flexible( child: TextFormField( + key: const ValueKey('field-weight'), controller: weightController, keyboardType: textInputTypeDecimal, decoration: InputDecoration(labelText: i18n.weight), @@ -221,6 +241,7 @@ class _SlotEntryFormState extends State { if (!widget.simpleMode) Flexible( child: TextFormField( + key: const ValueKey('field-max-weight'), controller: maxWeightController, keyboardType: textInputTypeDecimal, decoration: InputDecoration(labelText: i18n.max), @@ -246,6 +267,7 @@ class _SlotEntryFormState extends State { children: [ Flexible( child: TextFormField( + key: const ValueKey('field-repetitions'), controller: repetitionsController, keyboardType: textInputTypeDecimal, decoration: InputDecoration(labelText: i18n.repetitions), @@ -260,6 +282,7 @@ class _SlotEntryFormState extends State { if (!widget.simpleMode) Flexible( child: TextFormField( + key: const ValueKey('field-max-repetitions'), controller: maxRepetitionsController, keyboardType: textInputTypeDecimal, decoration: InputDecoration(labelText: i18n.max), @@ -279,6 +302,7 @@ class _SlotEntryFormState extends State { children: [ Flexible( child: TextFormField( + key: const ValueKey('field-rest'), controller: restController, keyboardType: TextInputType.number, decoration: InputDecoration(labelText: i18n.restTime), @@ -292,6 +316,7 @@ class _SlotEntryFormState extends State { ), Flexible( child: TextFormField( + key: const ValueKey('field-max-rest'), controller: maxRestController, keyboardType: TextInputType.number, decoration: InputDecoration(labelText: i18n.max), @@ -384,8 +409,9 @@ class _SlotEntryFormState extends State { } } }, - child: - isSaving ? const FormProgressIndicator() : Text(AppLocalizations.of(context).save), + child: isSaving + ? const FormProgressIndicator() + : Text(AppLocalizations.of(context).save), ), const SizedBox(height: 10), ], @@ -417,9 +443,11 @@ class _SlotDetailWidgetState extends State { return Column( children: [ errorMessage, - ...widget.slot.entries.map((entry) => entry.hasProgressionRules - ? ProgressionRulesInfoBox(entry.exerciseObj) - : SlotEntryForm(entry, widget.routineId, simpleMode: widget.simpleMode)), + ...widget.slot.entries.map( + (entry) => entry.hasProgressionRules + ? ProgressionRulesInfoBox(entry.exerciseObj) + : SlotEntryForm(entry, widget.routineId, simpleMode: widget.simpleMode), + ), const SizedBox(height: 10), if (_showExerciseSearchBox || widget.slot.entries.isEmpty) ExerciseAutocompleter( @@ -601,20 +629,14 @@ class _SlotFormWidgetStateNg extends State { Card( child: ListTile( leading: isAddingSlot ? const FormProgressIndicator() : const Icon(Icons.add), - title: Text( - i18n.addExercise, - style: Theme.of(context).textTheme.titleMedium, - ), + title: Text(i18n.addExercise, style: Theme.of(context).textTheme.titleMedium), onTap: isAddingSlot ? null : () async { setState(() => isAddingSlot = true); final newSlot = await provider.addSlot( - Slot.withData( - day: widget.day.id, - order: widget.slots.length + 1, - ), + Slot.withData(day: widget.day.id, order: widget.slots.length + 1), widget.day.routineId, ); if (mounted) { diff --git a/lib/widgets/routines/forms/weight_unit.dart b/lib/widgets/routines/forms/weight_unit.dart index dee9a761..8afb6784 100644 --- a/lib/widgets/routines/forms/weight_unit.dart +++ b/lib/widgets/routines/forms/weight_unit.dart @@ -29,7 +29,7 @@ class WeightUnitInputWidget extends StatefulWidget { late int? selectedWeightUnit; final ValueChanged onChanged; - WeightUnitInputWidget(initialValue, {required this.onChanged}) { + WeightUnitInputWidget(int? initialValue, {required this.onChanged}) { selectedWeightUnit = initialValue; } @@ -56,15 +56,15 @@ class _WeightUnitInputWidgetState extends State { widget.onChanged(newValue.id); }); }, - items: Provider.of(context, listen: false) - .weightUnits + items: Provider.of(context, listen: false).weightUnits .map>((WeightUnit value) { - return DropdownMenuItem( - key: Key(value.id.toString()), - value: value, - child: Text(value.name), - ); - }).toList(), + return DropdownMenuItem( + key: Key(value.id.toString()), + value: value, + child: Text(value.name), + ); + }) + .toList(), ); } } diff --git a/lib/widgets/routines/gym_mode/start_page.dart b/lib/widgets/routines/gym_mode/start_page.dart index 15a9eab4..2c325d25 100644 --- a/lib/widgets/routines/gym_mode/start_page.dart +++ b/lib/widgets/routines/gym_mode/start_page.dart @@ -30,7 +30,7 @@ class StartPage extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(15), child: Text( - '${_dayData.day!.type.name.toUpperCase()}\n${_dayData.day!.type.i18Label(context)}', + '${_dayData.day!.type.name.toUpperCase()}\n${_dayData.day!.type.i18Label(AppLocalizations.of(context))}', textAlign: TextAlign.center, style: Theme.of(context).textTheme.headlineSmall, ), diff --git a/test/routine/day_form_test.dart b/test/routine/day_form_test.dart index bd1ef762..7f33b7e0 100644 --- a/test/routine/day_form_test.dart +++ b/test/routine/day_form_test.dart @@ -85,6 +85,11 @@ void main() { await tester.enterText(descriptionField, ''); await tester.enterText(descriptionField, 'Day 1 description'); + await tester.tap(find.byKey(const Key('field-day-type'))); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('day-type-option-hiit'))); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); await tester.pumpAndSettle(); @@ -92,10 +97,11 @@ void main() { mockRoutinesProvider.editDay( argThat( isA() - .having((d) => d.routineId, 'routineId', 125) + .having((d) => d.routineId, 'routineId', 1) .having((d) => d.id, 'id', 1) .having((d) => d.name, 'name', 'Day 1') - .having((d) => d.description, 'description', 'Day 1 description'), + .having((d) => d.description, 'description', 'Day 1 description') + .having((d) => d.type, 'type', DayType.hiit), ), ), ); diff --git a/test/routine/day_form_test.mocks.dart b/test/routine/day_form_test.mocks.dart index 211c521f..ec91c2b5 100644 --- a/test/routine/day_form_test.mocks.dart +++ b/test/routine/day_form_test.mocks.dart @@ -37,47 +37,57 @@ import 'package:wger/providers/routines.dart' as _i12; // ignore_for_file: subtype_of_sealed_class // ignore_for_file: invalid_use_of_internal_member -class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake + implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake + implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake + implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -92,44 +102,64 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), ) as _i2.WgerBaseProvider); @override List<_i5.Routine> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override List<_i3.WeightUnit> get weightUnits => - (super.noSuchMethod(Invocation.getter(#weightUnits), returnValue: <_i3.WeightUnit>[]) + (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); @override _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_1(this, Invocation.getter(#defaultWeightUnit)), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), ) as _i3.WeightUnit); @override List<_i4.RepetitionUnit> get repetitionUnits => - (super.noSuchMethod(Invocation.getter(#repetitionUnits), returnValue: <_i4.RepetitionUnit>[]) + (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); @override _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_2(this, Invocation.getter(#defaultRepetitionUnit)), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), ) as _i4.RepetitionUnit); @override - set activeRoutine(_i5.Routine? value) => - super.noSuchMethod(Invocation.setter(#activeRoutine, value), returnValueForMissingStub: null); + set activeRoutine(_i5.Routine? value) => super.noSuchMethod( + Invocation.setter(#activeRoutine, value), + returnValueForMissingStub: null, + ); @override set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( @@ -138,24 +168,31 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => + super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); @override _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( Invocation.method(#findWeightUnitById, [id]), - returnValue: _FakeWeightUnit_1(this, Invocation.method(#findWeightUnitById, [id])), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), ) as _i3.WeightUnit); @@ -172,20 +209,30 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { @override List<_i5.Routine> getPlans() => - (super.noSuchMethod(Invocation.method(#getPlans, []), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override _i5.Routine findById(int? id) => (super.noSuchMethod( Invocation.method(#findById, [id]), - returnValue: _FakeRoutine_3(this, Invocation.method(#findById, [id])), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), ) as _i5.Routine); @override int findIndexById(int? id) => - (super.noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) as int); + (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) + as int); @override _i13.Future fetchAndSetAllRoutinesFull() => @@ -211,7 +258,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { Map? exercises, }) => (super.noSuchMethod( - Invocation.method(#setExercisesAndUnits, [entries], {#exercises: exercises}), + Invocation.method( + #setExercisesAndUnits, + [entries], + {#exercises: exercises}, + ), returnValue: _i13.Future.value(), returnValueForMissingStub: _i13.Future.value(), ) @@ -222,7 +273,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineSparse, [planId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -232,7 +286,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineFull, [routineId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -367,11 +424,17 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), returnValue: _i13.Future<_i8.SlotEntry>.value( - _FakeSlotEntry_6(this, Invocation.method(#addSlotEntry, [entry, routineId])), + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), ), ) as _i13.Future<_i8.SlotEntry>); @@ -398,26 +461,41 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue(this, Invocation.method(#getConfigUrl, [type])), + returnValue: _i16.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), ) as String); @override - _i13.Future<_i9.BaseConfig> editConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#editConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#addConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @@ -432,7 +510,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future handleConfig(_i8.SlotEntry? entry, num? value, _i8.ConfigType? type) => + _i13.Future handleConfig( + _i8.SlotEntry? entry, + num? value, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), returnValue: _i13.Future.value(), @@ -444,16 +526,24 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i13.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value(<_i10.WorkoutSession>[]), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), ) as _i13.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession(_i10.WorkoutSession? session, int? routineId) => + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#addSession, [session, routineId])), + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -463,7 +553,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#editSession, [session]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#editSession, [session])), + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -500,10 +593,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @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, + ); } diff --git a/test/routine/gym_mode_screen_test.mocks.dart b/test/routine/gym_mode_screen_test.mocks.dart index 468c5600..4737d4ee 100644 --- a/test/routine/gym_mode_screen_test.mocks.dart +++ b/test/routine/gym_mode_screen_test.mocks.dart @@ -46,88 +46,108 @@ import 'package:wger/providers/routines.dart' as _i23; // ignore_for_file: invalid_use_of_internal_member class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider { - _FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeAuthProvider_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeClient_1 extends _i1.SmartFake implements _i3.Client { - _FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeClient_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeUri_2 extends _i1.SmartFake implements Uri { - _FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeUri_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { - _FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeResponse_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWgerBaseProvider_4 extends _i1.SmartFake implements _i4.WgerBaseProvider { +class _FakeWgerBaseProvider_4 extends _i1.SmartFake + implements _i4.WgerBaseProvider { _FakeWgerBaseProvider_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeExerciseDatabase_5 extends _i1.SmartFake implements _i5.ExerciseDatabase { +class _FakeExerciseDatabase_5 extends _i1.SmartFake + implements _i5.ExerciseDatabase { _FakeExerciseDatabase_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeExercise_6 extends _i1.SmartFake implements _i6.Exercise { - _FakeExercise_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeExercise_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeExerciseCategory_7 extends _i1.SmartFake implements _i7.ExerciseCategory { +class _FakeExerciseCategory_7 extends _i1.SmartFake + implements _i7.ExerciseCategory { _FakeExerciseCategory_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeEquipment_8 extends _i1.SmartFake implements _i8.Equipment { - _FakeEquipment_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeEquipment_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeMuscle_9 extends _i1.SmartFake implements _i9.Muscle { - _FakeMuscle_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeMuscle_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeLanguage_10 extends _i1.SmartFake implements _i10.Language { - _FakeLanguage_10(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeLanguage_10(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWeightUnit_11 extends _i1.SmartFake implements _i11.WeightUnit { - _FakeWeightUnit_11(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeWeightUnit_11(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeRepetitionUnit_12 extends _i1.SmartFake implements _i12.RepetitionUnit { +class _FakeRepetitionUnit_12 extends _i1.SmartFake + implements _i12.RepetitionUnit { _FakeRepetitionUnit_12(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_13 extends _i1.SmartFake implements _i13.Routine { - _FakeRoutine_13(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeRoutine_13(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDay_14 extends _i1.SmartFake implements _i14.Day { - _FakeDay_14(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeDay_14(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlot_15 extends _i1.SmartFake implements _i15.Slot { - _FakeSlot_15(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlot_15(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlotEntry_16 extends _i1.SmartFake implements _i16.SlotEntry { - _FakeSlotEntry_16(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlotEntry_16(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeBaseConfig_17 extends _i1.SmartFake implements _i17.BaseConfig { - _FakeBaseConfig_17(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeBaseConfig_17(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWorkoutSession_18 extends _i1.SmartFake implements _i18.WorkoutSession { +class _FakeWorkoutSession_18 extends _i1.SmartFake + implements _i18.WorkoutSession { _FakeWorkoutSession_18(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_19 extends _i1.SmartFake implements _i19.Log { - _FakeLog_19(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeLog_19(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [WgerBaseProvider]. @@ -155,23 +175,34 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { as _i3.Client); @override - set auth(_i2.AuthProvider? value) => - super.noSuchMethod(Invocation.setter(#auth, value), returnValueForMissingStub: null); + set auth(_i2.AuthProvider? value) => super.noSuchMethod( + Invocation.setter(#auth, value), + returnValueForMissingStub: null, + ); @override - set client(_i3.Client? value) => - super.noSuchMethod(Invocation.setter(#client, value), returnValueForMissingStub: null); + set client(_i3.Client? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override Map getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod( - Invocation.method(#getDefaultHeaders, [], {#includeAuth: includeAuth}), + Invocation.method(#getDefaultHeaders, [], { + #includeAuth: includeAuth, + }), returnValue: {}, ) as Map); @override - Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => + Uri makeUrl( + String? path, { + int? id, + String? objectMethod, + Map? query, + }) => (super.noSuchMethod( Invocation.method( #makeUrl, @@ -206,18 +237,28 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { as _i20.Future>); @override - _i20.Future> post(Map? data, Uri? uri) => + _i20.Future> post( + Map? data, + Uri? uri, + ) => (super.noSuchMethod( Invocation.method(#post, [data, uri]), - returnValue: _i20.Future>.value({}), + returnValue: _i20.Future>.value( + {}, + ), ) as _i20.Future>); @override - _i20.Future> patch(Map? data, Uri? uri) => + _i20.Future> patch( + Map? data, + Uri? uri, + ) => (super.noSuchMethod( Invocation.method(#patch, [data, uri]), - returnValue: _i20.Future>.value({}), + returnValue: _i20.Future>.value( + {}, + ), ) as _i20.Future>); @@ -226,7 +267,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { (super.noSuchMethod( Invocation.method(#deleteRequest, [url, id]), returnValue: _i20.Future<_i3.Response>.value( - _FakeResponse_3(this, Invocation.method(#deleteRequest, [url, id])), + _FakeResponse_3( + this, + Invocation.method(#deleteRequest, [url, id]), + ), ), ) as _i20.Future<_i3.Response>); @@ -244,7 +288,10 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { _i4.WgerBaseProvider get baseProvider => (super.noSuchMethod( Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_4(this, Invocation.getter(#baseProvider)), + returnValue: _FakeWgerBaseProvider_4( + this, + Invocation.getter(#baseProvider), + ), ) as _i4.WgerBaseProvider); @@ -252,18 +299,27 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { _i5.ExerciseDatabase get database => (super.noSuchMethod( Invocation.getter(#database), - returnValue: _FakeExerciseDatabase_5(this, Invocation.getter(#database)), + returnValue: _FakeExerciseDatabase_5( + this, + Invocation.getter(#database), + ), ) as _i5.ExerciseDatabase); @override List<_i6.Exercise> get exercises => - (super.noSuchMethod(Invocation.getter(#exercises), returnValue: <_i6.Exercise>[]) + (super.noSuchMethod( + Invocation.getter(#exercises), + returnValue: <_i6.Exercise>[], + ) as List<_i6.Exercise>); @override List<_i6.Exercise> get filteredExercises => - (super.noSuchMethod(Invocation.getter(#filteredExercises), returnValue: <_i6.Exercise>[]) + (super.noSuchMethod( + Invocation.getter(#filteredExercises), + returnValue: <_i6.Exercise>[], + ) as List<_i6.Exercise>); @override @@ -276,45 +332,65 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { @override List<_i7.ExerciseCategory> get categories => - (super.noSuchMethod(Invocation.getter(#categories), returnValue: <_i7.ExerciseCategory>[]) + (super.noSuchMethod( + Invocation.getter(#categories), + returnValue: <_i7.ExerciseCategory>[], + ) as List<_i7.ExerciseCategory>); @override List<_i9.Muscle> get muscles => - (super.noSuchMethod(Invocation.getter(#muscles), returnValue: <_i9.Muscle>[]) + (super.noSuchMethod( + Invocation.getter(#muscles), + returnValue: <_i9.Muscle>[], + ) as List<_i9.Muscle>); @override List<_i8.Equipment> get equipment => - (super.noSuchMethod(Invocation.getter(#equipment), returnValue: <_i8.Equipment>[]) + (super.noSuchMethod( + Invocation.getter(#equipment), + returnValue: <_i8.Equipment>[], + ) as List<_i8.Equipment>); @override List<_i10.Language> get languages => - (super.noSuchMethod(Invocation.getter(#languages), returnValue: <_i10.Language>[]) + (super.noSuchMethod( + Invocation.getter(#languages), + returnValue: <_i10.Language>[], + ) as List<_i10.Language>); @override - set database(_i5.ExerciseDatabase? value) => - super.noSuchMethod(Invocation.setter(#database, value), returnValueForMissingStub: null); - - @override - set exercises(List<_i6.Exercise>? value) => - super.noSuchMethod(Invocation.setter(#exercises, value), returnValueForMissingStub: null); - - @override - set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => super.noSuchMethod( - Invocation.setter(#filteredExercises, newFilteredExercises), + set database(_i5.ExerciseDatabase? value) => super.noSuchMethod( + Invocation.setter(#database, value), returnValueForMissingStub: null, ); @override - set languages(List<_i10.Language>? languages) => - super.noSuchMethod(Invocation.setter(#languages, languages), returnValueForMissingStub: null); + set exercises(List<_i6.Exercise>? value) => super.noSuchMethod( + Invocation.setter(#exercises, value), + returnValueForMissingStub: null, + ); + + @override + set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => + super.noSuchMethod( + Invocation.setter(#filteredExercises, newFilteredExercises), + returnValueForMissingStub: null, + ); + + @override + set languages(List<_i10.Language>? languages) => super.noSuchMethod( + Invocation.setter(#languages, languages), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override _i20.Future setFilters(_i21.Filters? newFilters) => @@ -326,8 +402,10 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { as _i20.Future); @override - void initFilters() => - super.noSuchMethod(Invocation.method(#initFilters, []), returnValueForMissingStub: null); + void initFilters() => super.noSuchMethod( + Invocation.method(#initFilters, []), + returnValueForMissingStub: null, + ); @override _i20.Future findByFilters() => @@ -339,19 +417,27 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { as _i20.Future); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); @override _i6.Exercise findExerciseById(int? id) => (super.noSuchMethod( Invocation.method(#findExerciseById, [id]), - returnValue: _FakeExercise_6(this, Invocation.method(#findExerciseById, [id])), + returnValue: _FakeExercise_6( + this, + Invocation.method(#findExerciseById, [id]), + ), ) as _i6.Exercise); @override - List<_i6.Exercise> findExercisesByVariationId(int? variationId, {int? exerciseIdToExclude}) => + List<_i6.Exercise> findExercisesByVariationId( + int? variationId, { + int? exerciseIdToExclude, + }) => (super.noSuchMethod( Invocation.method( #findExercisesByVariationId, @@ -366,7 +452,10 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { _i7.ExerciseCategory findCategoryById(int? id) => (super.noSuchMethod( Invocation.method(#findCategoryById, [id]), - returnValue: _FakeExerciseCategory_7(this, Invocation.method(#findCategoryById, [id])), + returnValue: _FakeExerciseCategory_7( + this, + Invocation.method(#findCategoryById, [id]), + ), ) as _i7.ExerciseCategory); @@ -374,7 +463,10 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { _i8.Equipment findEquipmentById(int? id) => (super.noSuchMethod( Invocation.method(#findEquipmentById, [id]), - returnValue: _FakeEquipment_8(this, Invocation.method(#findEquipmentById, [id])), + returnValue: _FakeEquipment_8( + this, + Invocation.method(#findEquipmentById, [id]), + ), ) as _i8.Equipment); @@ -382,7 +474,10 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { _i9.Muscle findMuscleById(int? id) => (super.noSuchMethod( Invocation.method(#findMuscleById, [id]), - returnValue: _FakeMuscle_9(this, Invocation.method(#findMuscleById, [id])), + returnValue: _FakeMuscle_9( + this, + Invocation.method(#findMuscleById, [id]), + ), ) as _i9.Muscle); @@ -390,7 +485,10 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { _i10.Language findLanguageById(int? id) => (super.noSuchMethod( Invocation.method(#findLanguageById, [id]), - returnValue: _FakeLanguage_10(this, Invocation.method(#findLanguageById, [id])), + returnValue: _FakeLanguage_10( + this, + Invocation.method(#findLanguageById, [id]), + ), ) as _i10.Language); @@ -453,11 +551,17 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { int? exerciseId, ) => (super.noSuchMethod( - Invocation.method(#handleUpdateExerciseFromApi, [database, exerciseId]), + Invocation.method(#handleUpdateExerciseFromApi, [ + database, + exerciseId, + ]), returnValue: _i20.Future<_i6.Exercise>.value( _FakeExercise_6( this, - Invocation.method(#handleUpdateExerciseFromApi, [database, exerciseId]), + Invocation.method(#handleUpdateExerciseFromApi, [ + database, + exerciseId, + ]), ), ), ) @@ -466,7 +570,9 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { @override _i20.Future initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod( - Invocation.method(#initCacheTimesLocalPrefs, [], {#forceInit: forceInit}), + Invocation.method(#initCacheTimesLocalPrefs, [], { + #forceInit: forceInit, + }), returnValue: _i20.Future.value(), returnValueForMissingStub: _i20.Future.value(), ) @@ -563,7 +669,9 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { [name], {#languageCode: languageCode, #searchEnglish: searchEnglish}, ), - returnValue: _i20.Future>.value(<_i6.Exercise>[]), + returnValue: _i20.Future>.value( + <_i6.Exercise>[], + ), ) as _i20.Future>); @@ -580,12 +688,16 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { ); @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 [RoutinesProvider]. @@ -600,44 +712,64 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { _i4.WgerBaseProvider get baseProvider => (super.noSuchMethod( Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_4(this, Invocation.getter(#baseProvider)), + returnValue: _FakeWgerBaseProvider_4( + this, + Invocation.getter(#baseProvider), + ), ) as _i4.WgerBaseProvider); @override List<_i13.Routine> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i13.Routine>[]) + (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i13.Routine>[], + ) as List<_i13.Routine>); @override List<_i11.WeightUnit> get weightUnits => - (super.noSuchMethod(Invocation.getter(#weightUnits), returnValue: <_i11.WeightUnit>[]) + (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i11.WeightUnit>[], + ) as List<_i11.WeightUnit>); @override _i11.WeightUnit get defaultWeightUnit => (super.noSuchMethod( Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_11(this, Invocation.getter(#defaultWeightUnit)), + returnValue: _FakeWeightUnit_11( + this, + Invocation.getter(#defaultWeightUnit), + ), ) as _i11.WeightUnit); @override List<_i12.RepetitionUnit> get repetitionUnits => - (super.noSuchMethod(Invocation.getter(#repetitionUnits), returnValue: <_i12.RepetitionUnit>[]) + (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i12.RepetitionUnit>[], + ) as List<_i12.RepetitionUnit>); @override _i12.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_12(this, Invocation.getter(#defaultRepetitionUnit)), + returnValue: _FakeRepetitionUnit_12( + this, + Invocation.getter(#defaultRepetitionUnit), + ), ) as _i12.RepetitionUnit); @override - set activeRoutine(_i13.Routine? value) => - super.noSuchMethod(Invocation.setter(#activeRoutine, value), returnValueForMissingStub: null); + set activeRoutine(_i13.Routine? value) => super.noSuchMethod( + Invocation.setter(#activeRoutine, value), + returnValueForMissingStub: null, + ); @override set weightUnits(List<_i11.WeightUnit>? weightUnits) => super.noSuchMethod( @@ -646,24 +778,31 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { ); @override - set repetitionUnits(List<_i12.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i12.RepetitionUnit>? repetitionUnits) => + super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); @override _i11.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( Invocation.method(#findWeightUnitById, [id]), - returnValue: _FakeWeightUnit_11(this, Invocation.method(#findWeightUnitById, [id])), + returnValue: _FakeWeightUnit_11( + this, + Invocation.method(#findWeightUnitById, [id]), + ), ) as _i11.WeightUnit); @@ -680,20 +819,30 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { @override List<_i13.Routine> getPlans() => - (super.noSuchMethod(Invocation.method(#getPlans, []), returnValue: <_i13.Routine>[]) + (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i13.Routine>[], + ) as List<_i13.Routine>); @override _i13.Routine findById(int? id) => (super.noSuchMethod( Invocation.method(#findById, [id]), - returnValue: _FakeRoutine_13(this, Invocation.method(#findById, [id])), + returnValue: _FakeRoutine_13( + this, + Invocation.method(#findById, [id]), + ), ) as _i13.Routine); @override int findIndexById(int? id) => - (super.noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) as int); + (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) + as int); @override _i20.Future fetchAndSetAllRoutinesFull() => @@ -719,7 +868,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { Map? exercises, }) => (super.noSuchMethod( - Invocation.method(#setExercisesAndUnits, [entries], {#exercises: exercises}), + Invocation.method( + #setExercisesAndUnits, + [entries], + {#exercises: exercises}, + ), returnValue: _i20.Future.value(), returnValueForMissingStub: _i20.Future.value(), ) @@ -730,7 +883,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), returnValue: _i20.Future<_i13.Routine>.value( - _FakeRoutine_13(this, Invocation.method(#fetchAndSetRoutineSparse, [planId])), + _FakeRoutine_13( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), ), ) as _i20.Future<_i13.Routine>); @@ -740,7 +896,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), returnValue: _i20.Future<_i13.Routine>.value( - _FakeRoutine_13(this, Invocation.method(#fetchAndSetRoutineFull, [routineId])), + _FakeRoutine_13( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), ), ) as _i20.Future<_i13.Routine>); @@ -842,7 +1001,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { (super.noSuchMethod( Invocation.method(#addSlot, [slot, routineId]), returnValue: _i20.Future<_i15.Slot>.value( - _FakeSlot_15(this, Invocation.method(#addSlot, [slot, routineId])), + _FakeSlot_15( + this, + Invocation.method(#addSlot, [slot, routineId]), + ), ), ) as _i20.Future<_i15.Slot>); @@ -875,11 +1037,17 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { as _i20.Future); @override - _i20.Future<_i16.SlotEntry> addSlotEntry(_i16.SlotEntry? entry, int? routineId) => + _i20.Future<_i16.SlotEntry> addSlotEntry( + _i16.SlotEntry? entry, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), returnValue: _i20.Future<_i16.SlotEntry>.value( - _FakeSlotEntry_16(this, Invocation.method(#addSlotEntry, [entry, routineId])), + _FakeSlotEntry_16( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), ), ) as _i20.Future<_i16.SlotEntry>); @@ -906,26 +1074,41 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { String getConfigUrl(_i16.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i25.dummyValue(this, Invocation.method(#getConfigUrl, [type])), + returnValue: _i25.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), ) as String); @override - _i20.Future<_i17.BaseConfig> editConfig(_i17.BaseConfig? config, _i16.ConfigType? type) => + _i20.Future<_i17.BaseConfig> editConfig( + _i17.BaseConfig? config, + _i16.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), returnValue: _i20.Future<_i17.BaseConfig>.value( - _FakeBaseConfig_17(this, Invocation.method(#editConfig, [config, type])), + _FakeBaseConfig_17( + this, + Invocation.method(#editConfig, [config, type]), + ), ), ) as _i20.Future<_i17.BaseConfig>); @override - _i20.Future<_i17.BaseConfig> addConfig(_i17.BaseConfig? config, _i16.ConfigType? type) => + _i20.Future<_i17.BaseConfig> addConfig( + _i17.BaseConfig? config, + _i16.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), returnValue: _i20.Future<_i17.BaseConfig>.value( - _FakeBaseConfig_17(this, Invocation.method(#addConfig, [config, type])), + _FakeBaseConfig_17( + this, + Invocation.method(#addConfig, [config, type]), + ), ), ) as _i20.Future<_i17.BaseConfig>); @@ -940,7 +1123,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { as _i20.Future); @override - _i20.Future handleConfig(_i16.SlotEntry? entry, num? value, _i16.ConfigType? type) => + _i20.Future handleConfig( + _i16.SlotEntry? entry, + num? value, + _i16.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), returnValue: _i20.Future.value(), @@ -952,16 +1139,24 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { _i20.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i20.Future>.value(<_i18.WorkoutSession>[]), + returnValue: _i20.Future>.value( + <_i18.WorkoutSession>[], + ), ) as _i20.Future>); @override - _i20.Future<_i18.WorkoutSession> addSession(_i18.WorkoutSession? session, int? routineId) => + _i20.Future<_i18.WorkoutSession> addSession( + _i18.WorkoutSession? session, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), returnValue: _i20.Future<_i18.WorkoutSession>.value( - _FakeWorkoutSession_18(this, Invocation.method(#addSession, [session, routineId])), + _FakeWorkoutSession_18( + this, + Invocation.method(#addSession, [session, routineId]), + ), ), ) as _i20.Future<_i18.WorkoutSession>); @@ -971,7 +1166,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { (super.noSuchMethod( Invocation.method(#editSession, [session]), returnValue: _i20.Future<_i18.WorkoutSession>.value( - _FakeWorkoutSession_18(this, Invocation.method(#editSession, [session])), + _FakeWorkoutSession_18( + this, + Invocation.method(#editSession, [session]), + ), ), ) as _i20.Future<_i18.WorkoutSession>); @@ -1008,10 +1206,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { ); @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, + ); } diff --git a/test/routine/gym_mode_session_screen_test.mocks.dart b/test/routine/gym_mode_session_screen_test.mocks.dart index 05bb0ba5..1a8bdc59 100644 --- a/test/routine/gym_mode_session_screen_test.mocks.dart +++ b/test/routine/gym_mode_session_screen_test.mocks.dart @@ -37,47 +37,57 @@ import 'package:wger/providers/routines.dart' as _i12; // ignore_for_file: subtype_of_sealed_class // ignore_for_file: invalid_use_of_internal_member -class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake + implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake + implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake + implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -92,44 +102,64 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), ) as _i2.WgerBaseProvider); @override List<_i5.Routine> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override List<_i3.WeightUnit> get weightUnits => - (super.noSuchMethod(Invocation.getter(#weightUnits), returnValue: <_i3.WeightUnit>[]) + (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); @override _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_1(this, Invocation.getter(#defaultWeightUnit)), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), ) as _i3.WeightUnit); @override List<_i4.RepetitionUnit> get repetitionUnits => - (super.noSuchMethod(Invocation.getter(#repetitionUnits), returnValue: <_i4.RepetitionUnit>[]) + (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); @override _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_2(this, Invocation.getter(#defaultRepetitionUnit)), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), ) as _i4.RepetitionUnit); @override - set activeRoutine(_i5.Routine? value) => - super.noSuchMethod(Invocation.setter(#activeRoutine, value), returnValueForMissingStub: null); + set activeRoutine(_i5.Routine? value) => super.noSuchMethod( + Invocation.setter(#activeRoutine, value), + returnValueForMissingStub: null, + ); @override set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( @@ -138,24 +168,31 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => + super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); @override _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( Invocation.method(#findWeightUnitById, [id]), - returnValue: _FakeWeightUnit_1(this, Invocation.method(#findWeightUnitById, [id])), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), ) as _i3.WeightUnit); @@ -172,20 +209,30 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { @override List<_i5.Routine> getPlans() => - (super.noSuchMethod(Invocation.method(#getPlans, []), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override _i5.Routine findById(int? id) => (super.noSuchMethod( Invocation.method(#findById, [id]), - returnValue: _FakeRoutine_3(this, Invocation.method(#findById, [id])), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), ) as _i5.Routine); @override int findIndexById(int? id) => - (super.noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) as int); + (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) + as int); @override _i13.Future fetchAndSetAllRoutinesFull() => @@ -211,7 +258,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { Map? exercises, }) => (super.noSuchMethod( - Invocation.method(#setExercisesAndUnits, [entries], {#exercises: exercises}), + Invocation.method( + #setExercisesAndUnits, + [entries], + {#exercises: exercises}, + ), returnValue: _i13.Future.value(), returnValueForMissingStub: _i13.Future.value(), ) @@ -222,7 +273,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineSparse, [planId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -232,7 +286,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineFull, [routineId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -367,11 +424,17 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), returnValue: _i13.Future<_i8.SlotEntry>.value( - _FakeSlotEntry_6(this, Invocation.method(#addSlotEntry, [entry, routineId])), + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), ), ) as _i13.Future<_i8.SlotEntry>); @@ -398,26 +461,41 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue(this, Invocation.method(#getConfigUrl, [type])), + returnValue: _i16.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), ) as String); @override - _i13.Future<_i9.BaseConfig> editConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#editConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#addConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @@ -432,7 +510,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future handleConfig(_i8.SlotEntry? entry, num? value, _i8.ConfigType? type) => + _i13.Future handleConfig( + _i8.SlotEntry? entry, + num? value, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), returnValue: _i13.Future.value(), @@ -444,16 +526,24 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i13.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value(<_i10.WorkoutSession>[]), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), ) as _i13.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession(_i10.WorkoutSession? session, int? routineId) => + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#addSession, [session, routineId])), + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -463,7 +553,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#editSession, [session]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#editSession, [session])), + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -500,10 +593,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @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, + ); } diff --git a/test/routine/repetition_unit_form_widget_test.dart b/test/routine/repetition_unit_form_widget_test.dart index 96f94b4b..16d16949 100644 --- a/test/routine/repetition_unit_form_widget_test.dart +++ b/test/routine/repetition_unit_form_widget_test.dart @@ -41,8 +41,6 @@ void main() { final slotEntry = SlotEntry( slotId: 1, - type: 'normal', - order: 1, exerciseId: 1, repetitionUnitId: 1, repetitionRounding: 0.25, @@ -70,9 +68,7 @@ void main() { supportedLocales: AppLocalizations.supportedLocales, navigatorKey: key, home: Scaffold(body: RepetitionUnitInputWidget(1, onChanged: (value) => result = value)), - routes: { - RoutineScreen.routeName: (ctx) => const RoutineScreen(), - }, + routes: {RoutineScreen.routeName: (ctx) => const RoutineScreen()}, ), ); } diff --git a/test/routine/repetition_unit_form_widget_test.mocks.dart b/test/routine/repetition_unit_form_widget_test.mocks.dart index 7294923b..7f1243c4 100644 --- a/test/routine/repetition_unit_form_widget_test.mocks.dart +++ b/test/routine/repetition_unit_form_widget_test.mocks.dart @@ -37,47 +37,57 @@ import 'package:wger/providers/routines.dart' as _i12; // ignore_for_file: subtype_of_sealed_class // ignore_for_file: invalid_use_of_internal_member -class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake + implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake + implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake + implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -92,44 +102,64 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), ) as _i2.WgerBaseProvider); @override List<_i5.Routine> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override List<_i3.WeightUnit> get weightUnits => - (super.noSuchMethod(Invocation.getter(#weightUnits), returnValue: <_i3.WeightUnit>[]) + (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); @override _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_1(this, Invocation.getter(#defaultWeightUnit)), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), ) as _i3.WeightUnit); @override List<_i4.RepetitionUnit> get repetitionUnits => - (super.noSuchMethod(Invocation.getter(#repetitionUnits), returnValue: <_i4.RepetitionUnit>[]) + (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); @override _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_2(this, Invocation.getter(#defaultRepetitionUnit)), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), ) as _i4.RepetitionUnit); @override - set activeRoutine(_i5.Routine? value) => - super.noSuchMethod(Invocation.setter(#activeRoutine, value), returnValueForMissingStub: null); + set activeRoutine(_i5.Routine? value) => super.noSuchMethod( + Invocation.setter(#activeRoutine, value), + returnValueForMissingStub: null, + ); @override set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( @@ -138,24 +168,31 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => + super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); @override _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( Invocation.method(#findWeightUnitById, [id]), - returnValue: _FakeWeightUnit_1(this, Invocation.method(#findWeightUnitById, [id])), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), ) as _i3.WeightUnit); @@ -172,20 +209,30 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { @override List<_i5.Routine> getPlans() => - (super.noSuchMethod(Invocation.method(#getPlans, []), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override _i5.Routine findById(int? id) => (super.noSuchMethod( Invocation.method(#findById, [id]), - returnValue: _FakeRoutine_3(this, Invocation.method(#findById, [id])), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), ) as _i5.Routine); @override int findIndexById(int? id) => - (super.noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) as int); + (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) + as int); @override _i13.Future fetchAndSetAllRoutinesFull() => @@ -211,7 +258,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { Map? exercises, }) => (super.noSuchMethod( - Invocation.method(#setExercisesAndUnits, [entries], {#exercises: exercises}), + Invocation.method( + #setExercisesAndUnits, + [entries], + {#exercises: exercises}, + ), returnValue: _i13.Future.value(), returnValueForMissingStub: _i13.Future.value(), ) @@ -222,7 +273,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineSparse, [planId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -232,7 +286,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineFull, [routineId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -367,11 +424,17 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), returnValue: _i13.Future<_i8.SlotEntry>.value( - _FakeSlotEntry_6(this, Invocation.method(#addSlotEntry, [entry, routineId])), + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), ), ) as _i13.Future<_i8.SlotEntry>); @@ -398,26 +461,41 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue(this, Invocation.method(#getConfigUrl, [type])), + returnValue: _i16.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), ) as String); @override - _i13.Future<_i9.BaseConfig> editConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#editConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#addConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @@ -432,7 +510,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future handleConfig(_i8.SlotEntry? entry, num? value, _i8.ConfigType? type) => + _i13.Future handleConfig( + _i8.SlotEntry? entry, + num? value, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), returnValue: _i13.Future.value(), @@ -444,16 +526,24 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i13.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value(<_i10.WorkoutSession>[]), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), ) as _i13.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession(_i10.WorkoutSession? session, int? routineId) => + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#addSession, [session, routineId])), + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -463,7 +553,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#editSession, [session]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#editSession, [session])), + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -500,10 +593,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @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, + ); } diff --git a/test/routine/routine_edit_screen_test.mocks.dart b/test/routine/routine_edit_screen_test.mocks.dart index 26ed8b10..5c80aeac 100644 --- a/test/routine/routine_edit_screen_test.mocks.dart +++ b/test/routine/routine_edit_screen_test.mocks.dart @@ -37,47 +37,57 @@ import 'package:wger/providers/routines.dart' as _i12; // ignore_for_file: subtype_of_sealed_class // ignore_for_file: invalid_use_of_internal_member -class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake + implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake + implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake + implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -92,44 +102,64 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), ) as _i2.WgerBaseProvider); @override List<_i5.Routine> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override List<_i3.WeightUnit> get weightUnits => - (super.noSuchMethod(Invocation.getter(#weightUnits), returnValue: <_i3.WeightUnit>[]) + (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); @override _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_1(this, Invocation.getter(#defaultWeightUnit)), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), ) as _i3.WeightUnit); @override List<_i4.RepetitionUnit> get repetitionUnits => - (super.noSuchMethod(Invocation.getter(#repetitionUnits), returnValue: <_i4.RepetitionUnit>[]) + (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); @override _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_2(this, Invocation.getter(#defaultRepetitionUnit)), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), ) as _i4.RepetitionUnit); @override - set activeRoutine(_i5.Routine? value) => - super.noSuchMethod(Invocation.setter(#activeRoutine, value), returnValueForMissingStub: null); + set activeRoutine(_i5.Routine? value) => super.noSuchMethod( + Invocation.setter(#activeRoutine, value), + returnValueForMissingStub: null, + ); @override set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( @@ -138,24 +168,31 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => + super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); @override _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( Invocation.method(#findWeightUnitById, [id]), - returnValue: _FakeWeightUnit_1(this, Invocation.method(#findWeightUnitById, [id])), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), ) as _i3.WeightUnit); @@ -172,20 +209,30 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { @override List<_i5.Routine> getPlans() => - (super.noSuchMethod(Invocation.method(#getPlans, []), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override _i5.Routine findById(int? id) => (super.noSuchMethod( Invocation.method(#findById, [id]), - returnValue: _FakeRoutine_3(this, Invocation.method(#findById, [id])), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), ) as _i5.Routine); @override int findIndexById(int? id) => - (super.noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) as int); + (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) + as int); @override _i13.Future fetchAndSetAllRoutinesFull() => @@ -211,7 +258,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { Map? exercises, }) => (super.noSuchMethod( - Invocation.method(#setExercisesAndUnits, [entries], {#exercises: exercises}), + Invocation.method( + #setExercisesAndUnits, + [entries], + {#exercises: exercises}, + ), returnValue: _i13.Future.value(), returnValueForMissingStub: _i13.Future.value(), ) @@ -222,7 +273,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineSparse, [planId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -232,7 +286,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineFull, [routineId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -367,11 +424,17 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), returnValue: _i13.Future<_i8.SlotEntry>.value( - _FakeSlotEntry_6(this, Invocation.method(#addSlotEntry, [entry, routineId])), + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), ), ) as _i13.Future<_i8.SlotEntry>); @@ -398,26 +461,41 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue(this, Invocation.method(#getConfigUrl, [type])), + returnValue: _i16.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), ) as String); @override - _i13.Future<_i9.BaseConfig> editConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#editConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#addConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @@ -432,7 +510,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future handleConfig(_i8.SlotEntry? entry, num? value, _i8.ConfigType? type) => + _i13.Future handleConfig( + _i8.SlotEntry? entry, + num? value, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), returnValue: _i13.Future.value(), @@ -444,16 +526,24 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i13.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value(<_i10.WorkoutSession>[]), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), ) as _i13.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession(_i10.WorkoutSession? session, int? routineId) => + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#addSession, [session, routineId])), + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -463,7 +553,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#editSession, [session]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#editSession, [session])), + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -500,10 +593,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @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, + ); } diff --git a/test/routine/routine_edit_test.mocks.dart b/test/routine/routine_edit_test.mocks.dart index 11e15eb9..987b6dd8 100644 --- a/test/routine/routine_edit_test.mocks.dart +++ b/test/routine/routine_edit_test.mocks.dart @@ -37,47 +37,57 @@ import 'package:wger/providers/routines.dart' as _i12; // ignore_for_file: subtype_of_sealed_class // ignore_for_file: invalid_use_of_internal_member -class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake + implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake + implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake + implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -92,44 +102,64 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), ) as _i2.WgerBaseProvider); @override List<_i5.Routine> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override List<_i3.WeightUnit> get weightUnits => - (super.noSuchMethod(Invocation.getter(#weightUnits), returnValue: <_i3.WeightUnit>[]) + (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); @override _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_1(this, Invocation.getter(#defaultWeightUnit)), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), ) as _i3.WeightUnit); @override List<_i4.RepetitionUnit> get repetitionUnits => - (super.noSuchMethod(Invocation.getter(#repetitionUnits), returnValue: <_i4.RepetitionUnit>[]) + (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); @override _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_2(this, Invocation.getter(#defaultRepetitionUnit)), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), ) as _i4.RepetitionUnit); @override - set activeRoutine(_i5.Routine? value) => - super.noSuchMethod(Invocation.setter(#activeRoutine, value), returnValueForMissingStub: null); + set activeRoutine(_i5.Routine? value) => super.noSuchMethod( + Invocation.setter(#activeRoutine, value), + returnValueForMissingStub: null, + ); @override set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( @@ -138,24 +168,31 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => + super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); @override _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( Invocation.method(#findWeightUnitById, [id]), - returnValue: _FakeWeightUnit_1(this, Invocation.method(#findWeightUnitById, [id])), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), ) as _i3.WeightUnit); @@ -172,20 +209,30 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { @override List<_i5.Routine> getPlans() => - (super.noSuchMethod(Invocation.method(#getPlans, []), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override _i5.Routine findById(int? id) => (super.noSuchMethod( Invocation.method(#findById, [id]), - returnValue: _FakeRoutine_3(this, Invocation.method(#findById, [id])), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), ) as _i5.Routine); @override int findIndexById(int? id) => - (super.noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) as int); + (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) + as int); @override _i13.Future fetchAndSetAllRoutinesFull() => @@ -211,7 +258,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { Map? exercises, }) => (super.noSuchMethod( - Invocation.method(#setExercisesAndUnits, [entries], {#exercises: exercises}), + Invocation.method( + #setExercisesAndUnits, + [entries], + {#exercises: exercises}, + ), returnValue: _i13.Future.value(), returnValueForMissingStub: _i13.Future.value(), ) @@ -222,7 +273,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineSparse, [planId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -232,7 +286,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineFull, [routineId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -367,11 +424,17 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), returnValue: _i13.Future<_i8.SlotEntry>.value( - _FakeSlotEntry_6(this, Invocation.method(#addSlotEntry, [entry, routineId])), + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), ), ) as _i13.Future<_i8.SlotEntry>); @@ -398,26 +461,41 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue(this, Invocation.method(#getConfigUrl, [type])), + returnValue: _i16.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), ) as String); @override - _i13.Future<_i9.BaseConfig> editConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#editConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#addConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @@ -432,7 +510,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future handleConfig(_i8.SlotEntry? entry, num? value, _i8.ConfigType? type) => + _i13.Future handleConfig( + _i8.SlotEntry? entry, + num? value, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), returnValue: _i13.Future.value(), @@ -444,16 +526,24 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i13.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value(<_i10.WorkoutSession>[]), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), ) as _i13.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession(_i10.WorkoutSession? session, int? routineId) => + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#addSession, [session, routineId])), + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -463,7 +553,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#editSession, [session]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#editSession, [session])), + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -500,10 +593,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @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, + ); } diff --git a/test/routine/routine_form_test.mocks.dart b/test/routine/routine_form_test.mocks.dart index 84648c71..da9d8652 100644 --- a/test/routine/routine_form_test.mocks.dart +++ b/test/routine/routine_form_test.mocks.dart @@ -37,47 +37,57 @@ import 'package:wger/providers/routines.dart' as _i12; // ignore_for_file: subtype_of_sealed_class // ignore_for_file: invalid_use_of_internal_member -class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake + implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake + implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake + implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -92,44 +102,64 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), ) as _i2.WgerBaseProvider); @override List<_i5.Routine> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override List<_i3.WeightUnit> get weightUnits => - (super.noSuchMethod(Invocation.getter(#weightUnits), returnValue: <_i3.WeightUnit>[]) + (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); @override _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_1(this, Invocation.getter(#defaultWeightUnit)), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), ) as _i3.WeightUnit); @override List<_i4.RepetitionUnit> get repetitionUnits => - (super.noSuchMethod(Invocation.getter(#repetitionUnits), returnValue: <_i4.RepetitionUnit>[]) + (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); @override _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_2(this, Invocation.getter(#defaultRepetitionUnit)), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), ) as _i4.RepetitionUnit); @override - set activeRoutine(_i5.Routine? value) => - super.noSuchMethod(Invocation.setter(#activeRoutine, value), returnValueForMissingStub: null); + set activeRoutine(_i5.Routine? value) => super.noSuchMethod( + Invocation.setter(#activeRoutine, value), + returnValueForMissingStub: null, + ); @override set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( @@ -138,24 +168,31 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => + super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); @override _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( Invocation.method(#findWeightUnitById, [id]), - returnValue: _FakeWeightUnit_1(this, Invocation.method(#findWeightUnitById, [id])), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), ) as _i3.WeightUnit); @@ -172,20 +209,30 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { @override List<_i5.Routine> getPlans() => - (super.noSuchMethod(Invocation.method(#getPlans, []), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override _i5.Routine findById(int? id) => (super.noSuchMethod( Invocation.method(#findById, [id]), - returnValue: _FakeRoutine_3(this, Invocation.method(#findById, [id])), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), ) as _i5.Routine); @override int findIndexById(int? id) => - (super.noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) as int); + (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) + as int); @override _i13.Future fetchAndSetAllRoutinesFull() => @@ -211,7 +258,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { Map? exercises, }) => (super.noSuchMethod( - Invocation.method(#setExercisesAndUnits, [entries], {#exercises: exercises}), + Invocation.method( + #setExercisesAndUnits, + [entries], + {#exercises: exercises}, + ), returnValue: _i13.Future.value(), returnValueForMissingStub: _i13.Future.value(), ) @@ -222,7 +273,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineSparse, [planId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -232,7 +286,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineFull, [routineId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -367,11 +424,17 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), returnValue: _i13.Future<_i8.SlotEntry>.value( - _FakeSlotEntry_6(this, Invocation.method(#addSlotEntry, [entry, routineId])), + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), ), ) as _i13.Future<_i8.SlotEntry>); @@ -398,26 +461,41 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue(this, Invocation.method(#getConfigUrl, [type])), + returnValue: _i16.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), ) as String); @override - _i13.Future<_i9.BaseConfig> editConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#editConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#addConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @@ -432,7 +510,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future handleConfig(_i8.SlotEntry? entry, num? value, _i8.ConfigType? type) => + _i13.Future handleConfig( + _i8.SlotEntry? entry, + num? value, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), returnValue: _i13.Future.value(), @@ -444,16 +526,24 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i13.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value(<_i10.WorkoutSession>[]), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), ) as _i13.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession(_i10.WorkoutSession? session, int? routineId) => + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#addSession, [session, routineId])), + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -463,7 +553,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#editSession, [session]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#editSession, [session])), + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -500,10 +593,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @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, + ); } diff --git a/test/routine/routine_logs_screen_test.mocks.dart b/test/routine/routine_logs_screen_test.mocks.dart index 24560f3c..06ad51e8 100644 --- a/test/routine/routine_logs_screen_test.mocks.dart +++ b/test/routine/routine_logs_screen_test.mocks.dart @@ -37,47 +37,57 @@ import 'package:wger/providers/routines.dart' as _i12; // ignore_for_file: subtype_of_sealed_class // ignore_for_file: invalid_use_of_internal_member -class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake + implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake + implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake + implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -92,44 +102,64 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), ) as _i2.WgerBaseProvider); @override List<_i5.Routine> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override List<_i3.WeightUnit> get weightUnits => - (super.noSuchMethod(Invocation.getter(#weightUnits), returnValue: <_i3.WeightUnit>[]) + (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); @override _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_1(this, Invocation.getter(#defaultWeightUnit)), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), ) as _i3.WeightUnit); @override List<_i4.RepetitionUnit> get repetitionUnits => - (super.noSuchMethod(Invocation.getter(#repetitionUnits), returnValue: <_i4.RepetitionUnit>[]) + (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); @override _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_2(this, Invocation.getter(#defaultRepetitionUnit)), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), ) as _i4.RepetitionUnit); @override - set activeRoutine(_i5.Routine? value) => - super.noSuchMethod(Invocation.setter(#activeRoutine, value), returnValueForMissingStub: null); + set activeRoutine(_i5.Routine? value) => super.noSuchMethod( + Invocation.setter(#activeRoutine, value), + returnValueForMissingStub: null, + ); @override set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( @@ -138,24 +168,31 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => + super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); @override _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( Invocation.method(#findWeightUnitById, [id]), - returnValue: _FakeWeightUnit_1(this, Invocation.method(#findWeightUnitById, [id])), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), ) as _i3.WeightUnit); @@ -172,20 +209,30 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { @override List<_i5.Routine> getPlans() => - (super.noSuchMethod(Invocation.method(#getPlans, []), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override _i5.Routine findById(int? id) => (super.noSuchMethod( Invocation.method(#findById, [id]), - returnValue: _FakeRoutine_3(this, Invocation.method(#findById, [id])), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), ) as _i5.Routine); @override int findIndexById(int? id) => - (super.noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) as int); + (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) + as int); @override _i13.Future fetchAndSetAllRoutinesFull() => @@ -211,7 +258,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { Map? exercises, }) => (super.noSuchMethod( - Invocation.method(#setExercisesAndUnits, [entries], {#exercises: exercises}), + Invocation.method( + #setExercisesAndUnits, + [entries], + {#exercises: exercises}, + ), returnValue: _i13.Future.value(), returnValueForMissingStub: _i13.Future.value(), ) @@ -222,7 +273,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineSparse, [planId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -232,7 +286,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineFull, [routineId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -367,11 +424,17 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), returnValue: _i13.Future<_i8.SlotEntry>.value( - _FakeSlotEntry_6(this, Invocation.method(#addSlotEntry, [entry, routineId])), + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), ), ) as _i13.Future<_i8.SlotEntry>); @@ -398,26 +461,41 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue(this, Invocation.method(#getConfigUrl, [type])), + returnValue: _i16.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), ) as String); @override - _i13.Future<_i9.BaseConfig> editConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#editConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#addConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @@ -432,7 +510,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future handleConfig(_i8.SlotEntry? entry, num? value, _i8.ConfigType? type) => + _i13.Future handleConfig( + _i8.SlotEntry? entry, + num? value, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), returnValue: _i13.Future.value(), @@ -444,16 +526,24 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i13.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value(<_i10.WorkoutSession>[]), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), ) as _i13.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession(_i10.WorkoutSession? session, int? routineId) => + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#addSession, [session, routineId])), + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -463,7 +553,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#editSession, [session]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#editSession, [session])), + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -500,10 +593,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @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, + ); } diff --git a/test/routine/routine_screen_test.mocks.dart b/test/routine/routine_screen_test.mocks.dart index 73f33eef..7dd26815 100644 --- a/test/routine/routine_screen_test.mocks.dart +++ b/test/routine/routine_screen_test.mocks.dart @@ -26,19 +26,23 @@ import 'package:wger/providers/base_provider.dart' as _i4; // ignore_for_file: invalid_use_of_internal_member class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider { - _FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeAuthProvider_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeClient_1 extends _i1.SmartFake implements _i3.Client { - _FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeClient_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeUri_2 extends _i1.SmartFake implements Uri { - _FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeUri_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { - _FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeResponse_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [WgerBaseProvider]. @@ -66,23 +70,34 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { as _i3.Client); @override - set auth(_i2.AuthProvider? value) => - super.noSuchMethod(Invocation.setter(#auth, value), returnValueForMissingStub: null); + set auth(_i2.AuthProvider? value) => super.noSuchMethod( + Invocation.setter(#auth, value), + returnValueForMissingStub: null, + ); @override - set client(_i3.Client? value) => - super.noSuchMethod(Invocation.setter(#client, value), returnValueForMissingStub: null); + set client(_i3.Client? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override Map getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod( - Invocation.method(#getDefaultHeaders, [], {#includeAuth: includeAuth}), + Invocation.method(#getDefaultHeaders, [], { + #includeAuth: includeAuth, + }), returnValue: {}, ) as Map); @override - Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => + Uri makeUrl( + String? path, { + int? id, + String? objectMethod, + Map? query, + }) => (super.noSuchMethod( Invocation.method( #makeUrl, @@ -120,15 +135,22 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { _i5.Future> post(Map? data, Uri? uri) => (super.noSuchMethod( Invocation.method(#post, [data, uri]), - returnValue: _i5.Future>.value({}), + returnValue: _i5.Future>.value( + {}, + ), ) as _i5.Future>); @override - _i5.Future> patch(Map? data, Uri? uri) => + _i5.Future> patch( + Map? data, + Uri? uri, + ) => (super.noSuchMethod( Invocation.method(#patch, [data, uri]), - returnValue: _i5.Future>.value({}), + returnValue: _i5.Future>.value( + {}, + ), ) as _i5.Future>); @@ -137,7 +159,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { (super.noSuchMethod( Invocation.method(#deleteRequest, [url, id]), returnValue: _i5.Future<_i3.Response>.value( - _FakeResponse_3(this, Invocation.method(#deleteRequest, [url, id])), + _FakeResponse_3( + this, + Invocation.method(#deleteRequest, [url, id]), + ), ), ) as _i5.Future<_i3.Response>); diff --git a/test/routine/routines_provider_test.mocks.dart b/test/routine/routines_provider_test.mocks.dart index c949f79b..85950e7b 100644 --- a/test/routine/routines_provider_test.mocks.dart +++ b/test/routine/routines_provider_test.mocks.dart @@ -34,50 +34,61 @@ import 'package:wger/providers/exercises.dart' as _i12; // ignore_for_file: invalid_use_of_internal_member class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider { - _FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeAuthProvider_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeClient_1 extends _i1.SmartFake implements _i3.Client { - _FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeClient_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeUri_2 extends _i1.SmartFake implements Uri { - _FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeUri_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { - _FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeResponse_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWgerBaseProvider_4 extends _i1.SmartFake implements _i4.WgerBaseProvider { +class _FakeWgerBaseProvider_4 extends _i1.SmartFake + implements _i4.WgerBaseProvider { _FakeWgerBaseProvider_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeExerciseDatabase_5 extends _i1.SmartFake implements _i5.ExerciseDatabase { +class _FakeExerciseDatabase_5 extends _i1.SmartFake + implements _i5.ExerciseDatabase { _FakeExerciseDatabase_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeExercise_6 extends _i1.SmartFake implements _i6.Exercise { - _FakeExercise_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeExercise_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeExerciseCategory_7 extends _i1.SmartFake implements _i7.ExerciseCategory { +class _FakeExerciseCategory_7 extends _i1.SmartFake + implements _i7.ExerciseCategory { _FakeExerciseCategory_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeEquipment_8 extends _i1.SmartFake implements _i8.Equipment { - _FakeEquipment_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeEquipment_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeMuscle_9 extends _i1.SmartFake implements _i9.Muscle { - _FakeMuscle_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeMuscle_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeLanguage_10 extends _i1.SmartFake implements _i10.Language { - _FakeLanguage_10(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeLanguage_10(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [WgerBaseProvider]. @@ -105,23 +116,34 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { as _i3.Client); @override - set auth(_i2.AuthProvider? value) => - super.noSuchMethod(Invocation.setter(#auth, value), returnValueForMissingStub: null); + set auth(_i2.AuthProvider? value) => super.noSuchMethod( + Invocation.setter(#auth, value), + returnValueForMissingStub: null, + ); @override - set client(_i3.Client? value) => - super.noSuchMethod(Invocation.setter(#client, value), returnValueForMissingStub: null); + set client(_i3.Client? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override Map getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod( - Invocation.method(#getDefaultHeaders, [], {#includeAuth: includeAuth}), + Invocation.method(#getDefaultHeaders, [], { + #includeAuth: includeAuth, + }), returnValue: {}, ) as Map); @override - Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => + Uri makeUrl( + String? path, { + int? id, + String? objectMethod, + Map? query, + }) => (super.noSuchMethod( Invocation.method( #makeUrl, @@ -156,18 +178,28 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { as _i11.Future>); @override - _i11.Future> post(Map? data, Uri? uri) => + _i11.Future> post( + Map? data, + Uri? uri, + ) => (super.noSuchMethod( Invocation.method(#post, [data, uri]), - returnValue: _i11.Future>.value({}), + returnValue: _i11.Future>.value( + {}, + ), ) as _i11.Future>); @override - _i11.Future> patch(Map? data, Uri? uri) => + _i11.Future> patch( + Map? data, + Uri? uri, + ) => (super.noSuchMethod( Invocation.method(#patch, [data, uri]), - returnValue: _i11.Future>.value({}), + returnValue: _i11.Future>.value( + {}, + ), ) as _i11.Future>); @@ -176,7 +208,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { (super.noSuchMethod( Invocation.method(#deleteRequest, [url, id]), returnValue: _i11.Future<_i3.Response>.value( - _FakeResponse_3(this, Invocation.method(#deleteRequest, [url, id])), + _FakeResponse_3( + this, + Invocation.method(#deleteRequest, [url, id]), + ), ), ) as _i11.Future<_i3.Response>); @@ -194,7 +229,10 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { _i4.WgerBaseProvider get baseProvider => (super.noSuchMethod( Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_4(this, Invocation.getter(#baseProvider)), + returnValue: _FakeWgerBaseProvider_4( + this, + Invocation.getter(#baseProvider), + ), ) as _i4.WgerBaseProvider); @@ -202,18 +240,27 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { _i5.ExerciseDatabase get database => (super.noSuchMethod( Invocation.getter(#database), - returnValue: _FakeExerciseDatabase_5(this, Invocation.getter(#database)), + returnValue: _FakeExerciseDatabase_5( + this, + Invocation.getter(#database), + ), ) as _i5.ExerciseDatabase); @override List<_i6.Exercise> get exercises => - (super.noSuchMethod(Invocation.getter(#exercises), returnValue: <_i6.Exercise>[]) + (super.noSuchMethod( + Invocation.getter(#exercises), + returnValue: <_i6.Exercise>[], + ) as List<_i6.Exercise>); @override List<_i6.Exercise> get filteredExercises => - (super.noSuchMethod(Invocation.getter(#filteredExercises), returnValue: <_i6.Exercise>[]) + (super.noSuchMethod( + Invocation.getter(#filteredExercises), + returnValue: <_i6.Exercise>[], + ) as List<_i6.Exercise>); @override @@ -226,45 +273,65 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { @override List<_i7.ExerciseCategory> get categories => - (super.noSuchMethod(Invocation.getter(#categories), returnValue: <_i7.ExerciseCategory>[]) + (super.noSuchMethod( + Invocation.getter(#categories), + returnValue: <_i7.ExerciseCategory>[], + ) as List<_i7.ExerciseCategory>); @override List<_i9.Muscle> get muscles => - (super.noSuchMethod(Invocation.getter(#muscles), returnValue: <_i9.Muscle>[]) + (super.noSuchMethod( + Invocation.getter(#muscles), + returnValue: <_i9.Muscle>[], + ) as List<_i9.Muscle>); @override List<_i8.Equipment> get equipment => - (super.noSuchMethod(Invocation.getter(#equipment), returnValue: <_i8.Equipment>[]) + (super.noSuchMethod( + Invocation.getter(#equipment), + returnValue: <_i8.Equipment>[], + ) as List<_i8.Equipment>); @override List<_i10.Language> get languages => - (super.noSuchMethod(Invocation.getter(#languages), returnValue: <_i10.Language>[]) + (super.noSuchMethod( + Invocation.getter(#languages), + returnValue: <_i10.Language>[], + ) as List<_i10.Language>); @override - set database(_i5.ExerciseDatabase? value) => - super.noSuchMethod(Invocation.setter(#database, value), returnValueForMissingStub: null); - - @override - set exercises(List<_i6.Exercise>? value) => - super.noSuchMethod(Invocation.setter(#exercises, value), returnValueForMissingStub: null); - - @override - set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => super.noSuchMethod( - Invocation.setter(#filteredExercises, newFilteredExercises), + set database(_i5.ExerciseDatabase? value) => super.noSuchMethod( + Invocation.setter(#database, value), returnValueForMissingStub: null, ); @override - set languages(List<_i10.Language>? languages) => - super.noSuchMethod(Invocation.setter(#languages, languages), returnValueForMissingStub: null); + set exercises(List<_i6.Exercise>? value) => super.noSuchMethod( + Invocation.setter(#exercises, value), + returnValueForMissingStub: null, + ); + + @override + set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => + super.noSuchMethod( + Invocation.setter(#filteredExercises, newFilteredExercises), + returnValueForMissingStub: null, + ); + + @override + set languages(List<_i10.Language>? languages) => super.noSuchMethod( + Invocation.setter(#languages, languages), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override _i11.Future setFilters(_i12.Filters? newFilters) => @@ -276,8 +343,10 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { as _i11.Future); @override - void initFilters() => - super.noSuchMethod(Invocation.method(#initFilters, []), returnValueForMissingStub: null); + void initFilters() => super.noSuchMethod( + Invocation.method(#initFilters, []), + returnValueForMissingStub: null, + ); @override _i11.Future findByFilters() => @@ -289,19 +358,27 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { as _i11.Future); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); @override _i6.Exercise findExerciseById(int? id) => (super.noSuchMethod( Invocation.method(#findExerciseById, [id]), - returnValue: _FakeExercise_6(this, Invocation.method(#findExerciseById, [id])), + returnValue: _FakeExercise_6( + this, + Invocation.method(#findExerciseById, [id]), + ), ) as _i6.Exercise); @override - List<_i6.Exercise> findExercisesByVariationId(int? variationId, {int? exerciseIdToExclude}) => + List<_i6.Exercise> findExercisesByVariationId( + int? variationId, { + int? exerciseIdToExclude, + }) => (super.noSuchMethod( Invocation.method( #findExercisesByVariationId, @@ -316,7 +393,10 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { _i7.ExerciseCategory findCategoryById(int? id) => (super.noSuchMethod( Invocation.method(#findCategoryById, [id]), - returnValue: _FakeExerciseCategory_7(this, Invocation.method(#findCategoryById, [id])), + returnValue: _FakeExerciseCategory_7( + this, + Invocation.method(#findCategoryById, [id]), + ), ) as _i7.ExerciseCategory); @@ -324,7 +404,10 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { _i8.Equipment findEquipmentById(int? id) => (super.noSuchMethod( Invocation.method(#findEquipmentById, [id]), - returnValue: _FakeEquipment_8(this, Invocation.method(#findEquipmentById, [id])), + returnValue: _FakeEquipment_8( + this, + Invocation.method(#findEquipmentById, [id]), + ), ) as _i8.Equipment); @@ -332,7 +415,10 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { _i9.Muscle findMuscleById(int? id) => (super.noSuchMethod( Invocation.method(#findMuscleById, [id]), - returnValue: _FakeMuscle_9(this, Invocation.method(#findMuscleById, [id])), + returnValue: _FakeMuscle_9( + this, + Invocation.method(#findMuscleById, [id]), + ), ) as _i9.Muscle); @@ -340,7 +426,10 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { _i10.Language findLanguageById(int? id) => (super.noSuchMethod( Invocation.method(#findLanguageById, [id]), - returnValue: _FakeLanguage_10(this, Invocation.method(#findLanguageById, [id])), + returnValue: _FakeLanguage_10( + this, + Invocation.method(#findLanguageById, [id]), + ), ) as _i10.Language); @@ -403,11 +492,17 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { int? exerciseId, ) => (super.noSuchMethod( - Invocation.method(#handleUpdateExerciseFromApi, [database, exerciseId]), + Invocation.method(#handleUpdateExerciseFromApi, [ + database, + exerciseId, + ]), returnValue: _i11.Future<_i6.Exercise>.value( _FakeExercise_6( this, - Invocation.method(#handleUpdateExerciseFromApi, [database, exerciseId]), + Invocation.method(#handleUpdateExerciseFromApi, [ + database, + exerciseId, + ]), ), ), ) @@ -416,7 +511,9 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { @override _i11.Future initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod( - Invocation.method(#initCacheTimesLocalPrefs, [], {#forceInit: forceInit}), + Invocation.method(#initCacheTimesLocalPrefs, [], { + #forceInit: forceInit, + }), returnValue: _i11.Future.value(), returnValueForMissingStub: _i11.Future.value(), ) @@ -513,7 +610,9 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { [name], {#languageCode: languageCode, #searchEnglish: searchEnglish}, ), - returnValue: _i11.Future>.value(<_i6.Exercise>[]), + returnValue: _i11.Future>.value( + <_i6.Exercise>[], + ), ) as _i11.Future>); @@ -530,10 +629,14 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { ); @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, + ); } diff --git a/test/routine/routines_screen_test.mocks.dart b/test/routine/routines_screen_test.mocks.dart index 48952b88..082ffa09 100644 --- a/test/routine/routines_screen_test.mocks.dart +++ b/test/routine/routines_screen_test.mocks.dart @@ -26,19 +26,23 @@ import 'package:wger/providers/base_provider.dart' as _i4; // ignore_for_file: invalid_use_of_internal_member class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider { - _FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeAuthProvider_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeClient_1 extends _i1.SmartFake implements _i3.Client { - _FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeClient_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeUri_2 extends _i1.SmartFake implements Uri { - _FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeUri_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { - _FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeResponse_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [WgerBaseProvider]. @@ -66,23 +70,34 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { as _i3.Client); @override - set auth(_i2.AuthProvider? value) => - super.noSuchMethod(Invocation.setter(#auth, value), returnValueForMissingStub: null); + set auth(_i2.AuthProvider? value) => super.noSuchMethod( + Invocation.setter(#auth, value), + returnValueForMissingStub: null, + ); @override - set client(_i3.Client? value) => - super.noSuchMethod(Invocation.setter(#client, value), returnValueForMissingStub: null); + set client(_i3.Client? value) => super.noSuchMethod( + Invocation.setter(#client, value), + returnValueForMissingStub: null, + ); @override Map getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod( - Invocation.method(#getDefaultHeaders, [], {#includeAuth: includeAuth}), + Invocation.method(#getDefaultHeaders, [], { + #includeAuth: includeAuth, + }), returnValue: {}, ) as Map); @override - Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => + Uri makeUrl( + String? path, { + int? id, + String? objectMethod, + Map? query, + }) => (super.noSuchMethod( Invocation.method( #makeUrl, @@ -120,15 +135,22 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { _i5.Future> post(Map? data, Uri? uri) => (super.noSuchMethod( Invocation.method(#post, [data, uri]), - returnValue: _i5.Future>.value({}), + returnValue: _i5.Future>.value( + {}, + ), ) as _i5.Future>); @override - _i5.Future> patch(Map? data, Uri? uri) => + _i5.Future> patch( + Map? data, + Uri? uri, + ) => (super.noSuchMethod( Invocation.method(#patch, [data, uri]), - returnValue: _i5.Future>.value({}), + returnValue: _i5.Future>.value( + {}, + ), ) as _i5.Future>); @@ -137,7 +159,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { (super.noSuchMethod( Invocation.method(#deleteRequest, [url, id]), returnValue: _i5.Future<_i3.Response>.value( - _FakeResponse_3(this, Invocation.method(#deleteRequest, [url, id])), + _FakeResponse_3( + this, + Invocation.method(#deleteRequest, [url, id]), + ), ), ) as _i5.Future<_i3.Response>); diff --git a/test/routine/slot_entry_form_test.dart b/test/routine/slot_entry_form_test.dart index 711756a3..81ec22a2 100644 --- a/test/routine/slot_entry_form_test.dart +++ b/test/routine/slot_entry_form_test.dart @@ -23,6 +23,7 @@ import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; import 'package:wger/helpers/consts.dart'; import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/models/workouts/slot_entry.dart'; import 'package:wger/providers/routines.dart'; import 'package:wger/widgets/routines/forms/reps_unit.dart'; import 'package:wger/widgets/routines/forms/rir.dart'; @@ -67,6 +68,7 @@ void main() { expect(find.byType(TextFormField), findsNWidgets(2)); expect(find.byType(Slider), findsOne); + expect(find.byType(DropdownButtonFormField), findsNothing); expect(find.byType(WeightUnitInputWidget), findsNothing); expect(find.byType(RepetitionUnitInputWidget), findsNothing); expect(find.byType(RiRInputWidget), findsNothing); @@ -78,18 +80,80 @@ void main() { expect(find.byType(TextFormField), findsNWidgets(6)); expect(find.byType(Slider), findsNWidgets(2)); + expect(find.byType(DropdownButtonFormField), findsNothing); expect(find.byType(WeightUnitInputWidget), findsOne); expect(find.byType(RepetitionUnitInputWidget), findsOne); expect(find.byType(RiRInputWidget), findsOne); }); testWidgets('Correctly updates the values on the server', (WidgetTester tester) async { - await tester.pumpWidget(renderWidget(simpleMode: true)); - await tester.pumpAndSettle(); - await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); + await tester.pumpWidget(renderWidget(simpleMode: false)); await tester.pumpAndSettle(); - verify(mockRoutinesProvider.editSlotEntry(any, any)).called(1); - verify(mockRoutinesProvider.handleConfig(any, any, any)).called(8); + // Set weight + final weightField = find.byKey(const ValueKey('field-weight')); + await tester.enterText(weightField, '100'); + + final maxWeightField = find.byKey(const ValueKey('field-max-weight')); + await tester.enterText(maxWeightField, '110'); + + // Set repetitions + final repetitionsField = find.byKey(const ValueKey('field-repetitions')); + await tester.enterText(repetitionsField, '10'); + final maxRepetitionsField = find.byKey(const ValueKey('field-max-repetitions')); + await tester.enterText(maxRepetitionsField, '12'); + + // Set rest time + final restField = find.byKey(const ValueKey('field-rest')); + await tester.enterText(restField, '90'); + final maxRestField = find.byKey(const ValueKey('field-max-rest')); + await tester.enterText(maxRestField, '100'); + + // Set type + await tester.tap(find.byKey(const ValueKey('field-slot-entry-type'))); + await tester.pumpAndSettle(); + await tester.ensureVisible(find.byKey(const ValueKey('slot-entry-type-option-myo'))); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const ValueKey('slot-entry-type-option-myo')), warnIfMissed: false); + await tester.pumpAndSettle(); + + await tester.tap(find.byKey(const ValueKey(SUBMIT_BUTTON_KEY_NAME))); + await tester.pumpAndSettle(); + + verify( + mockRoutinesProvider.editSlotEntry( + argThat( + isA() + .having((d) => d.id, 'id', null) + .having((d) => d.slotId, 'slotId', 1) + .having((d) => d.order, 'order', 1) + .having((d) => d.type, 'type', SlotEntryType.myo), + ), + 1, + ), + ); + + final verification = verify( + mockRoutinesProvider.handleConfig(captureAny, captureAny, captureAny), + ); + final capturedArgs = verification.captured; // List with 8*3 arguments (3 per call) + + expect(capturedArgs[(0 * 3) + 1], 4); + expect(capturedArgs[(0 * 3) + 2], ConfigType.sets); + + expect(capturedArgs[(1 * 3) + 1], 100); + expect(capturedArgs[(1 * 3) + 2], ConfigType.weight); + expect(capturedArgs[(2 * 3) + 1], 110); + expect(capturedArgs[(2 * 3) + 2], ConfigType.maxWeight); + + expect(capturedArgs[(3 * 3) + 1], 10); + expect(capturedArgs[(3 * 3) + 2], ConfigType.repetitions); + expect(capturedArgs[(4 * 3) + 1], 12); + expect(capturedArgs[(4 * 3) + 2], ConfigType.maxRepetitions); + + expect(capturedArgs[(5 * 3) + 1], 90); + expect(capturedArgs[(5 * 3) + 2], ConfigType.rest); + expect(capturedArgs[(6 * 3) + 1], 100); + expect(capturedArgs[(6 * 3) + 2], ConfigType.maxRest); }); } diff --git a/test/routine/slot_entry_form_test.mocks.dart b/test/routine/slot_entry_form_test.mocks.dart index c9606827..d9920e6d 100644 --- a/test/routine/slot_entry_form_test.mocks.dart +++ b/test/routine/slot_entry_form_test.mocks.dart @@ -37,47 +37,57 @@ import 'package:wger/providers/routines.dart' as _i12; // ignore_for_file: subtype_of_sealed_class // ignore_for_file: invalid_use_of_internal_member -class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake + implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake + implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake + implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -92,44 +102,64 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), ) as _i2.WgerBaseProvider); @override List<_i5.Routine> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override List<_i3.WeightUnit> get weightUnits => - (super.noSuchMethod(Invocation.getter(#weightUnits), returnValue: <_i3.WeightUnit>[]) + (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); @override _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_1(this, Invocation.getter(#defaultWeightUnit)), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), ) as _i3.WeightUnit); @override List<_i4.RepetitionUnit> get repetitionUnits => - (super.noSuchMethod(Invocation.getter(#repetitionUnits), returnValue: <_i4.RepetitionUnit>[]) + (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); @override _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_2(this, Invocation.getter(#defaultRepetitionUnit)), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), ) as _i4.RepetitionUnit); @override - set activeRoutine(_i5.Routine? value) => - super.noSuchMethod(Invocation.setter(#activeRoutine, value), returnValueForMissingStub: null); + set activeRoutine(_i5.Routine? value) => super.noSuchMethod( + Invocation.setter(#activeRoutine, value), + returnValueForMissingStub: null, + ); @override set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( @@ -138,24 +168,31 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => + super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); @override _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( Invocation.method(#findWeightUnitById, [id]), - returnValue: _FakeWeightUnit_1(this, Invocation.method(#findWeightUnitById, [id])), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), ) as _i3.WeightUnit); @@ -172,20 +209,30 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { @override List<_i5.Routine> getPlans() => - (super.noSuchMethod(Invocation.method(#getPlans, []), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override _i5.Routine findById(int? id) => (super.noSuchMethod( Invocation.method(#findById, [id]), - returnValue: _FakeRoutine_3(this, Invocation.method(#findById, [id])), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), ) as _i5.Routine); @override int findIndexById(int? id) => - (super.noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) as int); + (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) + as int); @override _i13.Future fetchAndSetAllRoutinesFull() => @@ -211,7 +258,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { Map? exercises, }) => (super.noSuchMethod( - Invocation.method(#setExercisesAndUnits, [entries], {#exercises: exercises}), + Invocation.method( + #setExercisesAndUnits, + [entries], + {#exercises: exercises}, + ), returnValue: _i13.Future.value(), returnValueForMissingStub: _i13.Future.value(), ) @@ -222,7 +273,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineSparse, [planId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -232,7 +286,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineFull, [routineId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -367,11 +424,17 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), returnValue: _i13.Future<_i8.SlotEntry>.value( - _FakeSlotEntry_6(this, Invocation.method(#addSlotEntry, [entry, routineId])), + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), ), ) as _i13.Future<_i8.SlotEntry>); @@ -398,26 +461,41 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue(this, Invocation.method(#getConfigUrl, [type])), + returnValue: _i16.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), ) as String); @override - _i13.Future<_i9.BaseConfig> editConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#editConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#addConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @@ -432,7 +510,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future handleConfig(_i8.SlotEntry? entry, num? value, _i8.ConfigType? type) => + _i13.Future handleConfig( + _i8.SlotEntry? entry, + num? value, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), returnValue: _i13.Future.value(), @@ -444,16 +526,24 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i13.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value(<_i10.WorkoutSession>[]), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), ) as _i13.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession(_i10.WorkoutSession? session, int? routineId) => + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#addSession, [session, routineId])), + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -463,7 +553,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#editSession, [session]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#editSession, [session])), + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -500,10 +593,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @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, + ); } diff --git a/test/routine/weight_unit_form_widget_test.dart b/test/routine/weight_unit_form_widget_test.dart index ad096656..231e32ea 100644 --- a/test/routine/weight_unit_form_widget_test.dart +++ b/test/routine/weight_unit_form_widget_test.dart @@ -41,8 +41,6 @@ void main() { final slotEntry = SlotEntry( slotId: 1, - type: 'normal', - order: 1, exerciseId: 1, repetitionUnitId: 1, repetitionRounding: 0.25, diff --git a/test/routine/weight_unit_form_widget_test.mocks.dart b/test/routine/weight_unit_form_widget_test.mocks.dart index c862b9ac..a200f6f3 100644 --- a/test/routine/weight_unit_form_widget_test.mocks.dart +++ b/test/routine/weight_unit_form_widget_test.mocks.dart @@ -37,47 +37,57 @@ import 'package:wger/providers/routines.dart' as _i12; // ignore_for_file: subtype_of_sealed_class // ignore_for_file: invalid_use_of_internal_member -class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake + implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake + implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake + implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -92,44 +102,64 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), ) as _i2.WgerBaseProvider); @override List<_i5.Routine> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override List<_i3.WeightUnit> get weightUnits => - (super.noSuchMethod(Invocation.getter(#weightUnits), returnValue: <_i3.WeightUnit>[]) + (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); @override _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_1(this, Invocation.getter(#defaultWeightUnit)), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), ) as _i3.WeightUnit); @override List<_i4.RepetitionUnit> get repetitionUnits => - (super.noSuchMethod(Invocation.getter(#repetitionUnits), returnValue: <_i4.RepetitionUnit>[]) + (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); @override _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_2(this, Invocation.getter(#defaultRepetitionUnit)), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), ) as _i4.RepetitionUnit); @override - set activeRoutine(_i5.Routine? value) => - super.noSuchMethod(Invocation.setter(#activeRoutine, value), returnValueForMissingStub: null); + set activeRoutine(_i5.Routine? value) => super.noSuchMethod( + Invocation.setter(#activeRoutine, value), + returnValueForMissingStub: null, + ); @override set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( @@ -138,24 +168,31 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => + super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); @override _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( Invocation.method(#findWeightUnitById, [id]), - returnValue: _FakeWeightUnit_1(this, Invocation.method(#findWeightUnitById, [id])), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), ) as _i3.WeightUnit); @@ -172,20 +209,30 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { @override List<_i5.Routine> getPlans() => - (super.noSuchMethod(Invocation.method(#getPlans, []), returnValue: <_i5.Routine>[]) + (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override _i5.Routine findById(int? id) => (super.noSuchMethod( Invocation.method(#findById, [id]), - returnValue: _FakeRoutine_3(this, Invocation.method(#findById, [id])), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), ) as _i5.Routine); @override int findIndexById(int? id) => - (super.noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) as int); + (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) + as int); @override _i13.Future fetchAndSetAllRoutinesFull() => @@ -211,7 +258,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { Map? exercises, }) => (super.noSuchMethod( - Invocation.method(#setExercisesAndUnits, [entries], {#exercises: exercises}), + Invocation.method( + #setExercisesAndUnits, + [entries], + {#exercises: exercises}, + ), returnValue: _i13.Future.value(), returnValueForMissingStub: _i13.Future.value(), ) @@ -222,7 +273,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineSparse, [planId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -232,7 +286,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), returnValue: _i13.Future<_i5.Routine>.value( - _FakeRoutine_3(this, Invocation.method(#fetchAndSetRoutineFull, [routineId])), + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), ), ) as _i13.Future<_i5.Routine>); @@ -367,11 +424,17 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), returnValue: _i13.Future<_i8.SlotEntry>.value( - _FakeSlotEntry_6(this, Invocation.method(#addSlotEntry, [entry, routineId])), + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), ), ) as _i13.Future<_i8.SlotEntry>); @@ -398,26 +461,41 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue(this, Invocation.method(#getConfigUrl, [type])), + returnValue: _i16.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), ) as String); @override - _i13.Future<_i9.BaseConfig> editConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#editConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig(_i9.BaseConfig? config, _i8.ConfigType? type) => + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), returnValue: _i13.Future<_i9.BaseConfig>.value( - _FakeBaseConfig_7(this, Invocation.method(#addConfig, [config, type])), + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), ), ) as _i13.Future<_i9.BaseConfig>); @@ -432,7 +510,11 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as _i13.Future); @override - _i13.Future handleConfig(_i8.SlotEntry? entry, num? value, _i8.ConfigType? type) => + _i13.Future handleConfig( + _i8.SlotEntry? entry, + num? value, + _i8.ConfigType? type, + ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), returnValue: _i13.Future.value(), @@ -444,16 +526,24 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { _i13.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value(<_i10.WorkoutSession>[]), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), ) as _i13.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession(_i10.WorkoutSession? session, int? routineId) => + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#addSession, [session, routineId])), + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -463,7 +553,10 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { (super.noSuchMethod( Invocation.method(#editSession, [session]), returnValue: _i13.Future<_i10.WorkoutSession>.value( - _FakeWorkoutSession_8(this, Invocation.method(#editSession, [session])), + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), ), ) as _i13.Future<_i10.WorkoutSession>); @@ -500,10 +593,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @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, + ); } diff --git a/test_data/routines.dart b/test_data/routines.dart index eb3efb75..73e330a4 100644 --- a/test_data/routines.dart +++ b/test_data/routines.dart @@ -112,7 +112,7 @@ Routine getTestRoutine({List? exercises}) { final slotEntryBenchPress = SlotEntry( slotId: 1, - type: 'normal', + type: SlotEntryType.normal, order: 1, exerciseId: 1, repetitionUnitId: 1, @@ -123,12 +123,8 @@ Routine getTestRoutine({List? exercises}) { repetitionUnit: testRepetitionUnit1, weightUnit: testWeightUnit1, exercise: testExercises[0], - nrOfSetsConfigs: [ - BaseConfig.firstIteration(4, 1), - ], - repetitionsConfigs: [ - BaseConfig.firstIteration(3, 1), - ], + nrOfSetsConfigs: [BaseConfig.firstIteration(4, 1)], + repetitionsConfigs: [BaseConfig.firstIteration(3, 1)], weightConfigs: [ BaseConfig.firstIteration(100, 1), BaseConfig( @@ -144,18 +140,13 @@ Routine getTestRoutine({List? exercises}) { ], ); - final slotBenchPress = Slot.withData( - id: 1, - day: 1, - order: 1, - comment: 'Make sure to warm up', - ); + final slotBenchPress = Slot.withData(id: 1, day: 1, order: 1, comment: 'Make sure to warm up'); slotBenchPress.addExerciseBase(testExercises[0]); slotBenchPress.entries.add(slotEntryBenchPress); final slotEntrySquat = SlotEntry( slotId: 2, - type: 'normal', + type: SlotEntryType.normal, order: 1, exerciseId: 8, repetitionUnitId: 1, @@ -166,15 +157,9 @@ Routine getTestRoutine({List? exercises}) { repetitionUnit: testRepetitionUnit1, weightUnit: testWeightUnit1, exercise: testExercises[4], - weightConfigs: [ - BaseConfig.firstIteration(80, 1), - ], - repetitionsConfigs: [ - BaseConfig.firstIteration(5, 1), - ], - nrOfSetsConfigs: [ - BaseConfig.firstIteration(3, 1), - ], + weightConfigs: [BaseConfig.firstIteration(80, 1)], + repetitionsConfigs: [BaseConfig.firstIteration(5, 1)], + nrOfSetsConfigs: [BaseConfig.firstIteration(3, 1)], ); final slotSquat = Slot.withData(id: 2, day: 1, order: 1); @@ -183,7 +168,7 @@ Routine getTestRoutine({List? exercises}) { final slotEntrySideRaises = SlotEntry( slotId: 2, - type: 'normal', + type: SlotEntryType.normal, order: 1, exerciseId: 8, repetitionUnitId: 1, @@ -194,15 +179,9 @@ Routine getTestRoutine({List? exercises}) { repetitionUnit: testRepetitionUnit1, weightUnit: testWeightUnit1, exercise: testExercises[5], - nrOfSetsConfigs: [ - BaseConfig.firstIteration(4, 1), - ], - repetitionsConfigs: [ - BaseConfig.firstIteration(12, 1), - ], - weightConfigs: [ - BaseConfig.firstIteration(10, 1), - ], + nrOfSetsConfigs: [BaseConfig.firstIteration(4, 1)], + repetitionsConfigs: [BaseConfig.firstIteration(12, 1)], + weightConfigs: [BaseConfig.firstIteration(10, 1)], ); // settingSideRaises.weight = 6;