From c60cfbe347aa41af2517a75f535c667ecb1b7660 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Sun, 26 Oct 2025 18:18:22 +0100 Subject: [PATCH] Add tables for workout sessions --- .../converters/int_to_string_converter.dart | 33 + .../converters/time_of_day_converter.dart | 35 + lib/database/powersync/database.dart | 27 +- lib/database/powersync/database.g.dart | 1629 +++++++++++++++++ lib/database/powersync/tables/routines.dart | 40 +- lib/models/workouts/log.dart | 42 +- lib/models/workouts/log.g.dart | 20 +- lib/models/workouts/session.dart | 19 +- lib/models/workouts/session.g.dart | 20 +- lib/powersync/connector.dart | 2 +- lib/powersync/schema.dart | 34 + lib/providers/body_weight.dart | 18 +- lib/providers/workout_log_repository.dart | 63 + lib/providers/workout_logs.dart | 56 + lib/providers/workout_logs.g.dart | 73 + lib/providers/workout_session.dart | 56 + lib/providers/workout_session.g.dart | 73 + lib/providers/workout_session_repository.dart | 63 + test/core/validators_test.mocks.dart | 40 + test/routine/day_form_test.mocks.dart | 275 +-- .../forms/session_form_test.mocks.dart | 275 +-- test/routine/gym_mode_screen_test.mocks.dart | 489 +++-- .../gym_mode_session_screen_test.mocks.dart | 275 +-- ...epetition_unit_form_widget_test.mocks.dart | 275 +-- .../routine_edit_screen_test.mocks.dart | 275 +-- test/routine/routine_edit_test.mocks.dart | 275 +-- test/routine/routine_form_test.mocks.dart | 275 +-- .../routine_logs_screen_test.mocks.dart | 275 +-- test/routine/slot_entry_form_test.mocks.dart | 275 +-- .../weight_unit_form_widget_test.mocks.dart | 275 +-- test_data/routines.dart | 61 +- 31 files changed, 3972 insertions(+), 1671 deletions(-) create mode 100644 lib/database/converters/int_to_string_converter.dart create mode 100644 lib/database/converters/time_of_day_converter.dart create mode 100644 lib/providers/workout_log_repository.dart create mode 100644 lib/providers/workout_logs.dart create mode 100644 lib/providers/workout_logs.g.dart create mode 100644 lib/providers/workout_session.dart create mode 100644 lib/providers/workout_session.g.dart create mode 100644 lib/providers/workout_session_repository.dart diff --git a/lib/database/converters/int_to_string_converter.dart b/lib/database/converters/int_to_string_converter.dart new file mode 100644 index 000000000..3ea62f5b8 --- /dev/null +++ b/lib/database/converters/int_to_string_converter.dart @@ -0,0 +1,33 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, 2020- wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:drift/drift.dart'; + +class IntToStringConverter extends TypeConverter { + const IntToStringConverter(); + + @override + int fromSql(String fromDb) { + return int.parse(fromDb); + } + + @override + String toSql(int value) { + return value.toString(); + } +} diff --git a/lib/database/converters/time_of_day_converter.dart b/lib/database/converters/time_of_day_converter.dart new file mode 100644 index 000000000..b5ca35bf8 --- /dev/null +++ b/lib/database/converters/time_of_day_converter.dart @@ -0,0 +1,35 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, 2020- wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:drift/drift.dart'; +import 'package:flutter/material.dart'; +import 'package:wger/helpers/json.dart'; + +class TimeOfDayConverter extends TypeConverter { + const TimeOfDayConverter(); + + @override + TimeOfDay fromSql(String fromDb) { + return stringToTimeNull(fromDb)!; + } + + @override + String toSql(TimeOfDay value) { + return timeToString(value)!; + } +} diff --git a/lib/database/powersync/database.dart b/lib/database/powersync/database.dart index 8accd3094..90a15de4c 100644 --- a/lib/database/powersync/database.dart +++ b/lib/database/powersync/database.dart @@ -1,7 +1,28 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + import 'package:drift/drift.dart'; import 'package:drift_sqlite_async/drift_sqlite_async.dart'; +import 'package:flutter/material.dart' show TimeOfDay; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:powersync/powersync.dart' show uuid; +import 'package:wger/database/converters/int_to_string_converter.dart'; +import 'package:wger/database/converters/time_of_day_converter.dart'; import 'package:wger/models/body_weight/weight_entry.dart'; import 'package:wger/models/exercises/category.dart'; import 'package:wger/models/exercises/equipment.dart'; @@ -12,11 +33,14 @@ import 'package:wger/models/exercises/muscle.dart'; import 'package:wger/models/exercises/translation.dart'; import 'package:wger/models/exercises/video.dart'; import 'package:wger/models/measurements/measurement_category.dart'; +import 'package:wger/models/workouts/log.dart'; +import 'package:wger/models/workouts/session.dart'; import 'powersync.dart'; import 'tables/exercise.dart'; import 'tables/language.dart'; import 'tables/measurements.dart'; +import 'tables/routines.dart'; import 'tables/weight.dart'; part 'database.g.dart'; @@ -41,7 +65,8 @@ part 'database.g.dart'; // User data WeightEntryTable, MeasurementCategoryTable, - // WorkoutLogTable, + WorkoutLogTable, + WorkoutSessionTable, ], //include: {'queries.drift'}, ) diff --git a/lib/database/powersync/database.g.dart b/lib/database/powersync/database.g.dart index bbac68ea6..944098ca2 100644 --- a/lib/database/powersync/database.g.dart +++ b/lib/database/powersync/database.g.dart @@ -1,3 +1,21 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // GENERATED CODE - DO NOT MODIFY BY HAND part of 'database.dart'; @@ -3210,6 +3228,944 @@ class MeasurementCategoryTableCompanion extends UpdateCompanion { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + $WorkoutLogTableTable(this.attachedDatabase, [this._alias]); + static const VerificationMeta _idMeta = const VerificationMeta('id'); + @override + late final GeneratedColumn id = GeneratedColumn( + 'id', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: false, + clientDefault: () => uuid.v4(), + ); + static const VerificationMeta _exerciseIdMeta = const VerificationMeta( + 'exerciseId', + ); + @override + late final GeneratedColumn exerciseId = GeneratedColumn( + 'exercise_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + ); + static const VerificationMeta _routineIdMeta = const VerificationMeta( + 'routineId', + ); + @override + late final GeneratedColumn routineId = GeneratedColumn( + 'routine_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + ); + static const VerificationMeta _sessionIdMeta = const VerificationMeta( + 'sessionId', + ); + @override + late final GeneratedColumn sessionId = GeneratedColumn( + 'session_id', + aliasedName, + true, + type: DriftSqlType.int, + requiredDuringInsert: false, + ); + static const VerificationMeta _iterationMeta = const VerificationMeta( + 'iteration', + ); + @override + late final GeneratedColumn iteration = GeneratedColumn( + 'iteration', + aliasedName, + true, + type: DriftSqlType.int, + requiredDuringInsert: false, + ); + static const VerificationMeta _slotEntryIdMeta = const VerificationMeta( + 'slotEntryId', + ); + @override + late final GeneratedColumn slotEntryId = GeneratedColumn( + 'slot_entry_id', + aliasedName, + true, + type: DriftSqlType.int, + requiredDuringInsert: false, + ); + static const VerificationMeta _rirMeta = const VerificationMeta('rir'); + @override + late final GeneratedColumn rir = GeneratedColumn( + 'rir', + aliasedName, + true, + type: DriftSqlType.double, + requiredDuringInsert: false, + ); + static const VerificationMeta _rirTargetMeta = const VerificationMeta( + 'rirTarget', + ); + @override + late final GeneratedColumn rirTarget = GeneratedColumn( + 'rir_target', + aliasedName, + true, + type: DriftSqlType.double, + requiredDuringInsert: false, + ); + static const VerificationMeta _repetitionsMeta = const VerificationMeta( + 'repetitions', + ); + @override + late final GeneratedColumn repetitions = GeneratedColumn( + 'repetitions', + aliasedName, + false, + type: DriftSqlType.double, + requiredDuringInsert: true, + ); + static const VerificationMeta _repetitionsTargetMeta = const VerificationMeta( + 'repetitionsTarget', + ); + @override + late final GeneratedColumn repetitionsTarget = GeneratedColumn( + 'repetitions_target', + aliasedName, + false, + type: DriftSqlType.double, + requiredDuringInsert: true, + ); + static const VerificationMeta _repetitionsUnitIdMeta = const VerificationMeta( + 'repetitionsUnitId', + ); + @override + late final GeneratedColumn repetitionsUnitId = GeneratedColumn( + 'repetitions_unit_id', + aliasedName, + true, + type: DriftSqlType.int, + requiredDuringInsert: false, + ); + static const VerificationMeta _weightMeta = const VerificationMeta('weight'); + @override + late final GeneratedColumn weight = GeneratedColumn( + 'weight', + aliasedName, + false, + type: DriftSqlType.double, + requiredDuringInsert: true, + ); + static const VerificationMeta _weightTargetMeta = const VerificationMeta( + 'weightTarget', + ); + @override + late final GeneratedColumn weightTarget = GeneratedColumn( + 'weight_target', + aliasedName, + false, + type: DriftSqlType.double, + requiredDuringInsert: true, + ); + static const VerificationMeta _weightUnitIdMeta = const VerificationMeta( + 'weightUnitId', + ); + @override + late final GeneratedColumn weightUnitId = GeneratedColumn( + 'weight_unit_id', + aliasedName, + true, + type: DriftSqlType.int, + requiredDuringInsert: false, + ); + static const VerificationMeta _dateMeta = const VerificationMeta('date'); + @override + late final GeneratedColumn date = GeneratedColumn( + 'date', + aliasedName, + false, + type: DriftSqlType.dateTime, + requiredDuringInsert: true, + ); + @override + List get $columns => [ + id, + exerciseId, + routineId, + sessionId, + iteration, + slotEntryId, + rir, + rirTarget, + repetitions, + repetitionsTarget, + repetitionsUnitId, + weight, + weightTarget, + weightUnitId, + date, + ]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'manager_workoutlog'; + @override + VerificationContext validateIntegrity( + Insertable instance, { + bool isInserting = false, + }) { + final context = VerificationContext(); + final data = instance.toColumns(true); + if (data.containsKey('id')) { + context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); + } + if (data.containsKey('exercise_id')) { + context.handle( + _exerciseIdMeta, + exerciseId.isAcceptableOrUnknown(data['exercise_id']!, _exerciseIdMeta), + ); + } else if (isInserting) { + context.missing(_exerciseIdMeta); + } + if (data.containsKey('routine_id')) { + context.handle( + _routineIdMeta, + routineId.isAcceptableOrUnknown(data['routine_id']!, _routineIdMeta), + ); + } else if (isInserting) { + context.missing(_routineIdMeta); + } + if (data.containsKey('session_id')) { + context.handle( + _sessionIdMeta, + sessionId.isAcceptableOrUnknown(data['session_id']!, _sessionIdMeta), + ); + } + if (data.containsKey('iteration')) { + context.handle( + _iterationMeta, + iteration.isAcceptableOrUnknown(data['iteration']!, _iterationMeta), + ); + } + if (data.containsKey('slot_entry_id')) { + context.handle( + _slotEntryIdMeta, + slotEntryId.isAcceptableOrUnknown( + data['slot_entry_id']!, + _slotEntryIdMeta, + ), + ); + } + if (data.containsKey('rir')) { + context.handle( + _rirMeta, + rir.isAcceptableOrUnknown(data['rir']!, _rirMeta), + ); + } + if (data.containsKey('rir_target')) { + context.handle( + _rirTargetMeta, + rirTarget.isAcceptableOrUnknown(data['rir_target']!, _rirTargetMeta), + ); + } + if (data.containsKey('repetitions')) { + context.handle( + _repetitionsMeta, + repetitions.isAcceptableOrUnknown( + data['repetitions']!, + _repetitionsMeta, + ), + ); + } else if (isInserting) { + context.missing(_repetitionsMeta); + } + if (data.containsKey('repetitions_target')) { + context.handle( + _repetitionsTargetMeta, + repetitionsTarget.isAcceptableOrUnknown( + data['repetitions_target']!, + _repetitionsTargetMeta, + ), + ); + } else if (isInserting) { + context.missing(_repetitionsTargetMeta); + } + if (data.containsKey('repetitions_unit_id')) { + context.handle( + _repetitionsUnitIdMeta, + repetitionsUnitId.isAcceptableOrUnknown( + data['repetitions_unit_id']!, + _repetitionsUnitIdMeta, + ), + ); + } + if (data.containsKey('weight')) { + context.handle( + _weightMeta, + weight.isAcceptableOrUnknown(data['weight']!, _weightMeta), + ); + } else if (isInserting) { + context.missing(_weightMeta); + } + if (data.containsKey('weight_target')) { + context.handle( + _weightTargetMeta, + weightTarget.isAcceptableOrUnknown( + data['weight_target']!, + _weightTargetMeta, + ), + ); + } else if (isInserting) { + context.missing(_weightTargetMeta); + } + if (data.containsKey('weight_unit_id')) { + context.handle( + _weightUnitIdMeta, + weightUnitId.isAcceptableOrUnknown( + data['weight_unit_id']!, + _weightUnitIdMeta, + ), + ); + } + if (data.containsKey('date')) { + context.handle( + _dateMeta, + date.isAcceptableOrUnknown(data['date']!, _dateMeta), + ); + } else if (isInserting) { + context.missing(_dateMeta); + } + return context; + } + + @override + Set get $primaryKey => const {}; + @override + Log map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return Log( + id: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}id'], + )!, + exerciseId: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}exercise_id'], + )!, + iteration: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}iteration'], + ), + slotEntryId: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}slot_entry_id'], + ), + routineId: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}routine_id'], + )!, + repetitions: attachedDatabase.typeMapping.read( + DriftSqlType.double, + data['${effectivePrefix}repetitions'], + )!, + repetitionsTarget: attachedDatabase.typeMapping.read( + DriftSqlType.double, + data['${effectivePrefix}repetitions_target'], + )!, + repetitionsUnitId: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}repetitions_unit_id'], + ), + rir: attachedDatabase.typeMapping.read( + DriftSqlType.double, + data['${effectivePrefix}rir'], + ), + rirTarget: attachedDatabase.typeMapping.read( + DriftSqlType.double, + data['${effectivePrefix}rir_target'], + ), + weight: attachedDatabase.typeMapping.read( + DriftSqlType.double, + data['${effectivePrefix}weight'], + )!, + weightTarget: attachedDatabase.typeMapping.read( + DriftSqlType.double, + data['${effectivePrefix}weight_target'], + )!, + weightUnitId: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}weight_unit_id'], + ), + date: attachedDatabase.typeMapping.read( + DriftSqlType.dateTime, + data['${effectivePrefix}date'], + )!, + ); + } + + @override + $WorkoutLogTableTable createAlias(String alias) { + return $WorkoutLogTableTable(attachedDatabase, alias); + } +} + +class WorkoutLogTableCompanion extends UpdateCompanion { + final Value id; + final Value exerciseId; + final Value routineId; + final Value sessionId; + final Value iteration; + final Value slotEntryId; + final Value rir; + final Value rirTarget; + final Value repetitions; + final Value repetitionsTarget; + final Value repetitionsUnitId; + final Value weight; + final Value weightTarget; + final Value weightUnitId; + final Value date; + final Value rowid; + const WorkoutLogTableCompanion({ + this.id = const Value.absent(), + this.exerciseId = const Value.absent(), + this.routineId = const Value.absent(), + this.sessionId = const Value.absent(), + this.iteration = const Value.absent(), + this.slotEntryId = const Value.absent(), + this.rir = const Value.absent(), + this.rirTarget = const Value.absent(), + this.repetitions = const Value.absent(), + this.repetitionsTarget = const Value.absent(), + this.repetitionsUnitId = const Value.absent(), + this.weight = const Value.absent(), + this.weightTarget = const Value.absent(), + this.weightUnitId = const Value.absent(), + this.date = const Value.absent(), + this.rowid = const Value.absent(), + }); + WorkoutLogTableCompanion.insert({ + this.id = const Value.absent(), + required int exerciseId, + required int routineId, + this.sessionId = const Value.absent(), + this.iteration = const Value.absent(), + this.slotEntryId = const Value.absent(), + this.rir = const Value.absent(), + this.rirTarget = const Value.absent(), + required double repetitions, + required double repetitionsTarget, + this.repetitionsUnitId = const Value.absent(), + required double weight, + required double weightTarget, + this.weightUnitId = const Value.absent(), + required DateTime date, + this.rowid = const Value.absent(), + }) : exerciseId = Value(exerciseId), + routineId = Value(routineId), + repetitions = Value(repetitions), + repetitionsTarget = Value(repetitionsTarget), + weight = Value(weight), + weightTarget = Value(weightTarget), + date = Value(date); + static Insertable custom({ + Expression? id, + Expression? exerciseId, + Expression? routineId, + Expression? sessionId, + Expression? iteration, + Expression? slotEntryId, + Expression? rir, + Expression? rirTarget, + Expression? repetitions, + Expression? repetitionsTarget, + Expression? repetitionsUnitId, + Expression? weight, + Expression? weightTarget, + Expression? weightUnitId, + Expression? date, + Expression? rowid, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (exerciseId != null) 'exercise_id': exerciseId, + if (routineId != null) 'routine_id': routineId, + if (sessionId != null) 'session_id': sessionId, + if (iteration != null) 'iteration': iteration, + if (slotEntryId != null) 'slot_entry_id': slotEntryId, + if (rir != null) 'rir': rir, + if (rirTarget != null) 'rir_target': rirTarget, + if (repetitions != null) 'repetitions': repetitions, + if (repetitionsTarget != null) 'repetitions_target': repetitionsTarget, + if (repetitionsUnitId != null) 'repetitions_unit_id': repetitionsUnitId, + if (weight != null) 'weight': weight, + if (weightTarget != null) 'weight_target': weightTarget, + if (weightUnitId != null) 'weight_unit_id': weightUnitId, + if (date != null) 'date': date, + if (rowid != null) 'rowid': rowid, + }); + } + + WorkoutLogTableCompanion copyWith({ + Value? id, + Value? exerciseId, + Value? routineId, + Value? sessionId, + Value? iteration, + Value? slotEntryId, + Value? rir, + Value? rirTarget, + Value? repetitions, + Value? repetitionsTarget, + Value? repetitionsUnitId, + Value? weight, + Value? weightTarget, + Value? weightUnitId, + Value? date, + Value? rowid, + }) { + return WorkoutLogTableCompanion( + id: id ?? this.id, + exerciseId: exerciseId ?? this.exerciseId, + routineId: routineId ?? this.routineId, + sessionId: sessionId ?? this.sessionId, + iteration: iteration ?? this.iteration, + slotEntryId: slotEntryId ?? this.slotEntryId, + rir: rir ?? this.rir, + rirTarget: rirTarget ?? this.rirTarget, + repetitions: repetitions ?? this.repetitions, + repetitionsTarget: repetitionsTarget ?? this.repetitionsTarget, + repetitionsUnitId: repetitionsUnitId ?? this.repetitionsUnitId, + weight: weight ?? this.weight, + weightTarget: weightTarget ?? this.weightTarget, + weightUnitId: weightUnitId ?? this.weightUnitId, + date: date ?? this.date, + rowid: rowid ?? this.rowid, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (exerciseId.present) { + map['exercise_id'] = Variable(exerciseId.value); + } + if (routineId.present) { + map['routine_id'] = Variable(routineId.value); + } + if (sessionId.present) { + map['session_id'] = Variable(sessionId.value); + } + if (iteration.present) { + map['iteration'] = Variable(iteration.value); + } + if (slotEntryId.present) { + map['slot_entry_id'] = Variable(slotEntryId.value); + } + if (rir.present) { + map['rir'] = Variable(rir.value); + } + if (rirTarget.present) { + map['rir_target'] = Variable(rirTarget.value); + } + if (repetitions.present) { + map['repetitions'] = Variable(repetitions.value); + } + if (repetitionsTarget.present) { + map['repetitions_target'] = Variable(repetitionsTarget.value); + } + if (repetitionsUnitId.present) { + map['repetitions_unit_id'] = Variable(repetitionsUnitId.value); + } + if (weight.present) { + map['weight'] = Variable(weight.value); + } + if (weightTarget.present) { + map['weight_target'] = Variable(weightTarget.value); + } + if (weightUnitId.present) { + map['weight_unit_id'] = Variable(weightUnitId.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (rowid.present) { + map['rowid'] = Variable(rowid.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('WorkoutLogTableCompanion(') + ..write('id: $id, ') + ..write('exerciseId: $exerciseId, ') + ..write('routineId: $routineId, ') + ..write('sessionId: $sessionId, ') + ..write('iteration: $iteration, ') + ..write('slotEntryId: $slotEntryId, ') + ..write('rir: $rir, ') + ..write('rirTarget: $rirTarget, ') + ..write('repetitions: $repetitions, ') + ..write('repetitionsTarget: $repetitionsTarget, ') + ..write('repetitionsUnitId: $repetitionsUnitId, ') + ..write('weight: $weight, ') + ..write('weightTarget: $weightTarget, ') + ..write('weightUnitId: $weightUnitId, ') + ..write('date: $date, ') + ..write('rowid: $rowid') + ..write(')')) + .toString(); + } +} + +class $WorkoutSessionTableTable extends WorkoutSessionTable + with TableInfo<$WorkoutSessionTableTable, WorkoutSession> { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + $WorkoutSessionTableTable(this.attachedDatabase, [this._alias]); + static const VerificationMeta _idMeta = const VerificationMeta('id'); + @override + late final GeneratedColumn id = GeneratedColumn( + 'id', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: false, + clientDefault: () => uuid.v4(), + ); + static const VerificationMeta _routineIdMeta = const VerificationMeta( + 'routineId', + ); + @override + late final GeneratedColumn routineId = GeneratedColumn( + 'routine_id', + aliasedName, + true, + type: DriftSqlType.int, + requiredDuringInsert: false, + ); + static const VerificationMeta _dayIdMeta = const VerificationMeta('dayId'); + @override + late final GeneratedColumn dayId = GeneratedColumn( + 'day_id', + aliasedName, + true, + type: DriftSqlType.int, + requiredDuringInsert: false, + ); + static const VerificationMeta _dateMeta = const VerificationMeta('date'); + @override + late final GeneratedColumn date = GeneratedColumn( + 'date', + aliasedName, + false, + type: DriftSqlType.dateTime, + requiredDuringInsert: true, + ); + static const VerificationMeta _notesMeta = const VerificationMeta('notes'); + @override + late final GeneratedColumn notes = GeneratedColumn( + 'notes', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); + @override + late final GeneratedColumnWithTypeConverter impression = GeneratedColumn( + 'impression', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ).withConverter($WorkoutSessionTableTable.$converterimpression); + @override + late final GeneratedColumnWithTypeConverter timeStart = + GeneratedColumn( + 'time_start', + aliasedName, + true, + type: DriftSqlType.string, + requiredDuringInsert: false, + ).withConverter( + $WorkoutSessionTableTable.$convertertimeStartn, + ); + @override + late final GeneratedColumnWithTypeConverter timeEnd = GeneratedColumn( + 'time_end', + aliasedName, + true, + type: DriftSqlType.string, + requiredDuringInsert: false, + ).withConverter($WorkoutSessionTableTable.$convertertimeEndn); + @override + List get $columns => [ + id, + routineId, + dayId, + date, + notes, + impression, + timeStart, + timeEnd, + ]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'manager_workoutsession'; + @override + VerificationContext validateIntegrity( + Insertable instance, { + bool isInserting = false, + }) { + final context = VerificationContext(); + final data = instance.toColumns(true); + if (data.containsKey('id')) { + context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); + } + if (data.containsKey('routine_id')) { + context.handle( + _routineIdMeta, + routineId.isAcceptableOrUnknown(data['routine_id']!, _routineIdMeta), + ); + } + if (data.containsKey('day_id')) { + context.handle( + _dayIdMeta, + dayId.isAcceptableOrUnknown(data['day_id']!, _dayIdMeta), + ); + } + if (data.containsKey('date')) { + context.handle( + _dateMeta, + date.isAcceptableOrUnknown(data['date']!, _dateMeta), + ); + } else if (isInserting) { + context.missing(_dateMeta); + } + if (data.containsKey('notes')) { + context.handle( + _notesMeta, + notes.isAcceptableOrUnknown(data['notes']!, _notesMeta), + ); + } else if (isInserting) { + context.missing(_notesMeta); + } + return context; + } + + @override + Set get $primaryKey => const {}; + @override + WorkoutSession map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return WorkoutSession( + id: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}id'], + )!, + dayId: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}day_id'], + ), + routineId: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}routine_id'], + ), + impression: $WorkoutSessionTableTable.$converterimpression.fromSql( + attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}impression'], + )!, + ), + notes: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}notes'], + )!, + timeStart: $WorkoutSessionTableTable.$convertertimeStartn.fromSql( + attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}time_start'], + ), + ), + timeEnd: $WorkoutSessionTableTable.$convertertimeEndn.fromSql( + attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}time_end'], + ), + ), + date: attachedDatabase.typeMapping.read( + DriftSqlType.dateTime, + data['${effectivePrefix}date'], + )!, + ); + } + + @override + $WorkoutSessionTableTable createAlias(String alias) { + return $WorkoutSessionTableTable(attachedDatabase, alias); + } + + static TypeConverter $converterimpression = const IntToStringConverter(); + static TypeConverter $convertertimeStart = const TimeOfDayConverter(); + static TypeConverter $convertertimeStartn = NullAwareTypeConverter.wrap( + $convertertimeStart, + ); + static TypeConverter $convertertimeEnd = const TimeOfDayConverter(); + static TypeConverter $convertertimeEndn = NullAwareTypeConverter.wrap( + $convertertimeEnd, + ); +} + +class WorkoutSessionTableCompanion extends UpdateCompanion { + final Value id; + final Value routineId; + final Value dayId; + final Value date; + final Value notes; + final Value impression; + final Value timeStart; + final Value timeEnd; + final Value rowid; + const WorkoutSessionTableCompanion({ + this.id = const Value.absent(), + this.routineId = const Value.absent(), + this.dayId = const Value.absent(), + this.date = const Value.absent(), + this.notes = const Value.absent(), + this.impression = const Value.absent(), + this.timeStart = const Value.absent(), + this.timeEnd = const Value.absent(), + this.rowid = const Value.absent(), + }); + WorkoutSessionTableCompanion.insert({ + this.id = const Value.absent(), + this.routineId = const Value.absent(), + this.dayId = const Value.absent(), + required DateTime date, + required String notes, + required int impression, + this.timeStart = const Value.absent(), + this.timeEnd = const Value.absent(), + this.rowid = const Value.absent(), + }) : date = Value(date), + notes = Value(notes), + impression = Value(impression); + static Insertable custom({ + Expression? id, + Expression? routineId, + Expression? dayId, + Expression? date, + Expression? notes, + Expression? impression, + Expression? timeStart, + Expression? timeEnd, + Expression? rowid, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (routineId != null) 'routine_id': routineId, + if (dayId != null) 'day_id': dayId, + if (date != null) 'date': date, + if (notes != null) 'notes': notes, + if (impression != null) 'impression': impression, + if (timeStart != null) 'time_start': timeStart, + if (timeEnd != null) 'time_end': timeEnd, + if (rowid != null) 'rowid': rowid, + }); + } + + WorkoutSessionTableCompanion copyWith({ + Value? id, + Value? routineId, + Value? dayId, + Value? date, + Value? notes, + Value? impression, + Value? timeStart, + Value? timeEnd, + Value? rowid, + }) { + return WorkoutSessionTableCompanion( + id: id ?? this.id, + routineId: routineId ?? this.routineId, + dayId: dayId ?? this.dayId, + date: date ?? this.date, + notes: notes ?? this.notes, + impression: impression ?? this.impression, + timeStart: timeStart ?? this.timeStart, + timeEnd: timeEnd ?? this.timeEnd, + rowid: rowid ?? this.rowid, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (routineId.present) { + map['routine_id'] = Variable(routineId.value); + } + if (dayId.present) { + map['day_id'] = Variable(dayId.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (notes.present) { + map['notes'] = Variable(notes.value); + } + if (impression.present) { + map['impression'] = Variable( + $WorkoutSessionTableTable.$converterimpression.toSql(impression.value), + ); + } + if (timeStart.present) { + map['time_start'] = Variable( + $WorkoutSessionTableTable.$convertertimeStartn.toSql(timeStart.value), + ); + } + if (timeEnd.present) { + map['time_end'] = Variable( + $WorkoutSessionTableTable.$convertertimeEndn.toSql(timeEnd.value), + ); + } + if (rowid.present) { + map['rowid'] = Variable(rowid.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('WorkoutSessionTableCompanion(') + ..write('id: $id, ') + ..write('routineId: $routineId, ') + ..write('dayId: $dayId, ') + ..write('date: $date, ') + ..write('notes: $notes, ') + ..write('impression: $impression, ') + ..write('timeStart: $timeStart, ') + ..write('timeEnd: $timeEnd, ') + ..write('rowid: $rowid') + ..write(')')) + .toString(); + } +} + abstract class _$DriftPowersyncDatabase extends GeneratedDatabase { _$DriftPowersyncDatabase(QueryExecutor e) : super(e); $DriftPowersyncDatabaseManager get managers => $DriftPowersyncDatabaseManager(this); @@ -3231,6 +4187,10 @@ abstract class _$DriftPowersyncDatabase extends GeneratedDatabase { ); late final $MeasurementCategoryTableTable measurementCategoryTable = $MeasurementCategoryTableTable(this); + late final $WorkoutLogTableTable workoutLogTable = $WorkoutLogTableTable( + this, + ); + late final $WorkoutSessionTableTable workoutSessionTable = $WorkoutSessionTableTable(this); @override Iterable> get allTables => allSchemaEntities.whereType>(); @@ -3249,6 +4209,8 @@ abstract class _$DriftPowersyncDatabase extends GeneratedDatabase { exerciseVideoTable, weightEntryTable, measurementCategoryTable, + workoutLogTable, + workoutSessionTable, ]; @override DriftDatabaseOptions get options => const DriftDatabaseOptions(storeDateTimeAsText: true); @@ -5752,6 +6714,669 @@ typedef $$MeasurementCategoryTableTableProcessedTableManager = MeasurementCategory, PrefetchHooks Function() >; +typedef $$WorkoutLogTableTableCreateCompanionBuilder = + WorkoutLogTableCompanion Function({ + Value id, + required int exerciseId, + required int routineId, + Value sessionId, + Value iteration, + Value slotEntryId, + Value rir, + Value rirTarget, + required double repetitions, + required double repetitionsTarget, + Value repetitionsUnitId, + required double weight, + required double weightTarget, + Value weightUnitId, + required DateTime date, + Value rowid, + }); +typedef $$WorkoutLogTableTableUpdateCompanionBuilder = + WorkoutLogTableCompanion Function({ + Value id, + Value exerciseId, + Value routineId, + Value sessionId, + Value iteration, + Value slotEntryId, + Value rir, + Value rirTarget, + Value repetitions, + Value repetitionsTarget, + Value repetitionsUnitId, + Value weight, + Value weightTarget, + Value weightUnitId, + Value date, + Value rowid, + }); + +class $$WorkoutLogTableTableFilterComposer + extends Composer<_$DriftPowersyncDatabase, $WorkoutLogTableTable> { + $$WorkoutLogTableTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get exerciseId => $composableBuilder( + column: $table.exerciseId, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get routineId => $composableBuilder( + column: $table.routineId, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get sessionId => $composableBuilder( + column: $table.sessionId, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get iteration => $composableBuilder( + column: $table.iteration, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get slotEntryId => $composableBuilder( + column: $table.slotEntryId, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get rir => $composableBuilder( + column: $table.rir, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get rirTarget => $composableBuilder( + column: $table.rirTarget, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get repetitions => $composableBuilder( + column: $table.repetitions, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get repetitionsTarget => $composableBuilder( + column: $table.repetitionsTarget, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get repetitionsUnitId => $composableBuilder( + column: $table.repetitionsUnitId, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get weight => $composableBuilder( + column: $table.weight, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get weightTarget => $composableBuilder( + column: $table.weightTarget, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get weightUnitId => $composableBuilder( + column: $table.weightUnitId, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get date => $composableBuilder( + column: $table.date, + builder: (column) => ColumnFilters(column), + ); +} + +class $$WorkoutLogTableTableOrderingComposer + extends Composer<_$DriftPowersyncDatabase, $WorkoutLogTableTable> { + $$WorkoutLogTableTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get exerciseId => $composableBuilder( + column: $table.exerciseId, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get routineId => $composableBuilder( + column: $table.routineId, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get sessionId => $composableBuilder( + column: $table.sessionId, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get iteration => $composableBuilder( + column: $table.iteration, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get slotEntryId => $composableBuilder( + column: $table.slotEntryId, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get rir => $composableBuilder( + column: $table.rir, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get rirTarget => $composableBuilder( + column: $table.rirTarget, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get repetitions => $composableBuilder( + column: $table.repetitions, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get repetitionsTarget => $composableBuilder( + column: $table.repetitionsTarget, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get repetitionsUnitId => $composableBuilder( + column: $table.repetitionsUnitId, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get weight => $composableBuilder( + column: $table.weight, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get weightTarget => $composableBuilder( + column: $table.weightTarget, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get weightUnitId => $composableBuilder( + column: $table.weightUnitId, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get date => $composableBuilder( + column: $table.date, + builder: (column) => ColumnOrderings(column), + ); +} + +class $$WorkoutLogTableTableAnnotationComposer + extends Composer<_$DriftPowersyncDatabase, $WorkoutLogTableTable> { + $$WorkoutLogTableTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get exerciseId => $composableBuilder( + column: $table.exerciseId, + builder: (column) => column, + ); + + GeneratedColumn get routineId => + $composableBuilder(column: $table.routineId, builder: (column) => column); + + GeneratedColumn get sessionId => + $composableBuilder(column: $table.sessionId, builder: (column) => column); + + GeneratedColumn get iteration => + $composableBuilder(column: $table.iteration, builder: (column) => column); + + GeneratedColumn get slotEntryId => $composableBuilder( + column: $table.slotEntryId, + builder: (column) => column, + ); + + GeneratedColumn get rir => + $composableBuilder(column: $table.rir, builder: (column) => column); + + GeneratedColumn get rirTarget => + $composableBuilder(column: $table.rirTarget, builder: (column) => column); + + GeneratedColumn get repetitions => $composableBuilder( + column: $table.repetitions, + builder: (column) => column, + ); + + GeneratedColumn get repetitionsTarget => $composableBuilder( + column: $table.repetitionsTarget, + builder: (column) => column, + ); + + GeneratedColumn get repetitionsUnitId => $composableBuilder( + column: $table.repetitionsUnitId, + builder: (column) => column, + ); + + GeneratedColumn get weight => + $composableBuilder(column: $table.weight, builder: (column) => column); + + GeneratedColumn get weightTarget => $composableBuilder( + column: $table.weightTarget, + builder: (column) => column, + ); + + GeneratedColumn get weightUnitId => $composableBuilder( + column: $table.weightUnitId, + builder: (column) => column, + ); + + GeneratedColumn get date => + $composableBuilder(column: $table.date, builder: (column) => column); +} + +class $$WorkoutLogTableTableTableManager + extends + RootTableManager< + _$DriftPowersyncDatabase, + $WorkoutLogTableTable, + Log, + $$WorkoutLogTableTableFilterComposer, + $$WorkoutLogTableTableOrderingComposer, + $$WorkoutLogTableTableAnnotationComposer, + $$WorkoutLogTableTableCreateCompanionBuilder, + $$WorkoutLogTableTableUpdateCompanionBuilder, + (Log, BaseReferences<_$DriftPowersyncDatabase, $WorkoutLogTableTable, Log>), + Log, + PrefetchHooks Function() + > { + $$WorkoutLogTableTableTableManager( + _$DriftPowersyncDatabase db, + $WorkoutLogTableTable table, + ) : super( + TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$WorkoutLogTableTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$WorkoutLogTableTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$WorkoutLogTableTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value exerciseId = const Value.absent(), + Value routineId = const Value.absent(), + Value sessionId = const Value.absent(), + Value iteration = const Value.absent(), + Value slotEntryId = const Value.absent(), + Value rir = const Value.absent(), + Value rirTarget = const Value.absent(), + Value repetitions = const Value.absent(), + Value repetitionsTarget = const Value.absent(), + Value repetitionsUnitId = const Value.absent(), + Value weight = const Value.absent(), + Value weightTarget = const Value.absent(), + Value weightUnitId = const Value.absent(), + Value date = const Value.absent(), + Value rowid = const Value.absent(), + }) => WorkoutLogTableCompanion( + id: id, + exerciseId: exerciseId, + routineId: routineId, + sessionId: sessionId, + iteration: iteration, + slotEntryId: slotEntryId, + rir: rir, + rirTarget: rirTarget, + repetitions: repetitions, + repetitionsTarget: repetitionsTarget, + repetitionsUnitId: repetitionsUnitId, + weight: weight, + weightTarget: weightTarget, + weightUnitId: weightUnitId, + date: date, + rowid: rowid, + ), + createCompanionCallback: + ({ + Value id = const Value.absent(), + required int exerciseId, + required int routineId, + Value sessionId = const Value.absent(), + Value iteration = const Value.absent(), + Value slotEntryId = const Value.absent(), + Value rir = const Value.absent(), + Value rirTarget = const Value.absent(), + required double repetitions, + required double repetitionsTarget, + Value repetitionsUnitId = const Value.absent(), + required double weight, + required double weightTarget, + Value weightUnitId = const Value.absent(), + required DateTime date, + Value rowid = const Value.absent(), + }) => WorkoutLogTableCompanion.insert( + id: id, + exerciseId: exerciseId, + routineId: routineId, + sessionId: sessionId, + iteration: iteration, + slotEntryId: slotEntryId, + rir: rir, + rirTarget: rirTarget, + repetitions: repetitions, + repetitionsTarget: repetitionsTarget, + repetitionsUnitId: repetitionsUnitId, + weight: weight, + weightTarget: weightTarget, + weightUnitId: weightUnitId, + date: date, + rowid: rowid, + ), + withReferenceMapper: (p0) => + p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), + prefetchHooksCallback: null, + ), + ); +} + +typedef $$WorkoutLogTableTableProcessedTableManager = + ProcessedTableManager< + _$DriftPowersyncDatabase, + $WorkoutLogTableTable, + Log, + $$WorkoutLogTableTableFilterComposer, + $$WorkoutLogTableTableOrderingComposer, + $$WorkoutLogTableTableAnnotationComposer, + $$WorkoutLogTableTableCreateCompanionBuilder, + $$WorkoutLogTableTableUpdateCompanionBuilder, + (Log, BaseReferences<_$DriftPowersyncDatabase, $WorkoutLogTableTable, Log>), + Log, + PrefetchHooks Function() + >; +typedef $$WorkoutSessionTableTableCreateCompanionBuilder = + WorkoutSessionTableCompanion Function({ + Value id, + Value routineId, + Value dayId, + required DateTime date, + required String notes, + required int impression, + Value timeStart, + Value timeEnd, + Value rowid, + }); +typedef $$WorkoutSessionTableTableUpdateCompanionBuilder = + WorkoutSessionTableCompanion Function({ + Value id, + Value routineId, + Value dayId, + Value date, + Value notes, + Value impression, + Value timeStart, + Value timeEnd, + Value rowid, + }); + +class $$WorkoutSessionTableTableFilterComposer + extends Composer<_$DriftPowersyncDatabase, $WorkoutSessionTableTable> { + $$WorkoutSessionTableTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get routineId => $composableBuilder( + column: $table.routineId, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get dayId => $composableBuilder( + column: $table.dayId, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get date => $composableBuilder( + column: $table.date, + builder: (column) => ColumnFilters(column), + ); + + ColumnFilters get notes => $composableBuilder( + column: $table.notes, + builder: (column) => ColumnFilters(column), + ); + + ColumnWithTypeConverterFilters get impression => $composableBuilder( + column: $table.impression, + builder: (column) => ColumnWithTypeConverterFilters(column), + ); + + ColumnWithTypeConverterFilters get timeStart => $composableBuilder( + column: $table.timeStart, + builder: (column) => ColumnWithTypeConverterFilters(column), + ); + + ColumnWithTypeConverterFilters get timeEnd => $composableBuilder( + column: $table.timeEnd, + builder: (column) => ColumnWithTypeConverterFilters(column), + ); +} + +class $$WorkoutSessionTableTableOrderingComposer + extends Composer<_$DriftPowersyncDatabase, $WorkoutSessionTableTable> { + $$WorkoutSessionTableTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get routineId => $composableBuilder( + column: $table.routineId, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get dayId => $composableBuilder( + column: $table.dayId, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get date => $composableBuilder( + column: $table.date, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get notes => $composableBuilder( + column: $table.notes, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get impression => $composableBuilder( + column: $table.impression, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get timeStart => $composableBuilder( + column: $table.timeStart, + builder: (column) => ColumnOrderings(column), + ); + + ColumnOrderings get timeEnd => $composableBuilder( + column: $table.timeEnd, + builder: (column) => ColumnOrderings(column), + ); +} + +class $$WorkoutSessionTableTableAnnotationComposer + extends Composer<_$DriftPowersyncDatabase, $WorkoutSessionTableTable> { + $$WorkoutSessionTableTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get routineId => + $composableBuilder(column: $table.routineId, builder: (column) => column); + + GeneratedColumn get dayId => + $composableBuilder(column: $table.dayId, builder: (column) => column); + + GeneratedColumn get date => + $composableBuilder(column: $table.date, builder: (column) => column); + + GeneratedColumn get notes => + $composableBuilder(column: $table.notes, builder: (column) => column); + + GeneratedColumnWithTypeConverter get impression => $composableBuilder( + column: $table.impression, + builder: (column) => column, + ); + + GeneratedColumnWithTypeConverter get timeStart => + $composableBuilder(column: $table.timeStart, builder: (column) => column); + + GeneratedColumnWithTypeConverter get timeEnd => + $composableBuilder(column: $table.timeEnd, builder: (column) => column); +} + +class $$WorkoutSessionTableTableTableManager + extends + RootTableManager< + _$DriftPowersyncDatabase, + $WorkoutSessionTableTable, + WorkoutSession, + $$WorkoutSessionTableTableFilterComposer, + $$WorkoutSessionTableTableOrderingComposer, + $$WorkoutSessionTableTableAnnotationComposer, + $$WorkoutSessionTableTableCreateCompanionBuilder, + $$WorkoutSessionTableTableUpdateCompanionBuilder, + ( + WorkoutSession, + BaseReferences<_$DriftPowersyncDatabase, $WorkoutSessionTableTable, WorkoutSession>, + ), + WorkoutSession, + PrefetchHooks Function() + > { + $$WorkoutSessionTableTableTableManager( + _$DriftPowersyncDatabase db, + $WorkoutSessionTableTable table, + ) : super( + TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$WorkoutSessionTableTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => $$WorkoutSessionTableTableOrderingComposer( + $db: db, + $table: table, + ), + createComputedFieldComposer: () => $$WorkoutSessionTableTableAnnotationComposer( + $db: db, + $table: table, + ), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value routineId = const Value.absent(), + Value dayId = const Value.absent(), + Value date = const Value.absent(), + Value notes = const Value.absent(), + Value impression = const Value.absent(), + Value timeStart = const Value.absent(), + Value timeEnd = const Value.absent(), + Value rowid = const Value.absent(), + }) => WorkoutSessionTableCompanion( + id: id, + routineId: routineId, + dayId: dayId, + date: date, + notes: notes, + impression: impression, + timeStart: timeStart, + timeEnd: timeEnd, + rowid: rowid, + ), + createCompanionCallback: + ({ + Value id = const Value.absent(), + Value routineId = const Value.absent(), + Value dayId = const Value.absent(), + required DateTime date, + required String notes, + required int impression, + Value timeStart = const Value.absent(), + Value timeEnd = const Value.absent(), + Value rowid = const Value.absent(), + }) => WorkoutSessionTableCompanion.insert( + id: id, + routineId: routineId, + dayId: dayId, + date: date, + notes: notes, + impression: impression, + timeStart: timeStart, + timeEnd: timeEnd, + rowid: rowid, + ), + withReferenceMapper: (p0) => + p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), + prefetchHooksCallback: null, + ), + ); +} + +typedef $$WorkoutSessionTableTableProcessedTableManager = + ProcessedTableManager< + _$DriftPowersyncDatabase, + $WorkoutSessionTableTable, + WorkoutSession, + $$WorkoutSessionTableTableFilterComposer, + $$WorkoutSessionTableTableOrderingComposer, + $$WorkoutSessionTableTableAnnotationComposer, + $$WorkoutSessionTableTableCreateCompanionBuilder, + $$WorkoutSessionTableTableUpdateCompanionBuilder, + ( + WorkoutSession, + BaseReferences<_$DriftPowersyncDatabase, $WorkoutSessionTableTable, WorkoutSession>, + ), + WorkoutSession, + PrefetchHooks Function() + >; class $DriftPowersyncDatabaseManager { final _$DriftPowersyncDatabase _db; @@ -5791,4 +7416,8 @@ class $DriftPowersyncDatabaseManager { _db, _db.measurementCategoryTable, ); + $$WorkoutLogTableTableTableManager get workoutLogTable => + $$WorkoutLogTableTableTableManager(_db, _db.workoutLogTable); + $$WorkoutSessionTableTableTableManager get workoutSessionTable => + $$WorkoutSessionTableTableTableManager(_db, _db.workoutSessionTable); } diff --git a/lib/database/powersync/tables/routines.dart b/lib/database/powersync/tables/routines.dart index 21b2aae7a..51997dbf5 100644 --- a/lib/database/powersync/tables/routines.dart +++ b/lib/database/powersync/tables/routines.dart @@ -1,7 +1,29 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + import 'package:drift/drift.dart'; import 'package:powersync/powersync.dart' show uuid; +import 'package:wger/database/converters/int_to_string_converter.dart'; +import 'package:wger/database/converters/time_of_day_converter.dart'; +import 'package:wger/models/workouts/log.dart'; +import 'package:wger/models/workouts/session.dart'; -// @UseRowClass(Log) +@UseRowClass(Log) class WorkoutLogTable extends Table { @override String get tableName => 'manager_workoutlog'; @@ -26,3 +48,19 @@ class WorkoutLogTable extends Table { DateTimeColumn get date => dateTime()(); } + +@UseRowClass(WorkoutSession) +class WorkoutSessionTable extends Table { + @override + String get tableName => 'manager_workoutsession'; + + TextColumn get id => text().clientDefault(() => uuid.v4())(); + IntColumn get routineId => integer().named('routine_id').nullable()(); + IntColumn get dayId => integer().named('day_id').nullable()(); + DateTimeColumn get date => dateTime()(); + TextColumn get notes => text()(); + TextColumn get impression => text().map(const IntToStringConverter())(); + TextColumn get timeStart => + text().named('time_start').nullable().map(const TimeOfDayConverter())(); + TextColumn get timeEnd => text().named('time_end').nullable().map(const TimeOfDayConverter())(); +} diff --git a/lib/models/workouts/log.dart b/lib/models/workouts/log.dart index f3ccfb816..fd8536126 100644 --- a/lib/models/workouts/log.dart +++ b/lib/models/workouts/log.dart @@ -1,6 +1,6 @@ /* * This file is part of wger Workout Manager . - * Copyright (C) 2020, 2021 wger Team + * Copyright (c) 2020, wger Team * * wger Workout Manager is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -16,7 +16,9 @@ * along with this program. If not, see . */ +import 'package:drift/drift.dart' as drift; import 'package:json_annotation/json_annotation.dart'; +import 'package:wger/database/powersync/database.dart'; import 'package:wger/helpers/consts.dart'; import 'package:wger/helpers/json.dart'; import 'package:wger/helpers/misc.dart'; @@ -27,10 +29,14 @@ import 'package:wger/models/workouts/weight_unit.dart'; part 'log.g.dart'; +/// Temporary fix for id conversion: the "id" field used in the drift database +/// is a UUID string, but the JSON data is the database ID. +String? idFromJson(Object? value) => value?.toString(); + @JsonSerializable() class Log { - @JsonKey(required: true) - int? id; + @JsonKey(required: true, fromJson: idFromJson) + String? id; @JsonKey(required: true, name: 'exercise') late int exerciseId; @@ -120,6 +126,36 @@ class Log { rirTarget = data.rir; } + WorkoutLogTableCompanion toCompanion({bool includeId = false}) { + return WorkoutLogTableCompanion( + id: includeId && id != null ? drift.Value(id!) : const drift.Value.absent(), + exerciseId: drift.Value(exerciseId), + routineId: drift.Value(routineId), + sessionId: sessionId != null ? drift.Value(sessionId) : const drift.Value.absent(), + iteration: iteration != null ? drift.Value(iteration) : const drift.Value.absent(), + slotEntryId: slotEntryId != null ? drift.Value(slotEntryId) : const drift.Value.absent(), + rir: rir != null ? drift.Value(rir!.toDouble()) : const drift.Value.absent(), + rirTarget: rirTarget != null + ? drift.Value(rirTarget!.toDouble()) + : const drift.Value.absent(), + repetitions: repetitions != null + ? drift.Value(repetitions!.toDouble()) + : const drift.Value.absent(), + repetitionsTarget: repetitionsTarget != null + ? drift.Value(repetitionsTarget!.toDouble()) + : const drift.Value.absent(), + repetitionsUnitId: repetitionsUnitId != null + ? drift.Value(repetitionsUnitId) + : const drift.Value.absent(), + weight: weight != null ? drift.Value(weight!.toDouble()) : const drift.Value.absent(), + weightTarget: weightTarget != null + ? drift.Value(weightTarget!.toDouble()) + : const drift.Value.absent(), + weightUnitId: weightUnitId != null ? drift.Value(weightUnitId) : const drift.Value.absent(), + date: drift.Value(date.toUtc()), + ); + } + // Boilerplate factory Log.fromJson(Map json) => _$LogFromJson(json); diff --git a/lib/models/workouts/log.g.dart b/lib/models/workouts/log.g.dart index 803f17788..047670bc4 100644 --- a/lib/models/workouts/log.g.dart +++ b/lib/models/workouts/log.g.dart @@ -1,3 +1,21 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // GENERATED CODE - DO NOT MODIFY BY HAND part of 'log.dart'; @@ -26,7 +44,7 @@ Log _$LogFromJson(Map json) { ], ); return Log( - id: (json['id'] as num?)?.toInt(), + id: idFromJson(json['id']), exerciseId: (json['exercise'] as num).toInt(), iteration: (json['iteration'] as num?)?.toInt(), slotEntryId: (json['slot_entry'] as num?)?.toInt(), diff --git a/lib/models/workouts/session.dart b/lib/models/workouts/session.dart index f12030a6c..45e025359 100644 --- a/lib/models/workouts/session.dart +++ b/lib/models/workouts/session.dart @@ -1,6 +1,6 @@ /* * This file is part of wger Workout Manager . - * Copyright (C) 2020, 2021 wger Team + * Copyright (c) 2020, wger Team * * wger Workout Manager is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -16,8 +16,10 @@ * along with this program. If not, see . */ +import 'package:drift/drift.dart' as drift; import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:wger/database/powersync/database.dart'; import 'package:wger/helpers/json.dart'; import 'package:wger/models/workouts/log.dart'; @@ -28,7 +30,7 @@ const IMPRESSION_MAP = {1: 'bad', 2: 'neutral', 3: 'good'}; @JsonSerializable() class WorkoutSession { @JsonKey(required: true) - int? id; + String? id; @JsonKey(required: true, name: 'routine') late int? routineId; @@ -68,6 +70,19 @@ class WorkoutSession { this.date = date ?? DateTime.now(); } + WorkoutSessionTableCompanion toCompanion({bool includeId = false}) { + return WorkoutSessionTableCompanion( + id: includeId && id != null ? drift.Value(id!) : const drift.Value.absent(), + routineId: routineId != null ? drift.Value(routineId) : const drift.Value.absent(), + dayId: dayId != null ? drift.Value(dayId) : const drift.Value.absent(), + date: drift.Value(date.toUtc()), + notes: drift.Value(notes), + impression: drift.Value(impression), + timeStart: timeStart != null ? drift.Value(timeStart) : const drift.Value.absent(), + timeEnd: timeEnd != null ? drift.Value(timeEnd) : const drift.Value.absent(), + ); + } + // Boilerplate factory WorkoutSession.fromJson(Map json) => _$WorkoutSessionFromJson(json); diff --git a/lib/models/workouts/session.g.dart b/lib/models/workouts/session.g.dart index ac78029df..4f8b52853 100644 --- a/lib/models/workouts/session.g.dart +++ b/lib/models/workouts/session.g.dart @@ -1,3 +1,21 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // GENERATED CODE - DO NOT MODIFY BY HAND part of 'session.dart'; @@ -20,7 +38,7 @@ WorkoutSession _$WorkoutSessionFromJson(Map json) { ], ); return WorkoutSession( - id: (json['id'] as num?)?.toInt(), + id: json['id'] as String?, dayId: (json['day'] as num?)?.toInt(), routineId: (json['routine'] as num?)?.toInt(), impression: json['impression'] == null ? 2 : int.parse(json['impression'] as String), diff --git a/lib/powersync/connector.dart b/lib/powersync/connector.dart index 8dfe7912e..4862c095d 100644 --- a/lib/powersync/connector.dart +++ b/lib/powersync/connector.dart @@ -1,6 +1,6 @@ /* * This file is part of wger Workout Manager . - * Copyright (c) 2020, wger Team + * Copyright (c) 2020, 2020- wger Team * * wger Workout Manager is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/lib/powersync/schema.dart b/lib/powersync/schema.dart index 023ff0184..b1cfad4a1 100644 --- a/lib/powersync/schema.dart +++ b/lib/powersync/schema.dart @@ -1,3 +1,21 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + import 'package:powersync/powersync.dart'; Schema schema = const Schema([ @@ -175,4 +193,20 @@ Schema schema = const Schema([ Index('weight_unit', [IndexedColumn('weight_unit_id')]), ], ), + Table( + 'manager_workoutsession', + [ + Column.integer('routine_id'), + Column.integer('day_id'), + Column.text('date'), + Column.text('notes'), + Column.text('impression'), + Column.text('time_start'), + Column.text('time_end'), + ], + indexes: [ + Index('routine', [IndexedColumn('routine_id')]), + Index('day', [IndexedColumn('day_id')]), + ], + ), ]); diff --git a/lib/providers/body_weight.dart b/lib/providers/body_weight.dart index d276b5fb9..4ea514e5d 100644 --- a/lib/providers/body_weight.dart +++ b/lib/providers/body_weight.dart @@ -1,4 +1,20 @@ -// Helper to read body weight entries from PowerSync local database and convert to WeightEntry +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ import 'package:logging/logging.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; diff --git a/lib/providers/workout_log_repository.dart b/lib/providers/workout_log_repository.dart new file mode 100644 index 000000000..838b7fb72 --- /dev/null +++ b/lib/providers/workout_log_repository.dart @@ -0,0 +1,63 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* + * Repository for body weight network operations. + */ + +import 'package:drift/drift.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:logging/logging.dart'; +import 'package:wger/models/workouts/log.dart'; + +import '../database/powersync/database.dart'; + +final workoutLogRepositoryProvider = Provider((ref) { + final db = ref.read(driftPowerSyncDatabase); + return WorkoutLogRepository(db); +}); + +class WorkoutLogRepository { + final _logger = Logger('WorkoutLogRepository'); + final DriftPowersyncDatabase _db; + + WorkoutLogRepository(this._db); + + Stream> watchAllDrift() { + _logger.finer('Watching all local workout log entries'); + final query = _db.select(_db.workoutLogTable) + ..orderBy([(t) => OrderingTerm(expression: t.date, mode: OrderingMode.desc)]); + return query.watch(); + } + + Future deleteLocalDrift(String id) async { + _logger.finer('Deleting local workout log entry $id'); + await (_db.delete(_db.workoutLogTable)..where((t) => t.id.equals(id))).go(); + } + + Future updateLocalDrift(Log log) async { + _logger.finer('Updating local workout log entry ${log.id}'); + final stmt = _db.update(_db.workoutLogTable)..where((t) => t.id.equals(log.id!)); + await stmt.write(log.toCompanion()); + } + + Future addLocalDrift(Log log) async { + _logger.finer('Adding local workout log entry ${log.date}'); + await _db.into(_db.workoutLogTable).insert(log.toCompanion()); + } +} diff --git a/lib/providers/workout_logs.dart b/lib/providers/workout_logs.dart new file mode 100644 index 000000000..14b078704 --- /dev/null +++ b/lib/providers/workout_logs.dart @@ -0,0 +1,56 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:logging/logging.dart'; +import 'package:riverpod_annotation/riverpod_annotation.dart'; +import 'package:wger/models/workouts/log.dart'; + +import 'workout_log_repository.dart'; + +part 'workout_logs.g.dart'; + +@riverpod +final class WorkoutLogNotifier extends _$WorkoutLogNotifier { + final _log = Logger('WorkoutLogNotifier'); + late final WorkoutLogRepository _repo; + + @override + Stream> build() { + _repo = ref.read(workoutLogRepositoryProvider); + + // final state = BodyWeightState(); + // repo.watchAllDrift(database).listen((entries) { + // state.setItems(entries); + // }); + // return state; + + return _repo.watchAllDrift(); + } + + Future deleteEntry(String id) async { + await _repo.deleteLocalDrift(id); + } + + Future updateEntry(Log log) async { + await _repo.updateLocalDrift(log); + } + + Future addEntry(Log log) async { + await _repo.addLocalDrift(log); + } +} diff --git a/lib/providers/workout_logs.g.dart b/lib/providers/workout_logs.g.dart new file mode 100644 index 000000000..a27d1e5a7 --- /dev/null +++ b/lib/providers/workout_logs.g.dart @@ -0,0 +1,73 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'workout_logs.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(WorkoutLogNotifier) +const workoutLogProvider = WorkoutLogNotifierProvider._(); + +final class WorkoutLogNotifierProvider + extends $StreamNotifierProvider> { + const WorkoutLogNotifierProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'workoutLogProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$workoutLogNotifierHash(); + + @$internal + @override + WorkoutLogNotifier create() => WorkoutLogNotifier(); +} + +String _$workoutLogNotifierHash() => r'8ec76c8d9c72c6bc482952763d048c5df110bd6e'; + +abstract class _$WorkoutLogNotifier extends $StreamNotifier> { + Stream> build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref>, List>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier>, List>, + AsyncValue>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/lib/providers/workout_session.dart b/lib/providers/workout_session.dart new file mode 100644 index 000000000..ad66b6aeb --- /dev/null +++ b/lib/providers/workout_session.dart @@ -0,0 +1,56 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:logging/logging.dart'; +import 'package:riverpod_annotation/riverpod_annotation.dart'; +import 'package:wger/models/workouts/log.dart'; +import 'package:wger/models/workouts/session.dart'; +import 'package:wger/providers/workout_session_repository.dart'; + +part 'workout_session.g.dart'; + +@riverpod +final class WorkoutSessionNotifier extends _$WorkoutSessionNotifier { + final _log = Logger('WorkoutSessionNotifier'); + late final WorkoutSessionRepository _repo; + + @override + Stream> build() { + _repo = ref.read(workoutSessionRepositoryProvider); + + // final state = BodyWeightState(); + // repo.watchAllDrift(database).listen((entries) { + // state.setItems(entries); + // }); + // return state; + + return _repo.watchAllDrift(); + } + + Future deleteEntry(String id) async { + await _repo.deleteLocalDrift(id); + } + + Future updateEntry(WorkoutSession entry) async { + await _repo.updateLocalDrift(entry); + } + + Future addEntry(WorkoutSession entry) async { + await _repo.addLocalDrift(entry); + } +} diff --git a/lib/providers/workout_session.g.dart b/lib/providers/workout_session.g.dart new file mode 100644 index 000000000..86f11f4e1 --- /dev/null +++ b/lib/providers/workout_session.g.dart @@ -0,0 +1,73 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'workout_session.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(WorkoutSessionNotifier) +const workoutSessionProvider = WorkoutSessionNotifierProvider._(); + +final class WorkoutSessionNotifierProvider + extends $StreamNotifierProvider> { + const WorkoutSessionNotifierProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'workoutSessionProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$workoutSessionNotifierHash(); + + @$internal + @override + WorkoutSessionNotifier create() => WorkoutSessionNotifier(); +} + +String _$workoutSessionNotifierHash() => r'2d2a67179eb60855d6985af73429e39db4f80886'; + +abstract class _$WorkoutSessionNotifier extends $StreamNotifier> { + Stream> build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref>, List>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier>, List>, + AsyncValue>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/lib/providers/workout_session_repository.dart b/lib/providers/workout_session_repository.dart new file mode 100644 index 000000000..d84bb3b9f --- /dev/null +++ b/lib/providers/workout_session_repository.dart @@ -0,0 +1,63 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* + * Repository for body weight network operations. + */ + +import 'package:drift/drift.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:logging/logging.dart'; +import 'package:wger/models/workouts/session.dart'; + +import '../database/powersync/database.dart'; + +final workoutSessionRepositoryProvider = Provider((ref) { + final db = ref.read(driftPowerSyncDatabase); + return WorkoutSessionRepository(db); +}); + +class WorkoutSessionRepository { + final _logger = Logger('WorkoutSessionRepository'); + final DriftPowersyncDatabase _db; + + WorkoutSessionRepository(this._db); + + Stream> watchAllDrift() { + _logger.finer('Watching all local workout session entries'); + final query = _db.select(_db.workoutSessionTable) + ..orderBy([(t) => OrderingTerm(expression: t.date, mode: OrderingMode.desc)]); + return query.watch(); + } + + Future deleteLocalDrift(String id) async { + _logger.finer('Deleting local workout session entry $id'); + await (_db.delete(_db.workoutSessionTable)..where((t) => t.id.equals(id))).go(); + } + + Future updateLocalDrift(WorkoutSession session) async { + _logger.finer('Updating local workout session entry ${session.id}'); + final stmt = _db.update(_db.workoutSessionTable)..where((t) => t.id.equals(session.id!)); + await stmt.write(session.toCompanion()); + } + + Future addLocalDrift(WorkoutSession session) async { + _logger.finer('Adding local workout session entry ${session.date}'); + await _db.into(_db.workoutSessionTable).insert(session.toCompanion()); + } +} diff --git a/test/core/validators_test.mocks.dart b/test/core/validators_test.mocks.dart index c563dc56d..527eb079d 100644 --- a/test/core/validators_test.mocks.dart +++ b/test/core/validators_test.mocks.dart @@ -1,3 +1,21 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Mocks generated by Mockito 5.4.6 from annotations // in wger/test/core/validators_test.dart. // Do not manually edit this file. @@ -3622,6 +3640,28 @@ class MockAppLocalizations extends _i1.Mock implements _i2.AppLocalizations { ) as String); + @override + String get youAreOffline => + (super.noSuchMethod( + Invocation.getter(#youAreOffline), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#youAreOffline), + ), + ) + as String); + + @override + String get offlineModeInfo => + (super.noSuchMethod( + Invocation.getter(#offlineModeInfo), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#offlineModeInfo), + ), + ) + as String); + @override String exerciseNr(String? nr) => (super.noSuchMethod( diff --git a/test/routine/day_form_test.mocks.dart b/test/routine/day_form_test.mocks.dart index 56b69c61a..7c80e74d1 100644 --- a/test/routine/day_form_test.mocks.dart +++ b/test/routine/day_form_test.mocks.dart @@ -1,18 +1,35 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Mocks generated by Mockito 5.4.6 from annotations // in wger/test/routine/day_form_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i13; -import 'dart:ui' as _i17; +import 'dart:async' as _i12; +import 'dart:ui' as _i16; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i16; -import 'package:wger/models/exercises/exercise.dart' as _i15; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/exercises/exercise.dart' as _i14; import 'package:wger/models/workouts/base_config.dart' as _i9; import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/day_data.dart' as _i14; -import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/day_data.dart' as _i13; import 'package:wger/models/workouts/repetition_unit.dart' as _i4; import 'package:wger/models/workouts/routine.dart' as _i5; import 'package:wger/models/workouts/session.dart' as _i10; @@ -20,7 +37,7 @@ import 'package:wger/models/workouts/slot.dart' as _i7; import 'package:wger/models/workouts/slot_entry.dart' as _i8; import 'package:wger/models/workouts/weight_unit.dart' as _i3; import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/routines.dart' as _i12; +import 'package:wger/providers/routines.dart' as _i11; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -75,14 +92,10 @@ class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession : super(parent, parentInvocation); } -class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - /// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { +class MockRoutinesProvider extends _i1.Mock implements _i11.RoutinesProvider { MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -222,27 +235,27 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as int); @override - _i13.Future fetchAndSetAllRoutinesFull() => + _i12.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesFull, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetAllRoutinesSparse() => + _i12.Future fetchAndSetAllRoutinesSparse() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesSparse, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future setExercisesAndUnits( - List<_i14.DayData>? entries, { - Map? exercises, + _i12.Future setExercisesAndUnits( + List<_i13.DayData>? entries, { + Map? exercises, }) => (super.noSuchMethod( Invocation.method( @@ -250,205 +263,205 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { [entries], {#exercises: exercises}, ), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineSparse, [planId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineFull, [routineId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => + _i12.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#addRoutine, [routine]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future editRoutine(_i5.Routine? routine) => + _i12.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#editRoutine, [routine]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteRoutine(int? id) => + _i12.Future deleteRoutine(int? id) => (super.noSuchMethod( Invocation.method(#deleteRoutine, [id]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetRepetitionUnits() => + _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetWeightUnits() => + _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetUnits() => + _i12.Future fetchAndSetUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i6.Day> addDay(_i6.Day? day) => + _i12.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#addDay, [day]), - returnValue: _i13.Future<_i6.Day>.value( + returnValue: _i12.Future<_i6.Day>.value( _FakeDay_4(this, Invocation.method(#addDay, [day])), ), ) - as _i13.Future<_i6.Day>); + as _i12.Future<_i6.Day>); @override - _i13.Future editDay(_i6.Day? day) => + _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#editDay, [day]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editDays(List<_i6.Day>? days) => + _i12.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( Invocation.method(#editDays, [days]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteDay(int? dayId) => + _i12.Future deleteDay(int? dayId) => (super.noSuchMethod( Invocation.method(#deleteDay, [dayId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => + _i12.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#addSlot, [slot, routineId]), - returnValue: _i13.Future<_i7.Slot>.value( + returnValue: _i12.Future<_i7.Slot>.value( _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), ), ) - as _i13.Future<_i7.Slot>); + as _i12.Future<_i7.Slot>); @override - _i13.Future deleteSlot(int? slotId, int? routineId) => + _i12.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlot, [slotId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlot(_i7.Slot? slot, int? routineId) => + _i12.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlot, [slot, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => + _i12.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlots, [slots, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry( + _i12.Future<_i8.SlotEntry> addSlotEntry( _i8.SlotEntry? entry, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), - returnValue: _i13.Future<_i8.SlotEntry>.value( + returnValue: _i12.Future<_i8.SlotEntry>.value( _FakeSlotEntry_6( this, Invocation.method(#addSlotEntry, [entry, routineId]), ), ), ) - as _i13.Future<_i8.SlotEntry>); + as _i12.Future<_i8.SlotEntry>); @override - _i13.Future deleteSlotEntry(int? id, int? routineId) => + _i12.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlotEntry, [id, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i12.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlotEntry, [entry, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue( + returnValue: _i15.dummyValue( this, Invocation.method(#getConfigUrl, [type]), ), @@ -456,125 +469,115 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as String); @override - _i13.Future<_i9.BaseConfig> editConfig( + _i12.Future<_i9.BaseConfig> editConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#editConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig( + _i12.Future<_i9.BaseConfig> addConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#addConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => + _i12.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#deleteConfig, [id, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future handleConfig( + _i12.Future handleConfig( _i8.SlotEntry? entry, num? value, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future> fetchSessionData() => + _i12.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value( + returnValue: _i12.Future>.value( <_i10.WorkoutSession>[], ), ) - as _i13.Future>); + as _i12.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession( + _i12.Future<_i10.WorkoutSession> addSession( _i10.WorkoutSession? session, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#addSession, [session, routineId]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => + _i12.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( Invocation.method(#editSession, [session]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#editSession, [session]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i11.Log> addLog(_i11.Log? log) => - (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i13.Future<_i11.Log>.value( - _FakeLog_9(this, Invocation.method(#addLog, [log])), - ), - ) - as _i13.Future<_i11.Log>); - - @override - _i13.Future deleteLog(int? logId, int? routineId) => + _i12.Future deleteLog(String? logId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteLog, [logId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - void addListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null, ); diff --git a/test/routine/forms/session_form_test.mocks.dart b/test/routine/forms/session_form_test.mocks.dart index 89bc37be2..351b89496 100644 --- a/test/routine/forms/session_form_test.mocks.dart +++ b/test/routine/forms/session_form_test.mocks.dart @@ -1,18 +1,35 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Mocks generated by Mockito 5.4.6 from annotations // in wger/test/routine/forms/session_form_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i13; -import 'dart:ui' as _i17; +import 'dart:async' as _i12; +import 'dart:ui' as _i16; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i16; -import 'package:wger/models/exercises/exercise.dart' as _i15; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/exercises/exercise.dart' as _i14; import 'package:wger/models/workouts/base_config.dart' as _i9; import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/day_data.dart' as _i14; -import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/day_data.dart' as _i13; import 'package:wger/models/workouts/repetition_unit.dart' as _i4; import 'package:wger/models/workouts/routine.dart' as _i5; import 'package:wger/models/workouts/session.dart' as _i10; @@ -20,7 +37,7 @@ import 'package:wger/models/workouts/slot.dart' as _i7; import 'package:wger/models/workouts/slot_entry.dart' as _i8; import 'package:wger/models/workouts/weight_unit.dart' as _i3; import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/routines.dart' as _i12; +import 'package:wger/providers/routines.dart' as _i11; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -75,14 +92,10 @@ class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession : super(parent, parentInvocation); } -class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - /// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { +class MockRoutinesProvider extends _i1.Mock implements _i11.RoutinesProvider { MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -222,27 +235,27 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as int); @override - _i13.Future fetchAndSetAllRoutinesFull() => + _i12.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesFull, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetAllRoutinesSparse() => + _i12.Future fetchAndSetAllRoutinesSparse() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesSparse, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future setExercisesAndUnits( - List<_i14.DayData>? entries, { - Map? exercises, + _i12.Future setExercisesAndUnits( + List<_i13.DayData>? entries, { + Map? exercises, }) => (super.noSuchMethod( Invocation.method( @@ -250,205 +263,205 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { [entries], {#exercises: exercises}, ), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineSparse, [planId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineFull, [routineId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => + _i12.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#addRoutine, [routine]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future editRoutine(_i5.Routine? routine) => + _i12.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#editRoutine, [routine]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteRoutine(int? id) => + _i12.Future deleteRoutine(int? id) => (super.noSuchMethod( Invocation.method(#deleteRoutine, [id]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetRepetitionUnits() => + _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetWeightUnits() => + _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetUnits() => + _i12.Future fetchAndSetUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i6.Day> addDay(_i6.Day? day) => + _i12.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#addDay, [day]), - returnValue: _i13.Future<_i6.Day>.value( + returnValue: _i12.Future<_i6.Day>.value( _FakeDay_4(this, Invocation.method(#addDay, [day])), ), ) - as _i13.Future<_i6.Day>); + as _i12.Future<_i6.Day>); @override - _i13.Future editDay(_i6.Day? day) => + _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#editDay, [day]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editDays(List<_i6.Day>? days) => + _i12.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( Invocation.method(#editDays, [days]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteDay(int? dayId) => + _i12.Future deleteDay(int? dayId) => (super.noSuchMethod( Invocation.method(#deleteDay, [dayId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => + _i12.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#addSlot, [slot, routineId]), - returnValue: _i13.Future<_i7.Slot>.value( + returnValue: _i12.Future<_i7.Slot>.value( _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), ), ) - as _i13.Future<_i7.Slot>); + as _i12.Future<_i7.Slot>); @override - _i13.Future deleteSlot(int? slotId, int? routineId) => + _i12.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlot, [slotId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlot(_i7.Slot? slot, int? routineId) => + _i12.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlot, [slot, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => + _i12.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlots, [slots, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry( + _i12.Future<_i8.SlotEntry> addSlotEntry( _i8.SlotEntry? entry, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), - returnValue: _i13.Future<_i8.SlotEntry>.value( + returnValue: _i12.Future<_i8.SlotEntry>.value( _FakeSlotEntry_6( this, Invocation.method(#addSlotEntry, [entry, routineId]), ), ), ) - as _i13.Future<_i8.SlotEntry>); + as _i12.Future<_i8.SlotEntry>); @override - _i13.Future deleteSlotEntry(int? id, int? routineId) => + _i12.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlotEntry, [id, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i12.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlotEntry, [entry, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue( + returnValue: _i15.dummyValue( this, Invocation.method(#getConfigUrl, [type]), ), @@ -456,125 +469,115 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as String); @override - _i13.Future<_i9.BaseConfig> editConfig( + _i12.Future<_i9.BaseConfig> editConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#editConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig( + _i12.Future<_i9.BaseConfig> addConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#addConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => + _i12.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#deleteConfig, [id, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future handleConfig( + _i12.Future handleConfig( _i8.SlotEntry? entry, num? value, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future> fetchSessionData() => + _i12.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value( + returnValue: _i12.Future>.value( <_i10.WorkoutSession>[], ), ) - as _i13.Future>); + as _i12.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession( + _i12.Future<_i10.WorkoutSession> addSession( _i10.WorkoutSession? session, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#addSession, [session, routineId]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => + _i12.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( Invocation.method(#editSession, [session]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#editSession, [session]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i11.Log> addLog(_i11.Log? log) => - (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i13.Future<_i11.Log>.value( - _FakeLog_9(this, Invocation.method(#addLog, [log])), - ), - ) - as _i13.Future<_i11.Log>); - - @override - _i13.Future deleteLog(int? logId, int? routineId) => + _i12.Future deleteLog(String? logId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteLog, [logId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - void addListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null, ); diff --git a/test/routine/gym_mode_screen_test.mocks.dart b/test/routine/gym_mode_screen_test.mocks.dart index d19125f82..6dce7cf77 100644 --- a/test/routine/gym_mode_screen_test.mocks.dart +++ b/test/routine/gym_mode_screen_test.mocks.dart @@ -1,14 +1,32 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Mocks generated by Mockito 5.4.6 from annotations // in wger/test/routine/gym_mode_screen_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i20; -import 'dart:ui' as _i22; +import 'dart:async' as _i19; +import 'dart:ui' as _i21; import 'package:http/http.dart' as _i3; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i25; +import 'package:mockito/src/dummies.dart' as _i24; import 'package:wger/database/exercises/exercise_database.dart' as _i5; import 'package:wger/models/exercises/category.dart' as _i7; import 'package:wger/models/exercises/equipment.dart' as _i8; @@ -17,8 +35,7 @@ import 'package:wger/models/exercises/language.dart' as _i10; import 'package:wger/models/exercises/muscle.dart' as _i9; import 'package:wger/models/workouts/base_config.dart' as _i17; import 'package:wger/models/workouts/day.dart' as _i14; -import 'package:wger/models/workouts/day_data.dart' as _i24; -import 'package:wger/models/workouts/log.dart' as _i19; +import 'package:wger/models/workouts/day_data.dart' as _i23; import 'package:wger/models/workouts/repetition_unit.dart' as _i12; import 'package:wger/models/workouts/routine.dart' as _i13; import 'package:wger/models/workouts/session.dart' as _i18; @@ -27,8 +44,8 @@ import 'package:wger/models/workouts/slot_entry.dart' as _i16; import 'package:wger/models/workouts/weight_unit.dart' as _i11; import 'package:wger/providers/auth.dart' as _i2; import 'package:wger/providers/base_provider.dart' as _i4; -import 'package:wger/providers/exercises.dart' as _i21; -import 'package:wger/providers/routines.dart' as _i23; +import 'package:wger/providers/exercises.dart' as _i20; +import 'package:wger/providers/routines.dart' as _i22; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -125,10 +142,6 @@ class _FakeWorkoutSession_18 extends _i1.SmartFake implements _i18.WorkoutSessio : super(parent, parentInvocation); } -class _FakeLog_19 extends _i1.SmartFake implements _i19.Log { - _FakeLog_19(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - /// A class which mocks [WgerBaseProvider]. /// /// See the documentation for Mockito's code generation for more information. @@ -200,65 +213,65 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { as Uri); @override - _i20.Future fetch(Uri? uri) => + _i19.Future fetch(Uri? uri) => (super.noSuchMethod( Invocation.method(#fetch, [uri]), - returnValue: _i20.Future.value(), + returnValue: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future> fetchPaginated(Uri? uri) => + _i19.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( Invocation.method(#fetchPaginated, [uri]), - returnValue: _i20.Future>.value([]), + returnValue: _i19.Future>.value([]), ) - as _i20.Future>); + as _i19.Future>); @override - _i20.Future> post( + _i19.Future> post( Map? data, Uri? uri, ) => (super.noSuchMethod( Invocation.method(#post, [data, uri]), - returnValue: _i20.Future>.value( + returnValue: _i19.Future>.value( {}, ), ) - as _i20.Future>); + as _i19.Future>); @override - _i20.Future> patch( + _i19.Future> patch( Map? data, Uri? uri, ) => (super.noSuchMethod( Invocation.method(#patch, [data, uri]), - returnValue: _i20.Future>.value( + returnValue: _i19.Future>.value( {}, ), ) - as _i20.Future>); + as _i19.Future>); @override - _i20.Future<_i3.Response> deleteRequest(String? url, int? id) => + _i19.Future<_i3.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod( Invocation.method(#deleteRequest, [url, id]), - returnValue: _i20.Future<_i3.Response>.value( + returnValue: _i19.Future<_i3.Response>.value( _FakeResponse_3( this, Invocation.method(#deleteRequest, [url, id]), ), ), ) - as _i20.Future<_i3.Response>); + as _i19.Future<_i3.Response>); } /// A class which mocks [ExercisesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { +class MockExercisesProvider extends _i1.Mock implements _i20.ExercisesProvider { MockExercisesProvider() { _i1.throwOnMissingStub(this); } @@ -293,14 +306,6 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { ) as List<_i6.Exercise>); - @override - List<_i6.Exercise> get filteredExercises => - (super.noSuchMethod( - Invocation.getter(#filteredExercises), - returnValue: <_i6.Exercise>[], - ) - as List<_i6.Exercise>); - @override Map> get exerciseByVariation => (super.noSuchMethod( @@ -353,12 +358,6 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { 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), @@ -369,30 +368,6 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { bool get hasListeners => (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); - @override - _i20.Future setFilters(_i21.Filters? newFilters) => - (super.noSuchMethod( - Invocation.method(#setFilters, [newFilters]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) - as _i20.Future); - - @override - void initFilters() => super.noSuchMethod( - Invocation.method(#initFilters, []), - returnValueForMissingStub: null, - ); - - @override - _i20.Future findByFilters() => - (super.noSuchMethod( - Invocation.method(#findByFilters, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) - as _i20.Future); - @override void clear() => super.noSuchMethod( Invocation.method(#clear, []), @@ -470,60 +445,60 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { as _i10.Language); @override - _i20.Future fetchAndSetCategoriesFromApi() => + _i19.Future fetchAndSetCategoriesFromApi() => (super.noSuchMethod( Invocation.method(#fetchAndSetCategoriesFromApi, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetMusclesFromApi() => + _i19.Future fetchAndSetMusclesFromApi() => (super.noSuchMethod( Invocation.method(#fetchAndSetMusclesFromApi, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetEquipmentsFromApi() => + _i19.Future fetchAndSetEquipmentsFromApi() => (super.noSuchMethod( Invocation.method(#fetchAndSetEquipmentsFromApi, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetLanguagesFromApi() => + _i19.Future fetchAndSetLanguagesFromApi() => (super.noSuchMethod( Invocation.method(#fetchAndSetLanguagesFromApi, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetAllExercises() => + _i19.Future fetchAndSetAllExercises() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllExercises, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future<_i6.Exercise?> fetchAndSetExercise(int? exerciseId) => + _i19.Future<_i6.Exercise?> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod( Invocation.method(#fetchAndSetExercise, [exerciseId]), - returnValue: _i20.Future<_i6.Exercise?>.value(), + returnValue: _i19.Future<_i6.Exercise?>.value(), ) - as _i20.Future<_i6.Exercise?>); + as _i19.Future<_i6.Exercise?>); @override - _i20.Future<_i6.Exercise> handleUpdateExerciseFromApi( + _i19.Future<_i6.Exercise> handleUpdateExerciseFromApi( _i5.ExerciseDatabase? database, int? exerciseId, ) => @@ -532,7 +507,7 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { database, exerciseId, ]), - returnValue: _i20.Future<_i6.Exercise>.value( + returnValue: _i19.Future<_i6.Exercise>.value( _FakeExercise_6( this, Invocation.method(#handleUpdateExerciseFromApi, [ @@ -542,39 +517,39 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { ), ), ) - as _i20.Future<_i6.Exercise>); + as _i19.Future<_i6.Exercise>); @override - _i20.Future initCacheTimesLocalPrefs({dynamic forceInit = false}) => + _i19.Future initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod( Invocation.method(#initCacheTimesLocalPrefs, [], { #forceInit: forceInit, }), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future clearAllCachesAndPrefs() => + _i19.Future clearAllCachesAndPrefs() => (super.noSuchMethod( Invocation.method(#clearAllCachesAndPrefs, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetInitialData() => + _i19.Future fetchAndSetInitialData() => (super.noSuchMethod( Invocation.method(#fetchAndSetInitialData, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future setExercisesFromDatabase( + _i19.Future setExercisesFromDatabase( _i5.ExerciseDatabase? database, { bool? forceDeleteCache = false, }) => @@ -584,82 +559,64 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { [database], {#forceDeleteCache: forceDeleteCache}, ), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future updateExerciseCache(_i5.ExerciseDatabase? database) => + _i19.Future updateExerciseCache(_i5.ExerciseDatabase? database) => (super.noSuchMethod( Invocation.method(#updateExerciseCache, [database]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetMuscles(_i5.ExerciseDatabase? database) => + _i19.Future fetchAndSetMuscles(_i5.ExerciseDatabase? database) => (super.noSuchMethod( Invocation.method(#fetchAndSetMuscles, [database]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetCategories(_i5.ExerciseDatabase? database) => + _i19.Future fetchAndSetCategories(_i5.ExerciseDatabase? database) => (super.noSuchMethod( Invocation.method(#fetchAndSetCategories, [database]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetLanguages(_i5.ExerciseDatabase? database) => + _i19.Future fetchAndSetLanguages(_i5.ExerciseDatabase? database) => (super.noSuchMethod( Invocation.method(#fetchAndSetLanguages, [database]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetEquipments(_i5.ExerciseDatabase? database) => + _i19.Future fetchAndSetEquipments(_i5.ExerciseDatabase? database) => (super.noSuchMethod( Invocation.method(#fetchAndSetEquipments, [database]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future> searchExercise( - String? name, { - String? languageCode = 'en', - bool? searchEnglish = false, - }) => - (super.noSuchMethod( - Invocation.method( - #searchExercise, - [name], - {#languageCode: languageCode, #searchEnglish: searchEnglish}, - ), - returnValue: _i20.Future>.value( - <_i6.Exercise>[], - ), - ) - as _i20.Future>); - - @override - void addListener(_i22.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i22.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null, ); @@ -680,7 +637,7 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { /// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { +class MockRoutinesProvider extends _i1.Mock implements _i22.RoutinesProvider { MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -820,26 +777,26 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { as int); @override - _i20.Future fetchAndSetAllRoutinesFull() => + _i19.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesFull, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetAllRoutinesSparse() => + _i19.Future fetchAndSetAllRoutinesSparse() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesSparse, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future setExercisesAndUnits( - List<_i24.DayData>? entries, { + _i19.Future setExercisesAndUnits( + List<_i23.DayData>? entries, { Map? exercises, }) => (super.noSuchMethod( @@ -848,208 +805,208 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { [entries], {#exercises: exercises}, ), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future<_i13.Routine> fetchAndSetRoutineSparse(int? planId) => + _i19.Future<_i13.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), - returnValue: _i20.Future<_i13.Routine>.value( + returnValue: _i19.Future<_i13.Routine>.value( _FakeRoutine_13( this, Invocation.method(#fetchAndSetRoutineSparse, [planId]), ), ), ) - as _i20.Future<_i13.Routine>); + as _i19.Future<_i13.Routine>); @override - _i20.Future<_i13.Routine> fetchAndSetRoutineFull(int? routineId) => + _i19.Future<_i13.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), - returnValue: _i20.Future<_i13.Routine>.value( + returnValue: _i19.Future<_i13.Routine>.value( _FakeRoutine_13( this, Invocation.method(#fetchAndSetRoutineFull, [routineId]), ), ), ) - as _i20.Future<_i13.Routine>); + as _i19.Future<_i13.Routine>); @override - _i20.Future<_i13.Routine> addRoutine(_i13.Routine? routine) => + _i19.Future<_i13.Routine> addRoutine(_i13.Routine? routine) => (super.noSuchMethod( Invocation.method(#addRoutine, [routine]), - returnValue: _i20.Future<_i13.Routine>.value( + returnValue: _i19.Future<_i13.Routine>.value( _FakeRoutine_13(this, Invocation.method(#addRoutine, [routine])), ), ) - as _i20.Future<_i13.Routine>); + as _i19.Future<_i13.Routine>); @override - _i20.Future editRoutine(_i13.Routine? routine) => + _i19.Future editRoutine(_i13.Routine? routine) => (super.noSuchMethod( Invocation.method(#editRoutine, [routine]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future deleteRoutine(int? id) => + _i19.Future deleteRoutine(int? id) => (super.noSuchMethod( Invocation.method(#deleteRoutine, [id]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetRepetitionUnits() => + _i19.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetWeightUnits() => + _i19.Future fetchAndSetWeightUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future fetchAndSetUnits() => + _i19.Future fetchAndSetUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetUnits, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future<_i14.Day> addDay(_i14.Day? day) => + _i19.Future<_i14.Day> addDay(_i14.Day? day) => (super.noSuchMethod( Invocation.method(#addDay, [day]), - returnValue: _i20.Future<_i14.Day>.value( + returnValue: _i19.Future<_i14.Day>.value( _FakeDay_14(this, Invocation.method(#addDay, [day])), ), ) - as _i20.Future<_i14.Day>); + as _i19.Future<_i14.Day>); @override - _i20.Future editDay(_i14.Day? day) => + _i19.Future editDay(_i14.Day? day) => (super.noSuchMethod( Invocation.method(#editDay, [day]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future editDays(List<_i14.Day>? days) => + _i19.Future editDays(List<_i14.Day>? days) => (super.noSuchMethod( Invocation.method(#editDays, [days]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future deleteDay(int? dayId) => + _i19.Future deleteDay(int? dayId) => (super.noSuchMethod( Invocation.method(#deleteDay, [dayId]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future<_i15.Slot> addSlot(_i15.Slot? slot, int? routineId) => + _i19.Future<_i15.Slot> addSlot(_i15.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#addSlot, [slot, routineId]), - returnValue: _i20.Future<_i15.Slot>.value( + returnValue: _i19.Future<_i15.Slot>.value( _FakeSlot_15( this, Invocation.method(#addSlot, [slot, routineId]), ), ), ) - as _i20.Future<_i15.Slot>); + as _i19.Future<_i15.Slot>); @override - _i20.Future deleteSlot(int? slotId, int? routineId) => + _i19.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlot, [slotId, routineId]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future editSlot(_i15.Slot? slot, int? routineId) => + _i19.Future editSlot(_i15.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlot, [slot, routineId]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future editSlots(List<_i15.Slot>? slots, int? routineId) => + _i19.Future editSlots(List<_i15.Slot>? slots, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlots, [slots, routineId]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future<_i16.SlotEntry> addSlotEntry( + _i19.Future<_i16.SlotEntry> addSlotEntry( _i16.SlotEntry? entry, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), - returnValue: _i20.Future<_i16.SlotEntry>.value( + returnValue: _i19.Future<_i16.SlotEntry>.value( _FakeSlotEntry_16( this, Invocation.method(#addSlotEntry, [entry, routineId]), ), ), ) - as _i20.Future<_i16.SlotEntry>); + as _i19.Future<_i16.SlotEntry>); @override - _i20.Future deleteSlotEntry(int? id, int? routineId) => + _i19.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlotEntry, [id, routineId]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future editSlotEntry(_i16.SlotEntry? entry, int? routineId) => + _i19.Future editSlotEntry(_i16.SlotEntry? entry, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlotEntry, [entry, routineId]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override String getConfigUrl(_i16.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i25.dummyValue( + returnValue: _i24.dummyValue( this, Invocation.method(#getConfigUrl, [type]), ), @@ -1057,125 +1014,115 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { as String); @override - _i20.Future<_i17.BaseConfig> editConfig( + _i19.Future<_i17.BaseConfig> editConfig( _i17.BaseConfig? config, _i16.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), - returnValue: _i20.Future<_i17.BaseConfig>.value( + returnValue: _i19.Future<_i17.BaseConfig>.value( _FakeBaseConfig_17( this, Invocation.method(#editConfig, [config, type]), ), ), ) - as _i20.Future<_i17.BaseConfig>); + as _i19.Future<_i17.BaseConfig>); @override - _i20.Future<_i17.BaseConfig> addConfig( + _i19.Future<_i17.BaseConfig> addConfig( _i17.BaseConfig? config, _i16.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), - returnValue: _i20.Future<_i17.BaseConfig>.value( + returnValue: _i19.Future<_i17.BaseConfig>.value( _FakeBaseConfig_17( this, Invocation.method(#addConfig, [config, type]), ), ), ) - as _i20.Future<_i17.BaseConfig>); + as _i19.Future<_i17.BaseConfig>); @override - _i20.Future deleteConfig(int? id, _i16.ConfigType? type) => + _i19.Future deleteConfig(int? id, _i16.ConfigType? type) => (super.noSuchMethod( Invocation.method(#deleteConfig, [id, type]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future handleConfig( + _i19.Future handleConfig( _i16.SlotEntry? entry, num? value, _i16.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - _i20.Future> fetchSessionData() => + _i19.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i20.Future>.value( + returnValue: _i19.Future>.value( <_i18.WorkoutSession>[], ), ) - as _i20.Future>); + as _i19.Future>); @override - _i20.Future<_i18.WorkoutSession> addSession( + _i19.Future<_i18.WorkoutSession> addSession( _i18.WorkoutSession? session, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), - returnValue: _i20.Future<_i18.WorkoutSession>.value( + returnValue: _i19.Future<_i18.WorkoutSession>.value( _FakeWorkoutSession_18( this, Invocation.method(#addSession, [session, routineId]), ), ), ) - as _i20.Future<_i18.WorkoutSession>); + as _i19.Future<_i18.WorkoutSession>); @override - _i20.Future<_i18.WorkoutSession> editSession(_i18.WorkoutSession? session) => + _i19.Future<_i18.WorkoutSession> editSession(_i18.WorkoutSession? session) => (super.noSuchMethod( Invocation.method(#editSession, [session]), - returnValue: _i20.Future<_i18.WorkoutSession>.value( + returnValue: _i19.Future<_i18.WorkoutSession>.value( _FakeWorkoutSession_18( this, Invocation.method(#editSession, [session]), ), ), ) - as _i20.Future<_i18.WorkoutSession>); + as _i19.Future<_i18.WorkoutSession>); @override - _i20.Future<_i19.Log> addLog(_i19.Log? log) => - (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i20.Future<_i19.Log>.value( - _FakeLog_19(this, Invocation.method(#addLog, [log])), - ), - ) - as _i20.Future<_i19.Log>); - - @override - _i20.Future deleteLog(int? logId, int? routineId) => + _i19.Future deleteLog(String? logId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteLog, [logId, routineId]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), + returnValue: _i19.Future.value(), + returnValueForMissingStub: _i19.Future.value(), ) - as _i20.Future); + as _i19.Future); @override - void addListener(_i22.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i22.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), 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 6c2c69644..987328099 100644 --- a/test/routine/gym_mode_session_screen_test.mocks.dart +++ b/test/routine/gym_mode_session_screen_test.mocks.dart @@ -1,18 +1,35 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Mocks generated by Mockito 5.4.6 from annotations // in wger/test/routine/gym_mode_session_screen_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i13; -import 'dart:ui' as _i17; +import 'dart:async' as _i12; +import 'dart:ui' as _i16; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i16; -import 'package:wger/models/exercises/exercise.dart' as _i15; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/exercises/exercise.dart' as _i14; import 'package:wger/models/workouts/base_config.dart' as _i9; import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/day_data.dart' as _i14; -import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/day_data.dart' as _i13; import 'package:wger/models/workouts/repetition_unit.dart' as _i4; import 'package:wger/models/workouts/routine.dart' as _i5; import 'package:wger/models/workouts/session.dart' as _i10; @@ -20,7 +37,7 @@ import 'package:wger/models/workouts/slot.dart' as _i7; import 'package:wger/models/workouts/slot_entry.dart' as _i8; import 'package:wger/models/workouts/weight_unit.dart' as _i3; import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/routines.dart' as _i12; +import 'package:wger/providers/routines.dart' as _i11; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -75,14 +92,10 @@ class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession : super(parent, parentInvocation); } -class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - /// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { +class MockRoutinesProvider extends _i1.Mock implements _i11.RoutinesProvider { MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -222,27 +235,27 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as int); @override - _i13.Future fetchAndSetAllRoutinesFull() => + _i12.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesFull, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetAllRoutinesSparse() => + _i12.Future fetchAndSetAllRoutinesSparse() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesSparse, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future setExercisesAndUnits( - List<_i14.DayData>? entries, { - Map? exercises, + _i12.Future setExercisesAndUnits( + List<_i13.DayData>? entries, { + Map? exercises, }) => (super.noSuchMethod( Invocation.method( @@ -250,205 +263,205 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { [entries], {#exercises: exercises}, ), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineSparse, [planId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineFull, [routineId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => + _i12.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#addRoutine, [routine]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future editRoutine(_i5.Routine? routine) => + _i12.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#editRoutine, [routine]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteRoutine(int? id) => + _i12.Future deleteRoutine(int? id) => (super.noSuchMethod( Invocation.method(#deleteRoutine, [id]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetRepetitionUnits() => + _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetWeightUnits() => + _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetUnits() => + _i12.Future fetchAndSetUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i6.Day> addDay(_i6.Day? day) => + _i12.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#addDay, [day]), - returnValue: _i13.Future<_i6.Day>.value( + returnValue: _i12.Future<_i6.Day>.value( _FakeDay_4(this, Invocation.method(#addDay, [day])), ), ) - as _i13.Future<_i6.Day>); + as _i12.Future<_i6.Day>); @override - _i13.Future editDay(_i6.Day? day) => + _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#editDay, [day]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editDays(List<_i6.Day>? days) => + _i12.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( Invocation.method(#editDays, [days]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteDay(int? dayId) => + _i12.Future deleteDay(int? dayId) => (super.noSuchMethod( Invocation.method(#deleteDay, [dayId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => + _i12.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#addSlot, [slot, routineId]), - returnValue: _i13.Future<_i7.Slot>.value( + returnValue: _i12.Future<_i7.Slot>.value( _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), ), ) - as _i13.Future<_i7.Slot>); + as _i12.Future<_i7.Slot>); @override - _i13.Future deleteSlot(int? slotId, int? routineId) => + _i12.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlot, [slotId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlot(_i7.Slot? slot, int? routineId) => + _i12.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlot, [slot, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => + _i12.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlots, [slots, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry( + _i12.Future<_i8.SlotEntry> addSlotEntry( _i8.SlotEntry? entry, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), - returnValue: _i13.Future<_i8.SlotEntry>.value( + returnValue: _i12.Future<_i8.SlotEntry>.value( _FakeSlotEntry_6( this, Invocation.method(#addSlotEntry, [entry, routineId]), ), ), ) - as _i13.Future<_i8.SlotEntry>); + as _i12.Future<_i8.SlotEntry>); @override - _i13.Future deleteSlotEntry(int? id, int? routineId) => + _i12.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlotEntry, [id, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i12.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlotEntry, [entry, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue( + returnValue: _i15.dummyValue( this, Invocation.method(#getConfigUrl, [type]), ), @@ -456,125 +469,115 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as String); @override - _i13.Future<_i9.BaseConfig> editConfig( + _i12.Future<_i9.BaseConfig> editConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#editConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig( + _i12.Future<_i9.BaseConfig> addConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#addConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => + _i12.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#deleteConfig, [id, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future handleConfig( + _i12.Future handleConfig( _i8.SlotEntry? entry, num? value, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future> fetchSessionData() => + _i12.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value( + returnValue: _i12.Future>.value( <_i10.WorkoutSession>[], ), ) - as _i13.Future>); + as _i12.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession( + _i12.Future<_i10.WorkoutSession> addSession( _i10.WorkoutSession? session, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#addSession, [session, routineId]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => + _i12.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( Invocation.method(#editSession, [session]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#editSession, [session]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i11.Log> addLog(_i11.Log? log) => - (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i13.Future<_i11.Log>.value( - _FakeLog_9(this, Invocation.method(#addLog, [log])), - ), - ) - as _i13.Future<_i11.Log>); - - @override - _i13.Future deleteLog(int? logId, int? routineId) => + _i12.Future deleteLog(String? logId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteLog, [logId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - void addListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null, ); diff --git a/test/routine/repetition_unit_form_widget_test.mocks.dart b/test/routine/repetition_unit_form_widget_test.mocks.dart index 601de390a..00ae9e6dd 100644 --- a/test/routine/repetition_unit_form_widget_test.mocks.dart +++ b/test/routine/repetition_unit_form_widget_test.mocks.dart @@ -1,18 +1,35 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Mocks generated by Mockito 5.4.6 from annotations // in wger/test/routine/repetition_unit_form_widget_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i13; -import 'dart:ui' as _i17; +import 'dart:async' as _i12; +import 'dart:ui' as _i16; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i16; -import 'package:wger/models/exercises/exercise.dart' as _i15; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/exercises/exercise.dart' as _i14; import 'package:wger/models/workouts/base_config.dart' as _i9; import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/day_data.dart' as _i14; -import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/day_data.dart' as _i13; import 'package:wger/models/workouts/repetition_unit.dart' as _i4; import 'package:wger/models/workouts/routine.dart' as _i5; import 'package:wger/models/workouts/session.dart' as _i10; @@ -20,7 +37,7 @@ import 'package:wger/models/workouts/slot.dart' as _i7; import 'package:wger/models/workouts/slot_entry.dart' as _i8; import 'package:wger/models/workouts/weight_unit.dart' as _i3; import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/routines.dart' as _i12; +import 'package:wger/providers/routines.dart' as _i11; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -75,14 +92,10 @@ class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession : super(parent, parentInvocation); } -class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - /// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { +class MockRoutinesProvider extends _i1.Mock implements _i11.RoutinesProvider { MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -222,27 +235,27 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as int); @override - _i13.Future fetchAndSetAllRoutinesFull() => + _i12.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesFull, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetAllRoutinesSparse() => + _i12.Future fetchAndSetAllRoutinesSparse() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesSparse, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future setExercisesAndUnits( - List<_i14.DayData>? entries, { - Map? exercises, + _i12.Future setExercisesAndUnits( + List<_i13.DayData>? entries, { + Map? exercises, }) => (super.noSuchMethod( Invocation.method( @@ -250,205 +263,205 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { [entries], {#exercises: exercises}, ), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineSparse, [planId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineFull, [routineId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => + _i12.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#addRoutine, [routine]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future editRoutine(_i5.Routine? routine) => + _i12.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#editRoutine, [routine]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteRoutine(int? id) => + _i12.Future deleteRoutine(int? id) => (super.noSuchMethod( Invocation.method(#deleteRoutine, [id]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetRepetitionUnits() => + _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetWeightUnits() => + _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetUnits() => + _i12.Future fetchAndSetUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i6.Day> addDay(_i6.Day? day) => + _i12.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#addDay, [day]), - returnValue: _i13.Future<_i6.Day>.value( + returnValue: _i12.Future<_i6.Day>.value( _FakeDay_4(this, Invocation.method(#addDay, [day])), ), ) - as _i13.Future<_i6.Day>); + as _i12.Future<_i6.Day>); @override - _i13.Future editDay(_i6.Day? day) => + _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#editDay, [day]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editDays(List<_i6.Day>? days) => + _i12.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( Invocation.method(#editDays, [days]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteDay(int? dayId) => + _i12.Future deleteDay(int? dayId) => (super.noSuchMethod( Invocation.method(#deleteDay, [dayId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => + _i12.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#addSlot, [slot, routineId]), - returnValue: _i13.Future<_i7.Slot>.value( + returnValue: _i12.Future<_i7.Slot>.value( _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), ), ) - as _i13.Future<_i7.Slot>); + as _i12.Future<_i7.Slot>); @override - _i13.Future deleteSlot(int? slotId, int? routineId) => + _i12.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlot, [slotId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlot(_i7.Slot? slot, int? routineId) => + _i12.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlot, [slot, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => + _i12.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlots, [slots, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry( + _i12.Future<_i8.SlotEntry> addSlotEntry( _i8.SlotEntry? entry, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), - returnValue: _i13.Future<_i8.SlotEntry>.value( + returnValue: _i12.Future<_i8.SlotEntry>.value( _FakeSlotEntry_6( this, Invocation.method(#addSlotEntry, [entry, routineId]), ), ), ) - as _i13.Future<_i8.SlotEntry>); + as _i12.Future<_i8.SlotEntry>); @override - _i13.Future deleteSlotEntry(int? id, int? routineId) => + _i12.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlotEntry, [id, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i12.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlotEntry, [entry, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue( + returnValue: _i15.dummyValue( this, Invocation.method(#getConfigUrl, [type]), ), @@ -456,125 +469,115 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as String); @override - _i13.Future<_i9.BaseConfig> editConfig( + _i12.Future<_i9.BaseConfig> editConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#editConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig( + _i12.Future<_i9.BaseConfig> addConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#addConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => + _i12.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#deleteConfig, [id, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future handleConfig( + _i12.Future handleConfig( _i8.SlotEntry? entry, num? value, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future> fetchSessionData() => + _i12.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value( + returnValue: _i12.Future>.value( <_i10.WorkoutSession>[], ), ) - as _i13.Future>); + as _i12.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession( + _i12.Future<_i10.WorkoutSession> addSession( _i10.WorkoutSession? session, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#addSession, [session, routineId]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => + _i12.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( Invocation.method(#editSession, [session]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#editSession, [session]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i11.Log> addLog(_i11.Log? log) => - (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i13.Future<_i11.Log>.value( - _FakeLog_9(this, Invocation.method(#addLog, [log])), - ), - ) - as _i13.Future<_i11.Log>); - - @override - _i13.Future deleteLog(int? logId, int? routineId) => + _i12.Future deleteLog(String? logId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteLog, [logId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - void addListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null, ); diff --git a/test/routine/routine_edit_screen_test.mocks.dart b/test/routine/routine_edit_screen_test.mocks.dart index a9bda5736..c492ae016 100644 --- a/test/routine/routine_edit_screen_test.mocks.dart +++ b/test/routine/routine_edit_screen_test.mocks.dart @@ -1,18 +1,35 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Mocks generated by Mockito 5.4.6 from annotations // in wger/test/routine/routine_edit_screen_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i13; -import 'dart:ui' as _i17; +import 'dart:async' as _i12; +import 'dart:ui' as _i16; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i16; -import 'package:wger/models/exercises/exercise.dart' as _i15; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/exercises/exercise.dart' as _i14; import 'package:wger/models/workouts/base_config.dart' as _i9; import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/day_data.dart' as _i14; -import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/day_data.dart' as _i13; import 'package:wger/models/workouts/repetition_unit.dart' as _i4; import 'package:wger/models/workouts/routine.dart' as _i5; import 'package:wger/models/workouts/session.dart' as _i10; @@ -20,7 +37,7 @@ import 'package:wger/models/workouts/slot.dart' as _i7; import 'package:wger/models/workouts/slot_entry.dart' as _i8; import 'package:wger/models/workouts/weight_unit.dart' as _i3; import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/routines.dart' as _i12; +import 'package:wger/providers/routines.dart' as _i11; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -75,14 +92,10 @@ class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession : super(parent, parentInvocation); } -class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - /// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { +class MockRoutinesProvider extends _i1.Mock implements _i11.RoutinesProvider { MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -222,27 +235,27 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as int); @override - _i13.Future fetchAndSetAllRoutinesFull() => + _i12.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesFull, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetAllRoutinesSparse() => + _i12.Future fetchAndSetAllRoutinesSparse() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesSparse, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future setExercisesAndUnits( - List<_i14.DayData>? entries, { - Map? exercises, + _i12.Future setExercisesAndUnits( + List<_i13.DayData>? entries, { + Map? exercises, }) => (super.noSuchMethod( Invocation.method( @@ -250,205 +263,205 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { [entries], {#exercises: exercises}, ), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineSparse, [planId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineFull, [routineId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => + _i12.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#addRoutine, [routine]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future editRoutine(_i5.Routine? routine) => + _i12.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#editRoutine, [routine]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteRoutine(int? id) => + _i12.Future deleteRoutine(int? id) => (super.noSuchMethod( Invocation.method(#deleteRoutine, [id]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetRepetitionUnits() => + _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetWeightUnits() => + _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetUnits() => + _i12.Future fetchAndSetUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i6.Day> addDay(_i6.Day? day) => + _i12.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#addDay, [day]), - returnValue: _i13.Future<_i6.Day>.value( + returnValue: _i12.Future<_i6.Day>.value( _FakeDay_4(this, Invocation.method(#addDay, [day])), ), ) - as _i13.Future<_i6.Day>); + as _i12.Future<_i6.Day>); @override - _i13.Future editDay(_i6.Day? day) => + _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#editDay, [day]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editDays(List<_i6.Day>? days) => + _i12.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( Invocation.method(#editDays, [days]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteDay(int? dayId) => + _i12.Future deleteDay(int? dayId) => (super.noSuchMethod( Invocation.method(#deleteDay, [dayId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => + _i12.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#addSlot, [slot, routineId]), - returnValue: _i13.Future<_i7.Slot>.value( + returnValue: _i12.Future<_i7.Slot>.value( _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), ), ) - as _i13.Future<_i7.Slot>); + as _i12.Future<_i7.Slot>); @override - _i13.Future deleteSlot(int? slotId, int? routineId) => + _i12.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlot, [slotId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlot(_i7.Slot? slot, int? routineId) => + _i12.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlot, [slot, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => + _i12.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlots, [slots, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry( + _i12.Future<_i8.SlotEntry> addSlotEntry( _i8.SlotEntry? entry, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), - returnValue: _i13.Future<_i8.SlotEntry>.value( + returnValue: _i12.Future<_i8.SlotEntry>.value( _FakeSlotEntry_6( this, Invocation.method(#addSlotEntry, [entry, routineId]), ), ), ) - as _i13.Future<_i8.SlotEntry>); + as _i12.Future<_i8.SlotEntry>); @override - _i13.Future deleteSlotEntry(int? id, int? routineId) => + _i12.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlotEntry, [id, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i12.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlotEntry, [entry, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue( + returnValue: _i15.dummyValue( this, Invocation.method(#getConfigUrl, [type]), ), @@ -456,125 +469,115 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as String); @override - _i13.Future<_i9.BaseConfig> editConfig( + _i12.Future<_i9.BaseConfig> editConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#editConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig( + _i12.Future<_i9.BaseConfig> addConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#addConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => + _i12.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#deleteConfig, [id, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future handleConfig( + _i12.Future handleConfig( _i8.SlotEntry? entry, num? value, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future> fetchSessionData() => + _i12.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value( + returnValue: _i12.Future>.value( <_i10.WorkoutSession>[], ), ) - as _i13.Future>); + as _i12.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession( + _i12.Future<_i10.WorkoutSession> addSession( _i10.WorkoutSession? session, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#addSession, [session, routineId]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => + _i12.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( Invocation.method(#editSession, [session]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#editSession, [session]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i11.Log> addLog(_i11.Log? log) => - (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i13.Future<_i11.Log>.value( - _FakeLog_9(this, Invocation.method(#addLog, [log])), - ), - ) - as _i13.Future<_i11.Log>); - - @override - _i13.Future deleteLog(int? logId, int? routineId) => + _i12.Future deleteLog(String? logId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteLog, [logId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - void addListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null, ); diff --git a/test/routine/routine_edit_test.mocks.dart b/test/routine/routine_edit_test.mocks.dart index 8acac8191..caa6f4b39 100644 --- a/test/routine/routine_edit_test.mocks.dart +++ b/test/routine/routine_edit_test.mocks.dart @@ -1,18 +1,35 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Mocks generated by Mockito 5.4.6 from annotations // in wger/test/routine/routine_edit_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i13; -import 'dart:ui' as _i17; +import 'dart:async' as _i12; +import 'dart:ui' as _i16; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i16; -import 'package:wger/models/exercises/exercise.dart' as _i15; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/exercises/exercise.dart' as _i14; import 'package:wger/models/workouts/base_config.dart' as _i9; import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/day_data.dart' as _i14; -import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/day_data.dart' as _i13; import 'package:wger/models/workouts/repetition_unit.dart' as _i4; import 'package:wger/models/workouts/routine.dart' as _i5; import 'package:wger/models/workouts/session.dart' as _i10; @@ -20,7 +37,7 @@ import 'package:wger/models/workouts/slot.dart' as _i7; import 'package:wger/models/workouts/slot_entry.dart' as _i8; import 'package:wger/models/workouts/weight_unit.dart' as _i3; import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/routines.dart' as _i12; +import 'package:wger/providers/routines.dart' as _i11; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -75,14 +92,10 @@ class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession : super(parent, parentInvocation); } -class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - /// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { +class MockRoutinesProvider extends _i1.Mock implements _i11.RoutinesProvider { MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -222,27 +235,27 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as int); @override - _i13.Future fetchAndSetAllRoutinesFull() => + _i12.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesFull, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetAllRoutinesSparse() => + _i12.Future fetchAndSetAllRoutinesSparse() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesSparse, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future setExercisesAndUnits( - List<_i14.DayData>? entries, { - Map? exercises, + _i12.Future setExercisesAndUnits( + List<_i13.DayData>? entries, { + Map? exercises, }) => (super.noSuchMethod( Invocation.method( @@ -250,205 +263,205 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { [entries], {#exercises: exercises}, ), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineSparse, [planId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineFull, [routineId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => + _i12.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#addRoutine, [routine]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future editRoutine(_i5.Routine? routine) => + _i12.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#editRoutine, [routine]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteRoutine(int? id) => + _i12.Future deleteRoutine(int? id) => (super.noSuchMethod( Invocation.method(#deleteRoutine, [id]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetRepetitionUnits() => + _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetWeightUnits() => + _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetUnits() => + _i12.Future fetchAndSetUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i6.Day> addDay(_i6.Day? day) => + _i12.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#addDay, [day]), - returnValue: _i13.Future<_i6.Day>.value( + returnValue: _i12.Future<_i6.Day>.value( _FakeDay_4(this, Invocation.method(#addDay, [day])), ), ) - as _i13.Future<_i6.Day>); + as _i12.Future<_i6.Day>); @override - _i13.Future editDay(_i6.Day? day) => + _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#editDay, [day]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editDays(List<_i6.Day>? days) => + _i12.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( Invocation.method(#editDays, [days]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteDay(int? dayId) => + _i12.Future deleteDay(int? dayId) => (super.noSuchMethod( Invocation.method(#deleteDay, [dayId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => + _i12.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#addSlot, [slot, routineId]), - returnValue: _i13.Future<_i7.Slot>.value( + returnValue: _i12.Future<_i7.Slot>.value( _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), ), ) - as _i13.Future<_i7.Slot>); + as _i12.Future<_i7.Slot>); @override - _i13.Future deleteSlot(int? slotId, int? routineId) => + _i12.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlot, [slotId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlot(_i7.Slot? slot, int? routineId) => + _i12.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlot, [slot, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => + _i12.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlots, [slots, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry( + _i12.Future<_i8.SlotEntry> addSlotEntry( _i8.SlotEntry? entry, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), - returnValue: _i13.Future<_i8.SlotEntry>.value( + returnValue: _i12.Future<_i8.SlotEntry>.value( _FakeSlotEntry_6( this, Invocation.method(#addSlotEntry, [entry, routineId]), ), ), ) - as _i13.Future<_i8.SlotEntry>); + as _i12.Future<_i8.SlotEntry>); @override - _i13.Future deleteSlotEntry(int? id, int? routineId) => + _i12.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlotEntry, [id, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i12.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlotEntry, [entry, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue( + returnValue: _i15.dummyValue( this, Invocation.method(#getConfigUrl, [type]), ), @@ -456,125 +469,115 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as String); @override - _i13.Future<_i9.BaseConfig> editConfig( + _i12.Future<_i9.BaseConfig> editConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#editConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig( + _i12.Future<_i9.BaseConfig> addConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#addConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => + _i12.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#deleteConfig, [id, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future handleConfig( + _i12.Future handleConfig( _i8.SlotEntry? entry, num? value, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future> fetchSessionData() => + _i12.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value( + returnValue: _i12.Future>.value( <_i10.WorkoutSession>[], ), ) - as _i13.Future>); + as _i12.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession( + _i12.Future<_i10.WorkoutSession> addSession( _i10.WorkoutSession? session, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#addSession, [session, routineId]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => + _i12.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( Invocation.method(#editSession, [session]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#editSession, [session]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i11.Log> addLog(_i11.Log? log) => - (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i13.Future<_i11.Log>.value( - _FakeLog_9(this, Invocation.method(#addLog, [log])), - ), - ) - as _i13.Future<_i11.Log>); - - @override - _i13.Future deleteLog(int? logId, int? routineId) => + _i12.Future deleteLog(String? logId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteLog, [logId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - void addListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null, ); diff --git a/test/routine/routine_form_test.mocks.dart b/test/routine/routine_form_test.mocks.dart index ccda27b44..8acb0c6e6 100644 --- a/test/routine/routine_form_test.mocks.dart +++ b/test/routine/routine_form_test.mocks.dart @@ -1,18 +1,35 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Mocks generated by Mockito 5.4.6 from annotations // in wger/test/routine/routine_form_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i13; -import 'dart:ui' as _i17; +import 'dart:async' as _i12; +import 'dart:ui' as _i16; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i16; -import 'package:wger/models/exercises/exercise.dart' as _i15; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/exercises/exercise.dart' as _i14; import 'package:wger/models/workouts/base_config.dart' as _i9; import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/day_data.dart' as _i14; -import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/day_data.dart' as _i13; import 'package:wger/models/workouts/repetition_unit.dart' as _i4; import 'package:wger/models/workouts/routine.dart' as _i5; import 'package:wger/models/workouts/session.dart' as _i10; @@ -20,7 +37,7 @@ import 'package:wger/models/workouts/slot.dart' as _i7; import 'package:wger/models/workouts/slot_entry.dart' as _i8; import 'package:wger/models/workouts/weight_unit.dart' as _i3; import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/routines.dart' as _i12; +import 'package:wger/providers/routines.dart' as _i11; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -75,14 +92,10 @@ class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession : super(parent, parentInvocation); } -class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - /// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { +class MockRoutinesProvider extends _i1.Mock implements _i11.RoutinesProvider { MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -222,27 +235,27 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as int); @override - _i13.Future fetchAndSetAllRoutinesFull() => + _i12.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesFull, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetAllRoutinesSparse() => + _i12.Future fetchAndSetAllRoutinesSparse() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesSparse, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future setExercisesAndUnits( - List<_i14.DayData>? entries, { - Map? exercises, + _i12.Future setExercisesAndUnits( + List<_i13.DayData>? entries, { + Map? exercises, }) => (super.noSuchMethod( Invocation.method( @@ -250,205 +263,205 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { [entries], {#exercises: exercises}, ), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineSparse, [planId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineFull, [routineId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => + _i12.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#addRoutine, [routine]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future editRoutine(_i5.Routine? routine) => + _i12.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#editRoutine, [routine]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteRoutine(int? id) => + _i12.Future deleteRoutine(int? id) => (super.noSuchMethod( Invocation.method(#deleteRoutine, [id]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetRepetitionUnits() => + _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetWeightUnits() => + _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetUnits() => + _i12.Future fetchAndSetUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i6.Day> addDay(_i6.Day? day) => + _i12.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#addDay, [day]), - returnValue: _i13.Future<_i6.Day>.value( + returnValue: _i12.Future<_i6.Day>.value( _FakeDay_4(this, Invocation.method(#addDay, [day])), ), ) - as _i13.Future<_i6.Day>); + as _i12.Future<_i6.Day>); @override - _i13.Future editDay(_i6.Day? day) => + _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#editDay, [day]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editDays(List<_i6.Day>? days) => + _i12.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( Invocation.method(#editDays, [days]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteDay(int? dayId) => + _i12.Future deleteDay(int? dayId) => (super.noSuchMethod( Invocation.method(#deleteDay, [dayId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => + _i12.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#addSlot, [slot, routineId]), - returnValue: _i13.Future<_i7.Slot>.value( + returnValue: _i12.Future<_i7.Slot>.value( _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), ), ) - as _i13.Future<_i7.Slot>); + as _i12.Future<_i7.Slot>); @override - _i13.Future deleteSlot(int? slotId, int? routineId) => + _i12.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlot, [slotId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlot(_i7.Slot? slot, int? routineId) => + _i12.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlot, [slot, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => + _i12.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlots, [slots, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry( + _i12.Future<_i8.SlotEntry> addSlotEntry( _i8.SlotEntry? entry, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), - returnValue: _i13.Future<_i8.SlotEntry>.value( + returnValue: _i12.Future<_i8.SlotEntry>.value( _FakeSlotEntry_6( this, Invocation.method(#addSlotEntry, [entry, routineId]), ), ), ) - as _i13.Future<_i8.SlotEntry>); + as _i12.Future<_i8.SlotEntry>); @override - _i13.Future deleteSlotEntry(int? id, int? routineId) => + _i12.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlotEntry, [id, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i12.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlotEntry, [entry, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue( + returnValue: _i15.dummyValue( this, Invocation.method(#getConfigUrl, [type]), ), @@ -456,125 +469,115 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as String); @override - _i13.Future<_i9.BaseConfig> editConfig( + _i12.Future<_i9.BaseConfig> editConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#editConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig( + _i12.Future<_i9.BaseConfig> addConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#addConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => + _i12.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#deleteConfig, [id, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future handleConfig( + _i12.Future handleConfig( _i8.SlotEntry? entry, num? value, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future> fetchSessionData() => + _i12.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value( + returnValue: _i12.Future>.value( <_i10.WorkoutSession>[], ), ) - as _i13.Future>); + as _i12.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession( + _i12.Future<_i10.WorkoutSession> addSession( _i10.WorkoutSession? session, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#addSession, [session, routineId]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => + _i12.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( Invocation.method(#editSession, [session]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#editSession, [session]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i11.Log> addLog(_i11.Log? log) => - (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i13.Future<_i11.Log>.value( - _FakeLog_9(this, Invocation.method(#addLog, [log])), - ), - ) - as _i13.Future<_i11.Log>); - - @override - _i13.Future deleteLog(int? logId, int? routineId) => + _i12.Future deleteLog(String? logId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteLog, [logId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - void addListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null, ); diff --git a/test/routine/routine_logs_screen_test.mocks.dart b/test/routine/routine_logs_screen_test.mocks.dart index da42a0682..b1fd4df06 100644 --- a/test/routine/routine_logs_screen_test.mocks.dart +++ b/test/routine/routine_logs_screen_test.mocks.dart @@ -1,18 +1,35 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Mocks generated by Mockito 5.4.6 from annotations // in wger/test/routine/routine_logs_screen_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i13; -import 'dart:ui' as _i17; +import 'dart:async' as _i12; +import 'dart:ui' as _i16; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i16; -import 'package:wger/models/exercises/exercise.dart' as _i15; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/exercises/exercise.dart' as _i14; import 'package:wger/models/workouts/base_config.dart' as _i9; import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/day_data.dart' as _i14; -import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/day_data.dart' as _i13; import 'package:wger/models/workouts/repetition_unit.dart' as _i4; import 'package:wger/models/workouts/routine.dart' as _i5; import 'package:wger/models/workouts/session.dart' as _i10; @@ -20,7 +37,7 @@ import 'package:wger/models/workouts/slot.dart' as _i7; import 'package:wger/models/workouts/slot_entry.dart' as _i8; import 'package:wger/models/workouts/weight_unit.dart' as _i3; import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/routines.dart' as _i12; +import 'package:wger/providers/routines.dart' as _i11; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -75,14 +92,10 @@ class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession : super(parent, parentInvocation); } -class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - /// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { +class MockRoutinesProvider extends _i1.Mock implements _i11.RoutinesProvider { MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -222,27 +235,27 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as int); @override - _i13.Future fetchAndSetAllRoutinesFull() => + _i12.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesFull, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetAllRoutinesSparse() => + _i12.Future fetchAndSetAllRoutinesSparse() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesSparse, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future setExercisesAndUnits( - List<_i14.DayData>? entries, { - Map? exercises, + _i12.Future setExercisesAndUnits( + List<_i13.DayData>? entries, { + Map? exercises, }) => (super.noSuchMethod( Invocation.method( @@ -250,205 +263,205 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { [entries], {#exercises: exercises}, ), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineSparse, [planId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineFull, [routineId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => + _i12.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#addRoutine, [routine]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future editRoutine(_i5.Routine? routine) => + _i12.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#editRoutine, [routine]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteRoutine(int? id) => + _i12.Future deleteRoutine(int? id) => (super.noSuchMethod( Invocation.method(#deleteRoutine, [id]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetRepetitionUnits() => + _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetWeightUnits() => + _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetUnits() => + _i12.Future fetchAndSetUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i6.Day> addDay(_i6.Day? day) => + _i12.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#addDay, [day]), - returnValue: _i13.Future<_i6.Day>.value( + returnValue: _i12.Future<_i6.Day>.value( _FakeDay_4(this, Invocation.method(#addDay, [day])), ), ) - as _i13.Future<_i6.Day>); + as _i12.Future<_i6.Day>); @override - _i13.Future editDay(_i6.Day? day) => + _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#editDay, [day]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editDays(List<_i6.Day>? days) => + _i12.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( Invocation.method(#editDays, [days]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteDay(int? dayId) => + _i12.Future deleteDay(int? dayId) => (super.noSuchMethod( Invocation.method(#deleteDay, [dayId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => + _i12.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#addSlot, [slot, routineId]), - returnValue: _i13.Future<_i7.Slot>.value( + returnValue: _i12.Future<_i7.Slot>.value( _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), ), ) - as _i13.Future<_i7.Slot>); + as _i12.Future<_i7.Slot>); @override - _i13.Future deleteSlot(int? slotId, int? routineId) => + _i12.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlot, [slotId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlot(_i7.Slot? slot, int? routineId) => + _i12.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlot, [slot, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => + _i12.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlots, [slots, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry( + _i12.Future<_i8.SlotEntry> addSlotEntry( _i8.SlotEntry? entry, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), - returnValue: _i13.Future<_i8.SlotEntry>.value( + returnValue: _i12.Future<_i8.SlotEntry>.value( _FakeSlotEntry_6( this, Invocation.method(#addSlotEntry, [entry, routineId]), ), ), ) - as _i13.Future<_i8.SlotEntry>); + as _i12.Future<_i8.SlotEntry>); @override - _i13.Future deleteSlotEntry(int? id, int? routineId) => + _i12.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlotEntry, [id, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i12.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlotEntry, [entry, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue( + returnValue: _i15.dummyValue( this, Invocation.method(#getConfigUrl, [type]), ), @@ -456,125 +469,115 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as String); @override - _i13.Future<_i9.BaseConfig> editConfig( + _i12.Future<_i9.BaseConfig> editConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#editConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig( + _i12.Future<_i9.BaseConfig> addConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#addConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => + _i12.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#deleteConfig, [id, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future handleConfig( + _i12.Future handleConfig( _i8.SlotEntry? entry, num? value, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future> fetchSessionData() => + _i12.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value( + returnValue: _i12.Future>.value( <_i10.WorkoutSession>[], ), ) - as _i13.Future>); + as _i12.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession( + _i12.Future<_i10.WorkoutSession> addSession( _i10.WorkoutSession? session, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#addSession, [session, routineId]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => + _i12.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( Invocation.method(#editSession, [session]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#editSession, [session]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i11.Log> addLog(_i11.Log? log) => - (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i13.Future<_i11.Log>.value( - _FakeLog_9(this, Invocation.method(#addLog, [log])), - ), - ) - as _i13.Future<_i11.Log>); - - @override - _i13.Future deleteLog(int? logId, int? routineId) => + _i12.Future deleteLog(String? logId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteLog, [logId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - void addListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null, ); diff --git a/test/routine/slot_entry_form_test.mocks.dart b/test/routine/slot_entry_form_test.mocks.dart index 87fefd78e..7d4d71d93 100644 --- a/test/routine/slot_entry_form_test.mocks.dart +++ b/test/routine/slot_entry_form_test.mocks.dart @@ -1,18 +1,35 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Mocks generated by Mockito 5.4.6 from annotations // in wger/test/routine/slot_entry_form_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i13; -import 'dart:ui' as _i17; +import 'dart:async' as _i12; +import 'dart:ui' as _i16; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i16; -import 'package:wger/models/exercises/exercise.dart' as _i15; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/exercises/exercise.dart' as _i14; import 'package:wger/models/workouts/base_config.dart' as _i9; import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/day_data.dart' as _i14; -import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/day_data.dart' as _i13; import 'package:wger/models/workouts/repetition_unit.dart' as _i4; import 'package:wger/models/workouts/routine.dart' as _i5; import 'package:wger/models/workouts/session.dart' as _i10; @@ -20,7 +37,7 @@ import 'package:wger/models/workouts/slot.dart' as _i7; import 'package:wger/models/workouts/slot_entry.dart' as _i8; import 'package:wger/models/workouts/weight_unit.dart' as _i3; import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/routines.dart' as _i12; +import 'package:wger/providers/routines.dart' as _i11; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -75,14 +92,10 @@ class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession : super(parent, parentInvocation); } -class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - /// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { +class MockRoutinesProvider extends _i1.Mock implements _i11.RoutinesProvider { MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -222,27 +235,27 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as int); @override - _i13.Future fetchAndSetAllRoutinesFull() => + _i12.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesFull, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetAllRoutinesSparse() => + _i12.Future fetchAndSetAllRoutinesSparse() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesSparse, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future setExercisesAndUnits( - List<_i14.DayData>? entries, { - Map? exercises, + _i12.Future setExercisesAndUnits( + List<_i13.DayData>? entries, { + Map? exercises, }) => (super.noSuchMethod( Invocation.method( @@ -250,205 +263,205 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { [entries], {#exercises: exercises}, ), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineSparse, [planId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineFull, [routineId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => + _i12.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#addRoutine, [routine]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future editRoutine(_i5.Routine? routine) => + _i12.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#editRoutine, [routine]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteRoutine(int? id) => + _i12.Future deleteRoutine(int? id) => (super.noSuchMethod( Invocation.method(#deleteRoutine, [id]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetRepetitionUnits() => + _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetWeightUnits() => + _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetUnits() => + _i12.Future fetchAndSetUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i6.Day> addDay(_i6.Day? day) => + _i12.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#addDay, [day]), - returnValue: _i13.Future<_i6.Day>.value( + returnValue: _i12.Future<_i6.Day>.value( _FakeDay_4(this, Invocation.method(#addDay, [day])), ), ) - as _i13.Future<_i6.Day>); + as _i12.Future<_i6.Day>); @override - _i13.Future editDay(_i6.Day? day) => + _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#editDay, [day]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editDays(List<_i6.Day>? days) => + _i12.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( Invocation.method(#editDays, [days]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteDay(int? dayId) => + _i12.Future deleteDay(int? dayId) => (super.noSuchMethod( Invocation.method(#deleteDay, [dayId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => + _i12.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#addSlot, [slot, routineId]), - returnValue: _i13.Future<_i7.Slot>.value( + returnValue: _i12.Future<_i7.Slot>.value( _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), ), ) - as _i13.Future<_i7.Slot>); + as _i12.Future<_i7.Slot>); @override - _i13.Future deleteSlot(int? slotId, int? routineId) => + _i12.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlot, [slotId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlot(_i7.Slot? slot, int? routineId) => + _i12.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlot, [slot, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => + _i12.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlots, [slots, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry( + _i12.Future<_i8.SlotEntry> addSlotEntry( _i8.SlotEntry? entry, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), - returnValue: _i13.Future<_i8.SlotEntry>.value( + returnValue: _i12.Future<_i8.SlotEntry>.value( _FakeSlotEntry_6( this, Invocation.method(#addSlotEntry, [entry, routineId]), ), ), ) - as _i13.Future<_i8.SlotEntry>); + as _i12.Future<_i8.SlotEntry>); @override - _i13.Future deleteSlotEntry(int? id, int? routineId) => + _i12.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlotEntry, [id, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i12.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlotEntry, [entry, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue( + returnValue: _i15.dummyValue( this, Invocation.method(#getConfigUrl, [type]), ), @@ -456,125 +469,115 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as String); @override - _i13.Future<_i9.BaseConfig> editConfig( + _i12.Future<_i9.BaseConfig> editConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#editConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig( + _i12.Future<_i9.BaseConfig> addConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#addConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => + _i12.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#deleteConfig, [id, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future handleConfig( + _i12.Future handleConfig( _i8.SlotEntry? entry, num? value, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future> fetchSessionData() => + _i12.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value( + returnValue: _i12.Future>.value( <_i10.WorkoutSession>[], ), ) - as _i13.Future>); + as _i12.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession( + _i12.Future<_i10.WorkoutSession> addSession( _i10.WorkoutSession? session, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#addSession, [session, routineId]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => + _i12.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( Invocation.method(#editSession, [session]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#editSession, [session]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i11.Log> addLog(_i11.Log? log) => - (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i13.Future<_i11.Log>.value( - _FakeLog_9(this, Invocation.method(#addLog, [log])), - ), - ) - as _i13.Future<_i11.Log>); - - @override - _i13.Future deleteLog(int? logId, int? routineId) => + _i12.Future deleteLog(String? logId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteLog, [logId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - void addListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null, ); diff --git a/test/routine/weight_unit_form_widget_test.mocks.dart b/test/routine/weight_unit_form_widget_test.mocks.dart index 2e0316328..801fc5268 100644 --- a/test/routine/weight_unit_form_widget_test.mocks.dart +++ b/test/routine/weight_unit_form_widget_test.mocks.dart @@ -1,18 +1,35 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020, wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Mocks generated by Mockito 5.4.6 from annotations // in wger/test/routine/weight_unit_form_widget_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i13; -import 'dart:ui' as _i17; +import 'dart:async' as _i12; +import 'dart:ui' as _i16; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i16; -import 'package:wger/models/exercises/exercise.dart' as _i15; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/exercises/exercise.dart' as _i14; import 'package:wger/models/workouts/base_config.dart' as _i9; import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/day_data.dart' as _i14; -import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/day_data.dart' as _i13; import 'package:wger/models/workouts/repetition_unit.dart' as _i4; import 'package:wger/models/workouts/routine.dart' as _i5; import 'package:wger/models/workouts/session.dart' as _i10; @@ -20,7 +37,7 @@ import 'package:wger/models/workouts/slot.dart' as _i7; import 'package:wger/models/workouts/slot_entry.dart' as _i8; import 'package:wger/models/workouts/weight_unit.dart' as _i3; import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/routines.dart' as _i12; +import 'package:wger/providers/routines.dart' as _i11; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -75,14 +92,10 @@ class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession : super(parent, parentInvocation); } -class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - /// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { +class MockRoutinesProvider extends _i1.Mock implements _i11.RoutinesProvider { MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -222,27 +235,27 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as int); @override - _i13.Future fetchAndSetAllRoutinesFull() => + _i12.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesFull, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetAllRoutinesSparse() => + _i12.Future fetchAndSetAllRoutinesSparse() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllRoutinesSparse, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future setExercisesAndUnits( - List<_i14.DayData>? entries, { - Map? exercises, + _i12.Future setExercisesAndUnits( + List<_i13.DayData>? entries, { + Map? exercises, }) => (super.noSuchMethod( Invocation.method( @@ -250,205 +263,205 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { [entries], {#exercises: exercises}, ), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineSparse, [planId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineSparse, [planId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => + _i12.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( Invocation.method(#fetchAndSetRoutineFull, [routineId]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3( this, Invocation.method(#fetchAndSetRoutineFull, [routineId]), ), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => + _i12.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#addRoutine, [routine]), - returnValue: _i13.Future<_i5.Routine>.value( + returnValue: _i12.Future<_i5.Routine>.value( _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), ), ) - as _i13.Future<_i5.Routine>); + as _i12.Future<_i5.Routine>); @override - _i13.Future editRoutine(_i5.Routine? routine) => + _i12.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( Invocation.method(#editRoutine, [routine]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteRoutine(int? id) => + _i12.Future deleteRoutine(int? id) => (super.noSuchMethod( Invocation.method(#deleteRoutine, [id]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetRepetitionUnits() => + _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetWeightUnits() => + _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future fetchAndSetUnits() => + _i12.Future fetchAndSetUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetUnits, []), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i6.Day> addDay(_i6.Day? day) => + _i12.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#addDay, [day]), - returnValue: _i13.Future<_i6.Day>.value( + returnValue: _i12.Future<_i6.Day>.value( _FakeDay_4(this, Invocation.method(#addDay, [day])), ), ) - as _i13.Future<_i6.Day>); + as _i12.Future<_i6.Day>); @override - _i13.Future editDay(_i6.Day? day) => + _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#editDay, [day]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editDays(List<_i6.Day>? days) => + _i12.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( Invocation.method(#editDays, [days]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future deleteDay(int? dayId) => + _i12.Future deleteDay(int? dayId) => (super.noSuchMethod( Invocation.method(#deleteDay, [dayId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => + _i12.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#addSlot, [slot, routineId]), - returnValue: _i13.Future<_i7.Slot>.value( + returnValue: _i12.Future<_i7.Slot>.value( _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), ), ) - as _i13.Future<_i7.Slot>); + as _i12.Future<_i7.Slot>); @override - _i13.Future deleteSlot(int? slotId, int? routineId) => + _i12.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlot, [slotId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlot(_i7.Slot? slot, int? routineId) => + _i12.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlot, [slot, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => + _i12.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlots, [slots, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future<_i8.SlotEntry> addSlotEntry( + _i12.Future<_i8.SlotEntry> addSlotEntry( _i8.SlotEntry? entry, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSlotEntry, [entry, routineId]), - returnValue: _i13.Future<_i8.SlotEntry>.value( + returnValue: _i12.Future<_i8.SlotEntry>.value( _FakeSlotEntry_6( this, Invocation.method(#addSlotEntry, [entry, routineId]), ), ), ) - as _i13.Future<_i8.SlotEntry>); + as _i12.Future<_i8.SlotEntry>); @override - _i13.Future deleteSlotEntry(int? id, int? routineId) => + _i12.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteSlotEntry, [id, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => + _i12.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( Invocation.method(#editSlotEntry, [entry, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#getConfigUrl, [type]), - returnValue: _i16.dummyValue( + returnValue: _i15.dummyValue( this, Invocation.method(#getConfigUrl, [type]), ), @@ -456,125 +469,115 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { as String); @override - _i13.Future<_i9.BaseConfig> editConfig( + _i12.Future<_i9.BaseConfig> editConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#editConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#editConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future<_i9.BaseConfig> addConfig( + _i12.Future<_i9.BaseConfig> addConfig( _i9.BaseConfig? config, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#addConfig, [config, type]), - returnValue: _i13.Future<_i9.BaseConfig>.value( + returnValue: _i12.Future<_i9.BaseConfig>.value( _FakeBaseConfig_7( this, Invocation.method(#addConfig, [config, type]), ), ), ) - as _i13.Future<_i9.BaseConfig>); + as _i12.Future<_i9.BaseConfig>); @override - _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => + _i12.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( Invocation.method(#deleteConfig, [id, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future handleConfig( + _i12.Future handleConfig( _i8.SlotEntry? entry, num? value, _i8.ConfigType? type, ) => (super.noSuchMethod( Invocation.method(#handleConfig, [entry, value, type]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - _i13.Future> fetchSessionData() => + _i12.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i13.Future>.value( + returnValue: _i12.Future>.value( <_i10.WorkoutSession>[], ), ) - as _i13.Future>); + as _i12.Future>); @override - _i13.Future<_i10.WorkoutSession> addSession( + _i12.Future<_i10.WorkoutSession> addSession( _i10.WorkoutSession? session, int? routineId, ) => (super.noSuchMethod( Invocation.method(#addSession, [session, routineId]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#addSession, [session, routineId]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => + _i12.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( Invocation.method(#editSession, [session]), - returnValue: _i13.Future<_i10.WorkoutSession>.value( + returnValue: _i12.Future<_i10.WorkoutSession>.value( _FakeWorkoutSession_8( this, Invocation.method(#editSession, [session]), ), ), ) - as _i13.Future<_i10.WorkoutSession>); + as _i12.Future<_i10.WorkoutSession>); @override - _i13.Future<_i11.Log> addLog(_i11.Log? log) => - (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i13.Future<_i11.Log>.value( - _FakeLog_9(this, Invocation.method(#addLog, [log])), - ), - ) - as _i13.Future<_i11.Log>); - - @override - _i13.Future deleteLog(int? logId, int? routineId) => + _i12.Future deleteLog(String? logId, int? routineId) => (super.noSuchMethod( Invocation.method(#deleteLog, [logId, routineId]), - returnValue: _i13.Future.value(), - returnValueForMissingStub: _i13.Future.value(), + returnValue: _i12.Future.value(), + returnValueForMissingStub: _i12.Future.value(), ) - as _i13.Future); + as _i12.Future); @override - void addListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i17.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null, ); diff --git a/test_data/routines.dart b/test_data/routines.dart index 73e330a4d..e4dad999b 100644 --- a/test_data/routines.dart +++ b/test_data/routines.dart @@ -1,13 +1,13 @@ /* * This file is part of wger Workout Manager . - * Copyright (C) 2020, 2021 wger Team + * Copyright (c) 2020, wger Team * * wger Workout Manager is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * wger Workout Manager is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. @@ -45,41 +45,44 @@ const testRepetitionUnits = [testRepetitionUnit1, testRepetitionUnit2]; Routine getTestRoutine({List? exercises}) { final testExercises = exercises ?? getTestExercises(); - final log1 = Log.empty() - ..id = 1 - ..iteration = 2 - ..slotEntryId = 3 - ..weight = 10 - ..rir = 1.5 - ..date = DateTime(2021, 5, 1) - ..repetitions = 10 - ..routineId = 1; + final log1 = Log( + id: '1', + iteration: 2, + slotEntryId: 3, + weight: 10, + rir: 1.5, + date: DateTime(2021, 5, 1), + repetitions: 10, + routineId: 1, + ); log1.exerciseBase = testExercises[0]; log1.weightUnit = testWeightUnit1; log1.repetitionUnit = testRepetitionUnit1; - final log2 = Log.empty() - ..id = 2 - ..iteration = 4 - ..slotEntryId = 1 - ..weight = 10 - ..rir = 2 - ..date = DateTime(2021, 5, 1) - ..repetitions = 12 - ..routineId = 1; + final log2 = Log( + id: '2', + iteration: 4, + slotEntryId: 1, + weight: 10, + rir: 2, + date: DateTime(2021, 5, 1), + repetitions: 12, + routineId: 1, + ); log2.exerciseBase = testExercises[0]; log2.weightUnit = testWeightUnit1; log2.repetitionUnit = testRepetitionUnit1; - final log3 = Log.empty() - ..id = 3 - ..iteration = 5 - ..slotEntryId = 1 - ..weight = 50 - ..rir = null - ..date = DateTime(2021, 5, 2) - ..repetitions = 8 - ..routineId = 1; + final log3 = Log( + id: '3', + iteration: 5, + slotEntryId: 1, + weight: 50, + rir: null, + date: DateTime(2021, 5, 2), + repetitions: 8, + routineId: 1, + ); log3.exerciseBase = testExercises[1]; log3.weightUnit = testWeightUnit1; log3.repetitionUnit = testRepetitionUnit1;