mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Start implementing new flexible routines
This commit is contained in:
@@ -20,7 +20,7 @@ import '../test_data/exercises.dart';
|
||||
import '../test_data/measurements.dart';
|
||||
import '../test_data/nutritional_plans.dart';
|
||||
import '../test_data/profile.dart';
|
||||
import '../test_data/workouts.dart';
|
||||
import '../test_data/routines.dart';
|
||||
|
||||
Widget createDashboardScreen({locale = 'en'}) {
|
||||
final mockWorkoutProvider = MockWorkoutPlansProvider();
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:wger/theme/theme.dart';
|
||||
|
||||
import '../test/workout/workout_form_test.mocks.dart';
|
||||
import '../test_data/exercises.dart';
|
||||
import '../test_data/workouts.dart';
|
||||
import '../test_data/routines.dart';
|
||||
|
||||
Widget createWorkoutDetailScreen({locale = 'en'}) {
|
||||
final key = GlobalKey<NavigatorState>();
|
||||
|
||||
@@ -11,7 +11,7 @@ import 'package:wger/theme/theme.dart';
|
||||
import '../test/utils.dart';
|
||||
import '../test/workout/gym_mode_screen_test.mocks.dart';
|
||||
import '../test_data/exercises.dart';
|
||||
import '../test_data/workouts.dart';
|
||||
import '../test_data/routines.dart';
|
||||
|
||||
Widget createGymModeScreen({locale = 'en'}) {
|
||||
final key = GlobalKey<NavigatorState>();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,35 +3,37 @@
|
||||
part of 'ingredients_database.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
class $IngredientsTable extends Ingredients
|
||||
with TableInfo<$IngredientsTable, IngredientTable> {
|
||||
class $IngredientsTable extends Ingredients with TableInfo<$IngredientsTable, IngredientTable> {
|
||||
@override
|
||||
final GeneratedDatabase attachedDatabase;
|
||||
final String? _alias;
|
||||
|
||||
$IngredientsTable(this.attachedDatabase, [this._alias]);
|
||||
|
||||
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
||||
@override
|
||||
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
||||
'id', aliasedName, false,
|
||||
late final GeneratedColumn<int> id = GeneratedColumn<int>('id', aliasedName, false,
|
||||
type: DriftSqlType.int, requiredDuringInsert: true);
|
||||
static const VerificationMeta _dataMeta = const VerificationMeta('data');
|
||||
@override
|
||||
late final GeneratedColumn<String> data = GeneratedColumn<String>(
|
||||
'data', aliasedName, false,
|
||||
late final GeneratedColumn<String> data = GeneratedColumn<String>('data', aliasedName, false,
|
||||
type: DriftSqlType.string, requiredDuringInsert: true);
|
||||
static const VerificationMeta _lastFetchedMeta =
|
||||
const VerificationMeta('lastFetched');
|
||||
static const VerificationMeta _lastFetchedMeta = const VerificationMeta('lastFetched');
|
||||
@override
|
||||
late final GeneratedColumn<DateTime> lastFetched = GeneratedColumn<DateTime>(
|
||||
'last_fetched', aliasedName, false,
|
||||
type: DriftSqlType.dateTime, requiredDuringInsert: true);
|
||||
|
||||
@override
|
||||
List<GeneratedColumn> get $columns => [id, data, lastFetched];
|
||||
|
||||
@override
|
||||
String get aliasedName => _alias ?? actualTableName;
|
||||
|
||||
@override
|
||||
String get actualTableName => $name;
|
||||
static const String $name = 'ingredients';
|
||||
|
||||
@override
|
||||
VerificationContext validateIntegrity(Insertable<IngredientTable> instance,
|
||||
{bool isInserting = false}) {
|
||||
@@ -43,16 +45,13 @@ class $IngredientsTable extends Ingredients
|
||||
context.missing(_idMeta);
|
||||
}
|
||||
if (data.containsKey('data')) {
|
||||
context.handle(
|
||||
_dataMeta, this.data.isAcceptableOrUnknown(data['data']!, _dataMeta));
|
||||
context.handle(_dataMeta, this.data.isAcceptableOrUnknown(data['data']!, _dataMeta));
|
||||
} else if (isInserting) {
|
||||
context.missing(_dataMeta);
|
||||
}
|
||||
if (data.containsKey('last_fetched')) {
|
||||
context.handle(
|
||||
_lastFetchedMeta,
|
||||
lastFetched.isAcceptableOrUnknown(
|
||||
data['last_fetched']!, _lastFetchedMeta));
|
||||
context.handle(_lastFetchedMeta,
|
||||
lastFetched.isAcceptableOrUnknown(data['last_fetched']!, _lastFetchedMeta));
|
||||
} else if (isInserting) {
|
||||
context.missing(_lastFetchedMeta);
|
||||
}
|
||||
@@ -61,14 +60,13 @@ class $IngredientsTable extends Ingredients
|
||||
|
||||
@override
|
||||
Set<GeneratedColumn> get $primaryKey => const {};
|
||||
|
||||
@override
|
||||
IngredientTable map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||
return IngredientTable(
|
||||
id: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
||||
data: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}data'])!,
|
||||
id: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
||||
data: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}data'])!,
|
||||
lastFetched: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.dateTime, data['${effectivePrefix}last_fetched'])!,
|
||||
);
|
||||
@@ -86,8 +84,9 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
|
||||
|
||||
/// The date when the ingredient was last fetched from the server
|
||||
final DateTime lastFetched;
|
||||
const IngredientTable(
|
||||
{required this.id, required this.data, required this.lastFetched});
|
||||
|
||||
const IngredientTable({required this.id, required this.data, required this.lastFetched});
|
||||
|
||||
@override
|
||||
Map<String, Expression> toColumns(bool nullToAbsent) {
|
||||
final map = <String, Expression>{};
|
||||
@@ -105,8 +104,7 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
|
||||
);
|
||||
}
|
||||
|
||||
factory IngredientTable.fromJson(Map<String, dynamic> json,
|
||||
{ValueSerializer? serializer}) {
|
||||
factory IngredientTable.fromJson(Map<String, dynamic> json, {ValueSerializer? serializer}) {
|
||||
serializer ??= driftRuntimeOptions.defaultSerializer;
|
||||
return IngredientTable(
|
||||
id: serializer.fromJson<int>(json['id']),
|
||||
@@ -114,6 +112,7 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
|
||||
lastFetched: serializer.fromJson<DateTime>(json['lastFetched']),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
||||
serializer ??= driftRuntimeOptions.defaultSerializer;
|
||||
@@ -124,18 +123,17 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
|
||||
};
|
||||
}
|
||||
|
||||
IngredientTable copyWith({int? id, String? data, DateTime? lastFetched}) =>
|
||||
IngredientTable(
|
||||
IngredientTable copyWith({int? id, String? data, DateTime? lastFetched}) => IngredientTable(
|
||||
id: id ?? this.id,
|
||||
data: data ?? this.data,
|
||||
lastFetched: lastFetched ?? this.lastFetched,
|
||||
);
|
||||
|
||||
IngredientTable copyWithCompanion(IngredientsCompanion data) {
|
||||
return IngredientTable(
|
||||
id: data.id.present ? data.id.value : this.id,
|
||||
data: data.data.present ? data.data.value : this.data,
|
||||
lastFetched:
|
||||
data.lastFetched.present ? data.lastFetched.value : this.lastFetched,
|
||||
lastFetched: data.lastFetched.present ? data.lastFetched.value : this.lastFetched,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -151,6 +149,7 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(id, data, lastFetched);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
@@ -165,12 +164,14 @@ class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
|
||||
final Value<String> data;
|
||||
final Value<DateTime> lastFetched;
|
||||
final Value<int> rowid;
|
||||
|
||||
const IngredientsCompanion({
|
||||
this.id = const Value.absent(),
|
||||
this.data = const Value.absent(),
|
||||
this.lastFetched = const Value.absent(),
|
||||
this.rowid = const Value.absent(),
|
||||
});
|
||||
|
||||
IngredientsCompanion.insert({
|
||||
required int id,
|
||||
required String data,
|
||||
@@ -179,6 +180,7 @@ class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
|
||||
}) : id = Value(id),
|
||||
data = Value(data),
|
||||
lastFetched = Value(lastFetched);
|
||||
|
||||
static Insertable<IngredientTable> custom({
|
||||
Expression<int>? id,
|
||||
Expression<String>? data,
|
||||
@@ -194,10 +196,7 @@ class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
|
||||
}
|
||||
|
||||
IngredientsCompanion copyWith(
|
||||
{Value<int>? id,
|
||||
Value<String>? data,
|
||||
Value<DateTime>? lastFetched,
|
||||
Value<int>? rowid}) {
|
||||
{Value<int>? id, Value<String>? data, Value<DateTime>? lastFetched, Value<int>? rowid}) {
|
||||
return IngredientsCompanion(
|
||||
id: id ?? this.id,
|
||||
data: data ?? this.data,
|
||||
@@ -238,32 +237,32 @@ class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
|
||||
|
||||
abstract class _$IngredientDatabase extends GeneratedDatabase {
|
||||
_$IngredientDatabase(QueryExecutor e) : super(e);
|
||||
|
||||
$IngredientDatabaseManager get managers => $IngredientDatabaseManager(this);
|
||||
late final $IngredientsTable ingredients = $IngredientsTable(this);
|
||||
|
||||
@override
|
||||
Iterable<TableInfo<Table, Object?>> get allTables =>
|
||||
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
||||
|
||||
@override
|
||||
List<DatabaseSchemaEntity> get allSchemaEntities => [ingredients];
|
||||
}
|
||||
|
||||
typedef $$IngredientsTableCreateCompanionBuilder = IngredientsCompanion
|
||||
Function({
|
||||
typedef $$IngredientsTableCreateCompanionBuilder = IngredientsCompanion Function({
|
||||
required int id,
|
||||
required String data,
|
||||
required DateTime lastFetched,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $$IngredientsTableUpdateCompanionBuilder = IngredientsCompanion
|
||||
Function({
|
||||
typedef $$IngredientsTableUpdateCompanionBuilder = IngredientsCompanion Function({
|
||||
Value<int> id,
|
||||
Value<String> data,
|
||||
Value<DateTime> lastFetched,
|
||||
Value<int> rowid,
|
||||
});
|
||||
|
||||
class $$IngredientsTableFilterComposer
|
||||
extends Composer<_$IngredientDatabase, $IngredientsTable> {
|
||||
class $$IngredientsTableFilterComposer extends Composer<_$IngredientDatabase, $IngredientsTable> {
|
||||
$$IngredientsTableFilterComposer({
|
||||
required super.$db,
|
||||
required super.$table,
|
||||
@@ -271,18 +270,18 @@ class $$IngredientsTableFilterComposer
|
||||
super.$addJoinBuilderToRootComposer,
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
ColumnFilters<int> get id => $composableBuilder(
|
||||
column: $table.id, builder: (column) => ColumnFilters(column));
|
||||
|
||||
ColumnFilters<String> get data => $composableBuilder(
|
||||
column: $table.data, builder: (column) => ColumnFilters(column));
|
||||
ColumnFilters<int> get id =>
|
||||
$composableBuilder(column: $table.id, builder: (column) => ColumnFilters(column));
|
||||
|
||||
ColumnFilters<DateTime> get lastFetched => $composableBuilder(
|
||||
column: $table.lastFetched, builder: (column) => ColumnFilters(column));
|
||||
ColumnFilters<String> get data =>
|
||||
$composableBuilder(column: $table.data, builder: (column) => ColumnFilters(column));
|
||||
|
||||
ColumnFilters<DateTime> get lastFetched =>
|
||||
$composableBuilder(column: $table.lastFetched, builder: (column) => ColumnFilters(column));
|
||||
}
|
||||
|
||||
class $$IngredientsTableOrderingComposer
|
||||
extends Composer<_$IngredientDatabase, $IngredientsTable> {
|
||||
class $$IngredientsTableOrderingComposer extends Composer<_$IngredientDatabase, $IngredientsTable> {
|
||||
$$IngredientsTableOrderingComposer({
|
||||
required super.$db,
|
||||
required super.$table,
|
||||
@@ -290,14 +289,15 @@ class $$IngredientsTableOrderingComposer
|
||||
super.$addJoinBuilderToRootComposer,
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
ColumnOrderings<int> get id => $composableBuilder(
|
||||
column: $table.id, builder: (column) => ColumnOrderings(column));
|
||||
|
||||
ColumnOrderings<String> get data => $composableBuilder(
|
||||
column: $table.data, builder: (column) => ColumnOrderings(column));
|
||||
ColumnOrderings<int> get id =>
|
||||
$composableBuilder(column: $table.id, builder: (column) => ColumnOrderings(column));
|
||||
|
||||
ColumnOrderings<DateTime> get lastFetched => $composableBuilder(
|
||||
column: $table.lastFetched, builder: (column) => ColumnOrderings(column));
|
||||
ColumnOrderings<String> get data =>
|
||||
$composableBuilder(column: $table.data, builder: (column) => ColumnOrderings(column));
|
||||
|
||||
ColumnOrderings<DateTime> get lastFetched =>
|
||||
$composableBuilder(column: $table.lastFetched, builder: (column) => ColumnOrderings(column));
|
||||
}
|
||||
|
||||
class $$IngredientsTableAnnotationComposer
|
||||
@@ -309,14 +309,14 @@ class $$IngredientsTableAnnotationComposer
|
||||
super.$addJoinBuilderToRootComposer,
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
GeneratedColumn<int> get id =>
|
||||
$composableBuilder(column: $table.id, builder: (column) => column);
|
||||
|
||||
GeneratedColumn<int> get id => $composableBuilder(column: $table.id, builder: (column) => column);
|
||||
|
||||
GeneratedColumn<String> get data =>
|
||||
$composableBuilder(column: $table.data, builder: (column) => column);
|
||||
|
||||
GeneratedColumn<DateTime> get lastFetched => $composableBuilder(
|
||||
column: $table.lastFetched, builder: (column) => column);
|
||||
GeneratedColumn<DateTime> get lastFetched =>
|
||||
$composableBuilder(column: $table.lastFetched, builder: (column) => column);
|
||||
}
|
||||
|
||||
class $$IngredientsTableTableManager extends RootTableManager<
|
||||
@@ -328,21 +328,15 @@ class $$IngredientsTableTableManager extends RootTableManager<
|
||||
$$IngredientsTableAnnotationComposer,
|
||||
$$IngredientsTableCreateCompanionBuilder,
|
||||
$$IngredientsTableUpdateCompanionBuilder,
|
||||
(
|
||||
IngredientTable,
|
||||
BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>
|
||||
),
|
||||
(IngredientTable, BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>),
|
||||
IngredientTable,
|
||||
PrefetchHooks Function()> {
|
||||
$$IngredientsTableTableManager(
|
||||
_$IngredientDatabase db, $IngredientsTable table)
|
||||
$$IngredientsTableTableManager(_$IngredientDatabase db, $IngredientsTable table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
createFilteringComposer: () =>
|
||||
$$IngredientsTableFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () =>
|
||||
$$IngredientsTableOrderingComposer($db: db, $table: table),
|
||||
createFilteringComposer: () => $$IngredientsTableFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () => $$IngredientsTableOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer: () =>
|
||||
$$IngredientsTableAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback: ({
|
||||
@@ -369,9 +363,8 @@ class $$IngredientsTableTableManager extends RootTableManager<
|
||||
lastFetched: lastFetched,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
||||
.toList(),
|
||||
withReferenceMapper: (p0) =>
|
||||
p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(),
|
||||
prefetchHooksCallback: null,
|
||||
));
|
||||
}
|
||||
@@ -385,16 +378,15 @@ typedef $$IngredientsTableProcessedTableManager = ProcessedTableManager<
|
||||
$$IngredientsTableAnnotationComposer,
|
||||
$$IngredientsTableCreateCompanionBuilder,
|
||||
$$IngredientsTableUpdateCompanionBuilder,
|
||||
(
|
||||
IngredientTable,
|
||||
BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>
|
||||
),
|
||||
(IngredientTable, BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>),
|
||||
IngredientTable,
|
||||
PrefetchHooks Function()>;
|
||||
|
||||
class $IngredientDatabaseManager {
|
||||
final _$IngredientDatabase _db;
|
||||
|
||||
$IngredientDatabaseManager(this._db);
|
||||
|
||||
$$IngredientsTableTableManager get ingredients =>
|
||||
$$IngredientsTableTableManager(_db, _db.ingredients);
|
||||
}
|
||||
|
||||
@@ -18,8 +18,7 @@ WeightEntry _$WeightEntryFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$WeightEntryToJson(WeightEntry instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$WeightEntryToJson(WeightEntry instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'weight': numToString(instance.weight),
|
||||
'date': toDate(instance.date),
|
||||
|
||||
@@ -17,8 +17,7 @@ ExerciseCategory _$ExerciseCategoryFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$ExerciseCategoryToJson(ExerciseCategory instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$ExerciseCategoryToJson(ExerciseCategory instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
@@ -25,12 +25,8 @@ Exercise _$ExerciseFromJson(Map<String, dynamic> json) {
|
||||
return Exercise(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
uuid: json['uuid'] as String?,
|
||||
created: json['created'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created'] as String),
|
||||
lastUpdate: json['last_update'] == null
|
||||
? null
|
||||
: DateTime.parse(json['last_update'] as String),
|
||||
created: json['created'] == null ? null : DateTime.parse(json['created'] as String),
|
||||
lastUpdate: json['last_update'] == null ? null : DateTime.parse(json['last_update'] as String),
|
||||
lastUpdateGlobal: json['last_update_global'] == null
|
||||
? null
|
||||
: DateTime.parse(json['last_update_global'] as String),
|
||||
@@ -43,15 +39,10 @@ Exercise _$ExerciseFromJson(Map<String, dynamic> json) {
|
||||
: ExerciseCategory.fromJson(json['categories'] as Map<String, dynamic>),
|
||||
)
|
||||
..categoryId = (json['category'] as num).toInt()
|
||||
..musclesIds = (json['muscles'] as List<dynamic>)
|
||||
.map((e) => (e as num).toInt())
|
||||
.toList()
|
||||
..musclesSecondaryIds = (json['muscles_secondary'] as List<dynamic>)
|
||||
.map((e) => (e as num).toInt())
|
||||
.toList()
|
||||
..equipmentIds = (json['equipment'] as List<dynamic>)
|
||||
.map((e) => (e as num).toInt())
|
||||
.toList();
|
||||
..musclesIds = (json['muscles'] as List<dynamic>).map((e) => (e as num).toInt()).toList()
|
||||
..musclesSecondaryIds =
|
||||
(json['muscles_secondary'] as List<dynamic>).map((e) => (e as num).toInt()).toList()
|
||||
..equipmentIds = (json['equipment'] as List<dynamic>).map((e) => (e as num).toInt()).toList();
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$ExerciseToJson(Exercise instance) => <String, dynamic>{
|
||||
@@ -65,7 +56,6 @@ Map<String, dynamic> _$ExerciseToJson(Exercise instance) => <String, dynamic>{
|
||||
'categories': instance.category?.toJson(),
|
||||
'muscles': instance.musclesIds,
|
||||
'muscles_secondary': instance.musclesSecondaryIds,
|
||||
'musclesSecondary':
|
||||
instance.musclesSecondary.map((e) => e.toJson()).toList(),
|
||||
'musclesSecondary': instance.musclesSecondary.map((e) => e.toJson()).toList(),
|
||||
'equipment': instance.equipmentIds,
|
||||
};
|
||||
|
||||
@@ -21,20 +21,20 @@ ExerciseApiData _$ExerciseApiDataFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$ExerciseApiData {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
String get uuid =>
|
||||
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
|
||||
String get uuid => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
@JsonKey(name: 'variations')
|
||||
int? get variationId =>
|
||||
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
int? get variationId => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
@JsonKey(name: 'created')
|
||||
DateTime get created =>
|
||||
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
DateTime get created => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
@JsonKey(name: 'last_update')
|
||||
DateTime get lastUpdate =>
|
||||
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
@JsonKey(name: 'last_update_global')
|
||||
DateTime get lastUpdateGlobal => throw _privateConstructorUsedError;
|
||||
|
||||
ExerciseCategory get category => throw _privateConstructorUsedError;
|
||||
|
||||
List<Muscle> get muscles =>
|
||||
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
@JsonKey(name: 'muscles_secondary')
|
||||
@@ -44,9 +44,10 @@ mixin _$ExerciseApiData {
|
||||
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
@JsonKey(name: 'exercises')
|
||||
List<Translation> get translations => throw _privateConstructorUsedError;
|
||||
|
||||
List<ExerciseImage> get images => throw _privateConstructorUsedError;
|
||||
List<Video> get videos =>
|
||||
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
|
||||
List<Video> get videos => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
@JsonKey(name: 'author_history')
|
||||
List<String> get authors =>
|
||||
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
@@ -59,15 +60,14 @@ mixin _$ExerciseApiData {
|
||||
/// Create a copy of ExerciseApiData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ExerciseApiDataCopyWith<ExerciseApiData> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
$ExerciseApiDataCopyWith<ExerciseApiData> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ExerciseApiDataCopyWith<$Res> {
|
||||
factory $ExerciseApiDataCopyWith(
|
||||
ExerciseApiData value, $Res Function(ExerciseApiData) then) =
|
||||
factory $ExerciseApiDataCopyWith(ExerciseApiData value, $Res Function(ExerciseApiData) then) =
|
||||
_$ExerciseApiDataCopyWithImpl<$Res, ExerciseApiData>;
|
||||
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@@ -94,6 +94,7 @@ class _$ExerciseApiDataCopyWithImpl<$Res, $Val extends ExerciseApiData>
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -184,11 +185,11 @@ class _$ExerciseApiDataCopyWithImpl<$Res, $Val extends ExerciseApiData>
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ExerciseBaseDataImplCopyWith<$Res>
|
||||
implements $ExerciseApiDataCopyWith<$Res> {
|
||||
factory _$$ExerciseBaseDataImplCopyWith(_$ExerciseBaseDataImpl value,
|
||||
$Res Function(_$ExerciseBaseDataImpl) then) =
|
||||
abstract class _$$ExerciseBaseDataImplCopyWith<$Res> implements $ExerciseApiDataCopyWith<$Res> {
|
||||
factory _$$ExerciseBaseDataImplCopyWith(
|
||||
_$ExerciseBaseDataImpl value, $Res Function(_$ExerciseBaseDataImpl) then) =
|
||||
__$$ExerciseBaseDataImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
@@ -213,8 +214,8 @@ abstract class _$$ExerciseBaseDataImplCopyWith<$Res>
|
||||
class __$$ExerciseBaseDataImplCopyWithImpl<$Res>
|
||||
extends _$ExerciseApiDataCopyWithImpl<$Res, _$ExerciseBaseDataImpl>
|
||||
implements _$$ExerciseBaseDataImplCopyWith<$Res> {
|
||||
__$$ExerciseBaseDataImplCopyWithImpl(_$ExerciseBaseDataImpl _value,
|
||||
$Res Function(_$ExerciseBaseDataImpl) _then)
|
||||
__$$ExerciseBaseDataImplCopyWithImpl(
|
||||
_$ExerciseBaseDataImpl _value, $Res Function(_$ExerciseBaseDataImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ExerciseApiData
|
||||
@@ -315,15 +316,13 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
|
||||
@JsonKey(name: 'last_update_global') required this.lastUpdateGlobal,
|
||||
required this.category,
|
||||
required final List<Muscle> muscles,
|
||||
@JsonKey(name: 'muscles_secondary')
|
||||
required final List<Muscle> musclesSecondary,
|
||||
@JsonKey(name: 'muscles_secondary') required final List<Muscle> musclesSecondary,
|
||||
required final List<Equipment> equipment,
|
||||
@JsonKey(name: 'exercises') required final List<Translation> translations,
|
||||
required final List<ExerciseImage> images,
|
||||
required final List<Video> videos,
|
||||
@JsonKey(name: 'author_history') required final List<String> authors,
|
||||
@JsonKey(name: 'total_authors_history')
|
||||
required final List<String> authorsGlobal})
|
||||
@JsonKey(name: 'total_authors_history') required final List<String> authorsGlobal})
|
||||
: _muscles = muscles,
|
||||
_musclesSecondary = musclesSecondary,
|
||||
_equipment = equipment,
|
||||
@@ -340,18 +339,22 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
|
||||
final int id;
|
||||
@override
|
||||
final String uuid;
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
@override
|
||||
@JsonKey(name: 'variations')
|
||||
final int? variationId;
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
@override
|
||||
@JsonKey(name: 'created')
|
||||
final DateTime created;
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
@override
|
||||
@JsonKey(name: 'last_update')
|
||||
final DateTime lastUpdate;
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
@override
|
||||
@JsonKey(name: 'last_update_global')
|
||||
@@ -359,6 +362,7 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
|
||||
@override
|
||||
final ExerciseCategory category;
|
||||
final List<Muscle> _muscles;
|
||||
|
||||
@override
|
||||
List<Muscle> get muscles {
|
||||
if (_muscles is EqualUnmodifiableListView) return _muscles;
|
||||
@@ -368,18 +372,19 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
final List<Muscle> _musclesSecondary;
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
@override
|
||||
@JsonKey(name: 'muscles_secondary')
|
||||
List<Muscle> get musclesSecondary {
|
||||
if (_musclesSecondary is EqualUnmodifiableListView)
|
||||
return _musclesSecondary;
|
||||
if (_musclesSecondary is EqualUnmodifiableListView) return _musclesSecondary;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_musclesSecondary);
|
||||
}
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
final List<Equipment> _equipment;
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
@override
|
||||
List<Equipment> get equipment {
|
||||
@@ -390,6 +395,7 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
final List<Translation> _translations;
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
@override
|
||||
@JsonKey(name: 'exercises')
|
||||
@@ -400,6 +406,7 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
|
||||
}
|
||||
|
||||
final List<ExerciseImage> _images;
|
||||
|
||||
@override
|
||||
List<ExerciseImage> get images {
|
||||
if (_images is EqualUnmodifiableListView) return _images;
|
||||
@@ -408,6 +415,7 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
|
||||
}
|
||||
|
||||
final List<Video> _videos;
|
||||
|
||||
@override
|
||||
List<Video> get videos {
|
||||
if (_videos is EqualUnmodifiableListView) return _videos;
|
||||
@@ -417,6 +425,7 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
final List<String> _authors;
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
@override
|
||||
@JsonKey(name: 'author_history')
|
||||
@@ -428,6 +437,7 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
final List<String> _authorsGlobal;
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
@override
|
||||
@JsonKey(name: 'total_authors_history')
|
||||
@@ -449,27 +459,20 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
|
||||
other is _$ExerciseBaseDataImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.uuid, uuid) || other.uuid == uuid) &&
|
||||
(identical(other.variationId, variationId) ||
|
||||
other.variationId == variationId) &&
|
||||
(identical(other.variationId, variationId) || other.variationId == variationId) &&
|
||||
(identical(other.created, created) || other.created == created) &&
|
||||
(identical(other.lastUpdate, lastUpdate) ||
|
||||
other.lastUpdate == lastUpdate) &&
|
||||
(identical(other.lastUpdate, lastUpdate) || other.lastUpdate == lastUpdate) &&
|
||||
(identical(other.lastUpdateGlobal, lastUpdateGlobal) ||
|
||||
other.lastUpdateGlobal == lastUpdateGlobal) &&
|
||||
(identical(other.category, category) ||
|
||||
other.category == category) &&
|
||||
(identical(other.category, category) || other.category == category) &&
|
||||
const DeepCollectionEquality().equals(other._muscles, _muscles) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._musclesSecondary, _musclesSecondary) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._equipment, _equipment) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._translations, _translations) &&
|
||||
const DeepCollectionEquality().equals(other._musclesSecondary, _musclesSecondary) &&
|
||||
const DeepCollectionEquality().equals(other._equipment, _equipment) &&
|
||||
const DeepCollectionEquality().equals(other._translations, _translations) &&
|
||||
const DeepCollectionEquality().equals(other._images, _images) &&
|
||||
const DeepCollectionEquality().equals(other._videos, _videos) &&
|
||||
const DeepCollectionEquality().equals(other._authors, _authors) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._authorsGlobal, _authorsGlobal));
|
||||
const DeepCollectionEquality().equals(other._authorsGlobal, _authorsGlobal));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -498,8 +501,7 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ExerciseBaseDataImplCopyWith<_$ExerciseBaseDataImpl> get copyWith =>
|
||||
__$$ExerciseBaseDataImplCopyWithImpl<_$ExerciseBaseDataImpl>(
|
||||
this, _$identity);
|
||||
__$$ExerciseBaseDataImplCopyWithImpl<_$ExerciseBaseDataImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -511,30 +513,28 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
|
||||
|
||||
abstract class _ExerciseBaseData implements ExerciseApiData {
|
||||
factory _ExerciseBaseData(
|
||||
{required final int id,
|
||||
required final String uuid,
|
||||
@JsonKey(name: 'variations') final int? variationId,
|
||||
@JsonKey(name: 'created') required final DateTime created,
|
||||
@JsonKey(name: 'last_update') required final DateTime lastUpdate,
|
||||
@JsonKey(name: 'last_update_global')
|
||||
required final DateTime lastUpdateGlobal,
|
||||
required final ExerciseCategory category,
|
||||
required final List<Muscle> muscles,
|
||||
@JsonKey(name: 'muscles_secondary')
|
||||
required final List<Muscle> musclesSecondary,
|
||||
required final List<Equipment> equipment,
|
||||
@JsonKey(name: 'exercises') required final List<Translation> translations,
|
||||
required final List<ExerciseImage> images,
|
||||
required final List<Video> videos,
|
||||
@JsonKey(name: 'author_history') required final List<String> authors,
|
||||
@JsonKey(name: 'total_authors_history')
|
||||
required final List<String> authorsGlobal}) = _$ExerciseBaseDataImpl;
|
||||
{required final int id,
|
||||
required final String uuid,
|
||||
@JsonKey(name: 'variations') final int? variationId,
|
||||
@JsonKey(name: 'created') required final DateTime created,
|
||||
@JsonKey(name: 'last_update') required final DateTime lastUpdate,
|
||||
@JsonKey(name: 'last_update_global') required final DateTime lastUpdateGlobal,
|
||||
required final ExerciseCategory category,
|
||||
required final List<Muscle> muscles,
|
||||
@JsonKey(name: 'muscles_secondary') required final List<Muscle> musclesSecondary,
|
||||
required final List<Equipment> equipment,
|
||||
@JsonKey(name: 'exercises') required final List<Translation> translations,
|
||||
required final List<ExerciseImage> images,
|
||||
required final List<Video> videos,
|
||||
@JsonKey(name: 'author_history') required final List<String> authors,
|
||||
@JsonKey(name: 'total_authors_history') required final List<String> authorsGlobal}) =
|
||||
_$ExerciseBaseDataImpl;
|
||||
|
||||
factory _ExerciseBaseData.fromJson(Map<String, dynamic> json) =
|
||||
_$ExerciseBaseDataImpl.fromJson;
|
||||
factory _ExerciseBaseData.fromJson(Map<String, dynamic> json) = _$ExerciseBaseDataImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
|
||||
@override
|
||||
String get uuid; // ignore: invalid_annotation_target
|
||||
@override
|
||||
@@ -549,8 +549,10 @@ abstract class _ExerciseBaseData implements ExerciseApiData {
|
||||
@override
|
||||
@JsonKey(name: 'last_update_global')
|
||||
DateTime get lastUpdateGlobal;
|
||||
|
||||
@override
|
||||
ExerciseCategory get category;
|
||||
|
||||
@override
|
||||
List<Muscle> get muscles; // ignore: invalid_annotation_target
|
||||
@override
|
||||
@@ -561,8 +563,10 @@ abstract class _ExerciseBaseData implements ExerciseApiData {
|
||||
@override
|
||||
@JsonKey(name: 'exercises')
|
||||
List<Translation> get translations;
|
||||
|
||||
@override
|
||||
List<ExerciseImage> get images;
|
||||
|
||||
@override
|
||||
List<Video> get videos; // ignore: invalid_annotation_target
|
||||
@override
|
||||
@@ -580,8 +584,7 @@ abstract class _ExerciseBaseData implements ExerciseApiData {
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
ExerciseSearchDetails _$ExerciseSearchDetailsFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
ExerciseSearchDetails _$ExerciseSearchDetailsFromJson(Map<String, dynamic> json) {
|
||||
return _ExerciseSearchDetails.fromJson(json);
|
||||
}
|
||||
|
||||
@@ -589,14 +592,15 @@ ExerciseSearchDetails _$ExerciseSearchDetailsFromJson(
|
||||
mixin _$ExerciseSearchDetails {
|
||||
// ignore: invalid_annotation_target
|
||||
@JsonKey(name: 'id')
|
||||
int get translationId =>
|
||||
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
int get translationId => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
@JsonKey(name: 'base_id')
|
||||
int get exerciseId => throw _privateConstructorUsedError;
|
||||
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
|
||||
String get category => throw _privateConstructorUsedError;
|
||||
String? get image =>
|
||||
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
|
||||
String? get image => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
@JsonKey(name: 'image_thumbnail')
|
||||
String? get imageThumbnail => throw _privateConstructorUsedError;
|
||||
|
||||
@@ -612,9 +616,10 @@ mixin _$ExerciseSearchDetails {
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ExerciseSearchDetailsCopyWith<$Res> {
|
||||
factory $ExerciseSearchDetailsCopyWith(ExerciseSearchDetails value,
|
||||
$Res Function(ExerciseSearchDetails) then) =
|
||||
factory $ExerciseSearchDetailsCopyWith(
|
||||
ExerciseSearchDetails value, $Res Function(ExerciseSearchDetails) then) =
|
||||
_$ExerciseSearchDetailsCopyWithImpl<$Res, ExerciseSearchDetails>;
|
||||
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'id') int translationId,
|
||||
@@ -626,13 +631,13 @@ abstract class $ExerciseSearchDetailsCopyWith<$Res> {
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ExerciseSearchDetailsCopyWithImpl<$Res,
|
||||
$Val extends ExerciseSearchDetails>
|
||||
class _$ExerciseSearchDetailsCopyWithImpl<$Res, $Val extends ExerciseSearchDetails>
|
||||
implements $ExerciseSearchDetailsCopyWith<$Res> {
|
||||
_$ExerciseSearchDetailsCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -681,9 +686,9 @@ class _$ExerciseSearchDetailsCopyWithImpl<$Res,
|
||||
abstract class _$$ExerciseSearchDetailsImplCopyWith<$Res>
|
||||
implements $ExerciseSearchDetailsCopyWith<$Res> {
|
||||
factory _$$ExerciseSearchDetailsImplCopyWith(
|
||||
_$ExerciseSearchDetailsImpl value,
|
||||
$Res Function(_$ExerciseSearchDetailsImpl) then) =
|
||||
_$ExerciseSearchDetailsImpl value, $Res Function(_$ExerciseSearchDetailsImpl) then) =
|
||||
__$$ExerciseSearchDetailsImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
@@ -697,11 +702,10 @@ abstract class _$$ExerciseSearchDetailsImplCopyWith<$Res>
|
||||
|
||||
/// @nodoc
|
||||
class __$$ExerciseSearchDetailsImplCopyWithImpl<$Res>
|
||||
extends _$ExerciseSearchDetailsCopyWithImpl<$Res,
|
||||
_$ExerciseSearchDetailsImpl>
|
||||
extends _$ExerciseSearchDetailsCopyWithImpl<$Res, _$ExerciseSearchDetailsImpl>
|
||||
implements _$$ExerciseSearchDetailsImplCopyWith<$Res> {
|
||||
__$$ExerciseSearchDetailsImplCopyWithImpl(_$ExerciseSearchDetailsImpl _value,
|
||||
$Res Function(_$ExerciseSearchDetailsImpl) _then)
|
||||
__$$ExerciseSearchDetailsImplCopyWithImpl(
|
||||
_$ExerciseSearchDetailsImpl _value, $Res Function(_$ExerciseSearchDetailsImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ExerciseSearchDetails
|
||||
@@ -763,6 +767,7 @@ class _$ExerciseSearchDetailsImpl implements _ExerciseSearchDetails {
|
||||
@override
|
||||
@JsonKey(name: 'id')
|
||||
final int translationId;
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
@override
|
||||
@JsonKey(name: 'base_id')
|
||||
@@ -773,6 +778,7 @@ class _$ExerciseSearchDetailsImpl implements _ExerciseSearchDetails {
|
||||
final String category;
|
||||
@override
|
||||
final String? image;
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
@override
|
||||
@JsonKey(name: 'image_thumbnail')
|
||||
@@ -790,11 +796,9 @@ class _$ExerciseSearchDetailsImpl implements _ExerciseSearchDetails {
|
||||
other is _$ExerciseSearchDetailsImpl &&
|
||||
(identical(other.translationId, translationId) ||
|
||||
other.translationId == translationId) &&
|
||||
(identical(other.exerciseId, exerciseId) ||
|
||||
other.exerciseId == exerciseId) &&
|
||||
(identical(other.exerciseId, exerciseId) || other.exerciseId == exerciseId) &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.category, category) ||
|
||||
other.category == category) &&
|
||||
(identical(other.category, category) || other.category == category) &&
|
||||
(identical(other.image, image) || other.image == image) &&
|
||||
(identical(other.imageThumbnail, imageThumbnail) ||
|
||||
other.imageThumbnail == imageThumbnail));
|
||||
@@ -802,17 +806,16 @@ class _$ExerciseSearchDetailsImpl implements _ExerciseSearchDetails {
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, translationId, exerciseId, name,
|
||||
category, image, imageThumbnail);
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, translationId, exerciseId, name, category, image, imageThumbnail);
|
||||
|
||||
/// Create a copy of ExerciseSearchDetails
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ExerciseSearchDetailsImplCopyWith<_$ExerciseSearchDetailsImpl>
|
||||
get copyWith => __$$ExerciseSearchDetailsImplCopyWithImpl<
|
||||
_$ExerciseSearchDetailsImpl>(this, _$identity);
|
||||
_$$ExerciseSearchDetailsImplCopyWith<_$ExerciseSearchDetailsImpl> get copyWith =>
|
||||
__$$ExerciseSearchDetailsImplCopyWithImpl<_$ExerciseSearchDetailsImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -824,13 +827,13 @@ class _$ExerciseSearchDetailsImpl implements _ExerciseSearchDetails {
|
||||
|
||||
abstract class _ExerciseSearchDetails implements ExerciseSearchDetails {
|
||||
factory _ExerciseSearchDetails(
|
||||
{@JsonKey(name: 'id') required final int translationId,
|
||||
@JsonKey(name: 'base_id') required final int exerciseId,
|
||||
required final String name,
|
||||
required final String category,
|
||||
required final String? image,
|
||||
@JsonKey(name: 'image_thumbnail')
|
||||
required final String? imageThumbnail}) = _$ExerciseSearchDetailsImpl;
|
||||
{@JsonKey(name: 'id') required final int translationId,
|
||||
@JsonKey(name: 'base_id') required final int exerciseId,
|
||||
required final String name,
|
||||
required final String category,
|
||||
required final String? image,
|
||||
@JsonKey(name: 'image_thumbnail') required final String? imageThumbnail}) =
|
||||
_$ExerciseSearchDetailsImpl;
|
||||
|
||||
factory _ExerciseSearchDetails.fromJson(Map<String, dynamic> json) =
|
||||
_$ExerciseSearchDetailsImpl.fromJson;
|
||||
@@ -842,10 +845,13 @@ abstract class _ExerciseSearchDetails implements ExerciseSearchDetails {
|
||||
@override
|
||||
@JsonKey(name: 'base_id')
|
||||
int get exerciseId;
|
||||
|
||||
@override
|
||||
String get name;
|
||||
|
||||
@override
|
||||
String get category;
|
||||
|
||||
@override
|
||||
String? get image; // ignore: invalid_annotation_target
|
||||
@override
|
||||
@@ -856,8 +862,8 @@ abstract class _ExerciseSearchDetails implements ExerciseSearchDetails {
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ExerciseSearchDetailsImplCopyWith<_$ExerciseSearchDetailsImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
_$$ExerciseSearchDetailsImplCopyWith<_$ExerciseSearchDetailsImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
ExerciseSearchEntry _$ExerciseSearchEntryFromJson(Map<String, dynamic> json) {
|
||||
@@ -867,6 +873,7 @@ ExerciseSearchEntry _$ExerciseSearchEntryFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$ExerciseSearchEntry {
|
||||
String get value => throw _privateConstructorUsedError;
|
||||
|
||||
ExerciseSearchDetails get data => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ExerciseSearchEntry to a JSON map.
|
||||
@@ -884,6 +891,7 @@ abstract class $ExerciseSearchEntryCopyWith<$Res> {
|
||||
factory $ExerciseSearchEntryCopyWith(
|
||||
ExerciseSearchEntry value, $Res Function(ExerciseSearchEntry) then) =
|
||||
_$ExerciseSearchEntryCopyWithImpl<$Res, ExerciseSearchEntry>;
|
||||
|
||||
@useResult
|
||||
$Res call({String value, ExerciseSearchDetails data});
|
||||
|
||||
@@ -897,6 +905,7 @@ class _$ExerciseSearchEntryCopyWithImpl<$Res, $Val extends ExerciseSearchEntry>
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -934,9 +943,10 @@ class _$ExerciseSearchEntryCopyWithImpl<$Res, $Val extends ExerciseSearchEntry>
|
||||
/// @nodoc
|
||||
abstract class _$$ExerciseSearchEntryImplCopyWith<$Res>
|
||||
implements $ExerciseSearchEntryCopyWith<$Res> {
|
||||
factory _$$ExerciseSearchEntryImplCopyWith(_$ExerciseSearchEntryImpl value,
|
||||
$Res Function(_$ExerciseSearchEntryImpl) then) =
|
||||
factory _$$ExerciseSearchEntryImplCopyWith(
|
||||
_$ExerciseSearchEntryImpl value, $Res Function(_$ExerciseSearchEntryImpl) then) =
|
||||
__$$ExerciseSearchEntryImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String value, ExerciseSearchDetails data});
|
||||
@@ -949,8 +959,8 @@ abstract class _$$ExerciseSearchEntryImplCopyWith<$Res>
|
||||
class __$$ExerciseSearchEntryImplCopyWithImpl<$Res>
|
||||
extends _$ExerciseSearchEntryCopyWithImpl<$Res, _$ExerciseSearchEntryImpl>
|
||||
implements _$$ExerciseSearchEntryImplCopyWith<$Res> {
|
||||
__$$ExerciseSearchEntryImplCopyWithImpl(_$ExerciseSearchEntryImpl _value,
|
||||
$Res Function(_$ExerciseSearchEntryImpl) _then)
|
||||
__$$ExerciseSearchEntryImplCopyWithImpl(
|
||||
_$ExerciseSearchEntryImpl _value, $Res Function(_$ExerciseSearchEntryImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ExerciseSearchEntry
|
||||
@@ -1011,8 +1021,7 @@ class _$ExerciseSearchEntryImpl implements _ExerciseSearchEntry {
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ExerciseSearchEntryImplCopyWith<_$ExerciseSearchEntryImpl> get copyWith =>
|
||||
__$$ExerciseSearchEntryImplCopyWithImpl<_$ExerciseSearchEntryImpl>(
|
||||
this, _$identity);
|
||||
__$$ExerciseSearchEntryImplCopyWithImpl<_$ExerciseSearchEntryImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -1032,6 +1041,7 @@ abstract class _ExerciseSearchEntry implements ExerciseSearchEntry {
|
||||
|
||||
@override
|
||||
String get value;
|
||||
|
||||
@override
|
||||
ExerciseSearchDetails get data;
|
||||
|
||||
@@ -1049,8 +1059,7 @@ ExerciseApiSearch _$ExerciseApiSearchFromJson(Map<String, dynamic> json) {
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ExerciseApiSearch {
|
||||
List<ExerciseSearchEntry> get suggestions =>
|
||||
throw _privateConstructorUsedError;
|
||||
List<ExerciseSearchEntry> get suggestions => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ExerciseApiSearch to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -1058,8 +1067,7 @@ mixin _$ExerciseApiSearch {
|
||||
/// Create a copy of ExerciseApiSearch
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ExerciseApiSearchCopyWith<ExerciseApiSearch> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
$ExerciseApiSearchCopyWith<ExerciseApiSearch> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1067,6 +1075,7 @@ abstract class $ExerciseApiSearchCopyWith<$Res> {
|
||||
factory $ExerciseApiSearchCopyWith(
|
||||
ExerciseApiSearch value, $Res Function(ExerciseApiSearch) then) =
|
||||
_$ExerciseApiSearchCopyWithImpl<$Res, ExerciseApiSearch>;
|
||||
|
||||
@useResult
|
||||
$Res call({List<ExerciseSearchEntry> suggestions});
|
||||
}
|
||||
@@ -1078,6 +1087,7 @@ class _$ExerciseApiSearchCopyWithImpl<$Res, $Val extends ExerciseApiSearch>
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -1098,11 +1108,11 @@ class _$ExerciseApiSearchCopyWithImpl<$Res, $Val extends ExerciseApiSearch>
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ExerciseApiSearchImplCopyWith<$Res>
|
||||
implements $ExerciseApiSearchCopyWith<$Res> {
|
||||
factory _$$ExerciseApiSearchImplCopyWith(_$ExerciseApiSearchImpl value,
|
||||
$Res Function(_$ExerciseApiSearchImpl) then) =
|
||||
abstract class _$$ExerciseApiSearchImplCopyWith<$Res> implements $ExerciseApiSearchCopyWith<$Res> {
|
||||
factory _$$ExerciseApiSearchImplCopyWith(
|
||||
_$ExerciseApiSearchImpl value, $Res Function(_$ExerciseApiSearchImpl) then) =
|
||||
__$$ExerciseApiSearchImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call({List<ExerciseSearchEntry> suggestions});
|
||||
@@ -1112,8 +1122,8 @@ abstract class _$$ExerciseApiSearchImplCopyWith<$Res>
|
||||
class __$$ExerciseApiSearchImplCopyWithImpl<$Res>
|
||||
extends _$ExerciseApiSearchCopyWithImpl<$Res, _$ExerciseApiSearchImpl>
|
||||
implements _$$ExerciseApiSearchImplCopyWith<$Res> {
|
||||
__$$ExerciseApiSearchImplCopyWithImpl(_$ExerciseApiSearchImpl _value,
|
||||
$Res Function(_$ExerciseApiSearchImpl) _then)
|
||||
__$$ExerciseApiSearchImplCopyWithImpl(
|
||||
_$ExerciseApiSearchImpl _value, $Res Function(_$ExerciseApiSearchImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ExerciseApiSearch
|
||||
@@ -1135,14 +1145,14 @@ class __$$ExerciseApiSearchImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ExerciseApiSearchImpl implements _ExerciseApiSearch {
|
||||
_$ExerciseApiSearchImpl(
|
||||
{required final List<ExerciseSearchEntry> suggestions})
|
||||
_$ExerciseApiSearchImpl({required final List<ExerciseSearchEntry> suggestions})
|
||||
: _suggestions = suggestions;
|
||||
|
||||
factory _$ExerciseApiSearchImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ExerciseApiSearchImplFromJson(json);
|
||||
|
||||
final List<ExerciseSearchEntry> _suggestions;
|
||||
|
||||
@override
|
||||
List<ExerciseSearchEntry> get suggestions {
|
||||
if (_suggestions is EqualUnmodifiableListView) return _suggestions;
|
||||
@@ -1160,14 +1170,12 @@ class _$ExerciseApiSearchImpl implements _ExerciseApiSearch {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ExerciseApiSearchImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._suggestions, _suggestions));
|
||||
const DeepCollectionEquality().equals(other._suggestions, _suggestions));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_suggestions));
|
||||
int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_suggestions));
|
||||
|
||||
/// Create a copy of ExerciseApiSearch
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -1175,8 +1183,7 @@ class _$ExerciseApiSearchImpl implements _ExerciseApiSearch {
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ExerciseApiSearchImplCopyWith<_$ExerciseApiSearchImpl> get copyWith =>
|
||||
__$$ExerciseApiSearchImplCopyWithImpl<_$ExerciseApiSearchImpl>(
|
||||
this, _$identity);
|
||||
__$$ExerciseApiSearchImplCopyWithImpl<_$ExerciseApiSearchImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -1187,12 +1194,10 @@ class _$ExerciseApiSearchImpl implements _ExerciseApiSearch {
|
||||
}
|
||||
|
||||
abstract class _ExerciseApiSearch implements ExerciseApiSearch {
|
||||
factory _ExerciseApiSearch(
|
||||
{required final List<ExerciseSearchEntry> suggestions}) =
|
||||
factory _ExerciseApiSearch({required final List<ExerciseSearchEntry> suggestions}) =
|
||||
_$ExerciseApiSearchImpl;
|
||||
|
||||
factory _ExerciseApiSearch.fromJson(Map<String, dynamic> json) =
|
||||
_$ExerciseApiSearchImpl.fromJson;
|
||||
factory _ExerciseApiSearch.fromJson(Map<String, dynamic> json) = _$ExerciseApiSearchImpl.fromJson;
|
||||
|
||||
@override
|
||||
List<ExerciseSearchEntry> get suggestions;
|
||||
|
||||
@@ -6,8 +6,7 @@ part of 'exercise_api.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ExerciseBaseDataImpl _$$ExerciseBaseDataImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ExerciseBaseDataImpl _$$ExerciseBaseDataImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ExerciseBaseDataImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
uuid: json['uuid'] as String,
|
||||
@@ -15,8 +14,7 @@ _$ExerciseBaseDataImpl _$$ExerciseBaseDataImplFromJson(
|
||||
created: DateTime.parse(json['created'] as String),
|
||||
lastUpdate: DateTime.parse(json['last_update'] as String),
|
||||
lastUpdateGlobal: DateTime.parse(json['last_update_global'] as String),
|
||||
category:
|
||||
ExerciseCategory.fromJson(json['category'] as Map<String, dynamic>),
|
||||
category: ExerciseCategory.fromJson(json['category'] as Map<String, dynamic>),
|
||||
muscles: (json['muscles'] as List<dynamic>)
|
||||
.map((e) => Muscle.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
@@ -35,16 +33,12 @@ _$ExerciseBaseDataImpl _$$ExerciseBaseDataImplFromJson(
|
||||
videos: (json['videos'] as List<dynamic>)
|
||||
.map((e) => Video.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
authors: (json['author_history'] as List<dynamic>)
|
||||
.map((e) => e as String)
|
||||
.toList(),
|
||||
authorsGlobal: (json['total_authors_history'] as List<dynamic>)
|
||||
.map((e) => e as String)
|
||||
.toList(),
|
||||
authors: (json['author_history'] as List<dynamic>).map((e) => e as String).toList(),
|
||||
authorsGlobal:
|
||||
(json['total_authors_history'] as List<dynamic>).map((e) => e as String).toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ExerciseBaseDataImplToJson(
|
||||
_$ExerciseBaseDataImpl instance) =>
|
||||
Map<String, dynamic> _$$ExerciseBaseDataImplToJson(_$ExerciseBaseDataImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'uuid': instance.uuid,
|
||||
@@ -63,8 +57,7 @@ Map<String, dynamic> _$$ExerciseBaseDataImplToJson(
|
||||
'total_authors_history': instance.authorsGlobal,
|
||||
};
|
||||
|
||||
_$ExerciseSearchDetailsImpl _$$ExerciseSearchDetailsImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ExerciseSearchDetailsImpl _$$ExerciseSearchDetailsImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ExerciseSearchDetailsImpl(
|
||||
translationId: (json['id'] as num).toInt(),
|
||||
exerciseId: (json['base_id'] as num).toInt(),
|
||||
@@ -74,8 +67,7 @@ _$ExerciseSearchDetailsImpl _$$ExerciseSearchDetailsImplFromJson(
|
||||
imageThumbnail: json['image_thumbnail'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ExerciseSearchDetailsImplToJson(
|
||||
_$ExerciseSearchDetailsImpl instance) =>
|
||||
Map<String, dynamic> _$$ExerciseSearchDetailsImplToJson(_$ExerciseSearchDetailsImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.translationId,
|
||||
'base_id': instance.exerciseId,
|
||||
@@ -85,31 +77,26 @@ Map<String, dynamic> _$$ExerciseSearchDetailsImplToJson(
|
||||
'image_thumbnail': instance.imageThumbnail,
|
||||
};
|
||||
|
||||
_$ExerciseSearchEntryImpl _$$ExerciseSearchEntryImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ExerciseSearchEntryImpl _$$ExerciseSearchEntryImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ExerciseSearchEntryImpl(
|
||||
value: json['value'] as String,
|
||||
data:
|
||||
ExerciseSearchDetails.fromJson(json['data'] as Map<String, dynamic>),
|
||||
data: ExerciseSearchDetails.fromJson(json['data'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ExerciseSearchEntryImplToJson(
|
||||
_$ExerciseSearchEntryImpl instance) =>
|
||||
Map<String, dynamic> _$$ExerciseSearchEntryImplToJson(_$ExerciseSearchEntryImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'value': instance.value,
|
||||
'data': instance.data,
|
||||
};
|
||||
|
||||
_$ExerciseApiSearchImpl _$$ExerciseApiSearchImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ExerciseApiSearchImpl _$$ExerciseApiSearchImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ExerciseApiSearchImpl(
|
||||
suggestions: (json['suggestions'] as List<dynamic>)
|
||||
.map((e) => ExerciseSearchEntry.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ExerciseApiSearchImplToJson(
|
||||
_$ExerciseApiSearchImpl instance) =>
|
||||
Map<String, dynamic> _$$ExerciseApiSearchImplToJson(_$ExerciseApiSearchImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'suggestions': instance.suggestions,
|
||||
};
|
||||
|
||||
@@ -20,8 +20,7 @@ ExerciseImage _$ExerciseImageFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$ExerciseImageToJson(ExerciseImage instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$ExerciseImageToJson(ExerciseImage instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'uuid': instance.uuid,
|
||||
'exercise_base': instance.exerciseBaseId,
|
||||
|
||||
@@ -14,17 +14,17 @@ T _$identity<T>(T value) => value;
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
IngredientApiSearchDetails _$IngredientApiSearchDetailsFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
IngredientApiSearchDetails _$IngredientApiSearchDetailsFromJson(Map<String, dynamic> json) {
|
||||
return _IngredientApiSearchDetails.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$IngredientApiSearchDetails {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
String? get image =>
|
||||
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
|
||||
String? get image => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
@JsonKey(name: 'image_thumbnail')
|
||||
String? get imageThumbnail => throw _privateConstructorUsedError;
|
||||
|
||||
@@ -34,16 +34,16 @@ mixin _$IngredientApiSearchDetails {
|
||||
/// Create a copy of IngredientApiSearchDetails
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$IngredientApiSearchDetailsCopyWith<IngredientApiSearchDetails>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
$IngredientApiSearchDetailsCopyWith<IngredientApiSearchDetails> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $IngredientApiSearchDetailsCopyWith<$Res> {
|
||||
factory $IngredientApiSearchDetailsCopyWith(IngredientApiSearchDetails value,
|
||||
$Res Function(IngredientApiSearchDetails) then) =
|
||||
_$IngredientApiSearchDetailsCopyWithImpl<$Res,
|
||||
IngredientApiSearchDetails>;
|
||||
factory $IngredientApiSearchDetailsCopyWith(
|
||||
IngredientApiSearchDetails value, $Res Function(IngredientApiSearchDetails) then) =
|
||||
_$IngredientApiSearchDetailsCopyWithImpl<$Res, IngredientApiSearchDetails>;
|
||||
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@@ -53,13 +53,13 @@ abstract class $IngredientApiSearchDetailsCopyWith<$Res> {
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$IngredientApiSearchDetailsCopyWithImpl<$Res,
|
||||
$Val extends IngredientApiSearchDetails>
|
||||
class _$IngredientApiSearchDetailsCopyWithImpl<$Res, $Val extends IngredientApiSearchDetails>
|
||||
implements $IngredientApiSearchDetailsCopyWith<$Res> {
|
||||
_$IngredientApiSearchDetailsCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -97,10 +97,10 @@ class _$IngredientApiSearchDetailsCopyWithImpl<$Res,
|
||||
/// @nodoc
|
||||
abstract class _$$IngredientApiSearchDetailsImplCopyWith<$Res>
|
||||
implements $IngredientApiSearchDetailsCopyWith<$Res> {
|
||||
factory _$$IngredientApiSearchDetailsImplCopyWith(
|
||||
_$IngredientApiSearchDetailsImpl value,
|
||||
factory _$$IngredientApiSearchDetailsImplCopyWith(_$IngredientApiSearchDetailsImpl value,
|
||||
$Res Function(_$IngredientApiSearchDetailsImpl) then) =
|
||||
__$$IngredientApiSearchDetailsImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
@@ -112,11 +112,9 @@ abstract class _$$IngredientApiSearchDetailsImplCopyWith<$Res>
|
||||
|
||||
/// @nodoc
|
||||
class __$$IngredientApiSearchDetailsImplCopyWithImpl<$Res>
|
||||
extends _$IngredientApiSearchDetailsCopyWithImpl<$Res,
|
||||
_$IngredientApiSearchDetailsImpl>
|
||||
extends _$IngredientApiSearchDetailsCopyWithImpl<$Res, _$IngredientApiSearchDetailsImpl>
|
||||
implements _$$IngredientApiSearchDetailsImplCopyWith<$Res> {
|
||||
__$$IngredientApiSearchDetailsImplCopyWithImpl(
|
||||
_$IngredientApiSearchDetailsImpl _value,
|
||||
__$$IngredientApiSearchDetailsImplCopyWithImpl(_$IngredientApiSearchDetailsImpl _value,
|
||||
$Res Function(_$IngredientApiSearchDetailsImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@@ -160,8 +158,7 @@ class _$IngredientApiSearchDetailsImpl implements _IngredientApiSearchDetails {
|
||||
required this.image,
|
||||
@JsonKey(name: 'image_thumbnail') required this.imageThumbnail});
|
||||
|
||||
factory _$IngredientApiSearchDetailsImpl.fromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
factory _$IngredientApiSearchDetailsImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$IngredientApiSearchDetailsImplFromJson(json);
|
||||
|
||||
@override
|
||||
@@ -170,6 +167,7 @@ class _$IngredientApiSearchDetailsImpl implements _IngredientApiSearchDetails {
|
||||
final String name;
|
||||
@override
|
||||
final String? image;
|
||||
|
||||
// ignore: invalid_annotation_target
|
||||
@override
|
||||
@JsonKey(name: 'image_thumbnail')
|
||||
@@ -201,9 +199,9 @@ class _$IngredientApiSearchDetailsImpl implements _IngredientApiSearchDetails {
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$IngredientApiSearchDetailsImplCopyWith<_$IngredientApiSearchDetailsImpl>
|
||||
get copyWith => __$$IngredientApiSearchDetailsImplCopyWithImpl<
|
||||
_$IngredientApiSearchDetailsImpl>(this, _$identity);
|
||||
_$$IngredientApiSearchDetailsImplCopyWith<_$IngredientApiSearchDetailsImpl> get copyWith =>
|
||||
__$$IngredientApiSearchDetailsImplCopyWithImpl<_$IngredientApiSearchDetailsImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -213,14 +211,12 @@ class _$IngredientApiSearchDetailsImpl implements _IngredientApiSearchDetails {
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _IngredientApiSearchDetails
|
||||
implements IngredientApiSearchDetails {
|
||||
abstract class _IngredientApiSearchDetails implements IngredientApiSearchDetails {
|
||||
factory _IngredientApiSearchDetails(
|
||||
{required final int id,
|
||||
required final String name,
|
||||
required final String? image,
|
||||
@JsonKey(name: 'image_thumbnail')
|
||||
required final String? imageThumbnail}) =
|
||||
@JsonKey(name: 'image_thumbnail') required final String? imageThumbnail}) =
|
||||
_$IngredientApiSearchDetailsImpl;
|
||||
|
||||
factory _IngredientApiSearchDetails.fromJson(Map<String, dynamic> json) =
|
||||
@@ -228,8 +224,10 @@ abstract class _IngredientApiSearchDetails
|
||||
|
||||
@override
|
||||
int get id;
|
||||
|
||||
@override
|
||||
String get name;
|
||||
|
||||
@override
|
||||
String? get image; // ignore: invalid_annotation_target
|
||||
@override
|
||||
@@ -240,18 +238,18 @@ abstract class _IngredientApiSearchDetails
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$IngredientApiSearchDetailsImplCopyWith<_$IngredientApiSearchDetailsImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
_$$IngredientApiSearchDetailsImplCopyWith<_$IngredientApiSearchDetailsImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
IngredientApiSearchEntry _$IngredientApiSearchEntryFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
IngredientApiSearchEntry _$IngredientApiSearchEntryFromJson(Map<String, dynamic> json) {
|
||||
return _IngredientApiSearchEntry.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$IngredientApiSearchEntry {
|
||||
String get value => throw _privateConstructorUsedError;
|
||||
|
||||
IngredientApiSearchDetails get data => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this IngredientApiSearchEntry to a JSON map.
|
||||
@@ -266,9 +264,10 @@ mixin _$IngredientApiSearchEntry {
|
||||
|
||||
/// @nodoc
|
||||
abstract class $IngredientApiSearchEntryCopyWith<$Res> {
|
||||
factory $IngredientApiSearchEntryCopyWith(IngredientApiSearchEntry value,
|
||||
$Res Function(IngredientApiSearchEntry) then) =
|
||||
factory $IngredientApiSearchEntryCopyWith(
|
||||
IngredientApiSearchEntry value, $Res Function(IngredientApiSearchEntry) then) =
|
||||
_$IngredientApiSearchEntryCopyWithImpl<$Res, IngredientApiSearchEntry>;
|
||||
|
||||
@useResult
|
||||
$Res call({String value, IngredientApiSearchDetails data});
|
||||
|
||||
@@ -276,13 +275,13 @@ abstract class $IngredientApiSearchEntryCopyWith<$Res> {
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$IngredientApiSearchEntryCopyWithImpl<$Res,
|
||||
$Val extends IngredientApiSearchEntry>
|
||||
class _$IngredientApiSearchEntryCopyWithImpl<$Res, $Val extends IngredientApiSearchEntry>
|
||||
implements $IngredientApiSearchEntryCopyWith<$Res> {
|
||||
_$IngredientApiSearchEntryCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -320,10 +319,10 @@ class _$IngredientApiSearchEntryCopyWithImpl<$Res,
|
||||
/// @nodoc
|
||||
abstract class _$$IngredientApiSearchEntryImplCopyWith<$Res>
|
||||
implements $IngredientApiSearchEntryCopyWith<$Res> {
|
||||
factory _$$IngredientApiSearchEntryImplCopyWith(
|
||||
_$IngredientApiSearchEntryImpl value,
|
||||
factory _$$IngredientApiSearchEntryImplCopyWith(_$IngredientApiSearchEntryImpl value,
|
||||
$Res Function(_$IngredientApiSearchEntryImpl) then) =
|
||||
__$$IngredientApiSearchEntryImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String value, IngredientApiSearchDetails data});
|
||||
@@ -334,12 +333,10 @@ abstract class _$$IngredientApiSearchEntryImplCopyWith<$Res>
|
||||
|
||||
/// @nodoc
|
||||
class __$$IngredientApiSearchEntryImplCopyWithImpl<$Res>
|
||||
extends _$IngredientApiSearchEntryCopyWithImpl<$Res,
|
||||
_$IngredientApiSearchEntryImpl>
|
||||
extends _$IngredientApiSearchEntryCopyWithImpl<$Res, _$IngredientApiSearchEntryImpl>
|
||||
implements _$$IngredientApiSearchEntryImplCopyWith<$Res> {
|
||||
__$$IngredientApiSearchEntryImplCopyWithImpl(
|
||||
_$IngredientApiSearchEntryImpl _value,
|
||||
$Res Function(_$IngredientApiSearchEntryImpl) _then)
|
||||
_$IngredientApiSearchEntryImpl _value, $Res Function(_$IngredientApiSearchEntryImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of IngredientApiSearchEntry
|
||||
@@ -399,9 +396,9 @@ class _$IngredientApiSearchEntryImpl implements _IngredientApiSearchEntry {
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$IngredientApiSearchEntryImplCopyWith<_$IngredientApiSearchEntryImpl>
|
||||
get copyWith => __$$IngredientApiSearchEntryImplCopyWithImpl<
|
||||
_$IngredientApiSearchEntryImpl>(this, _$identity);
|
||||
_$$IngredientApiSearchEntryImplCopyWith<_$IngredientApiSearchEntryImpl> get copyWith =>
|
||||
__$$IngredientApiSearchEntryImplCopyWithImpl<_$IngredientApiSearchEntryImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -413,15 +410,15 @@ class _$IngredientApiSearchEntryImpl implements _IngredientApiSearchEntry {
|
||||
|
||||
abstract class _IngredientApiSearchEntry implements IngredientApiSearchEntry {
|
||||
factory _IngredientApiSearchEntry(
|
||||
{required final String value,
|
||||
required final IngredientApiSearchDetails data}) =
|
||||
_$IngredientApiSearchEntryImpl;
|
||||
{required final String value,
|
||||
required final IngredientApiSearchDetails data}) = _$IngredientApiSearchEntryImpl;
|
||||
|
||||
factory _IngredientApiSearchEntry.fromJson(Map<String, dynamic> json) =
|
||||
_$IngredientApiSearchEntryImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get value;
|
||||
|
||||
@override
|
||||
IngredientApiSearchDetails get data;
|
||||
|
||||
@@ -429,8 +426,8 @@ abstract class _IngredientApiSearchEntry implements IngredientApiSearchEntry {
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$IngredientApiSearchEntryImplCopyWith<_$IngredientApiSearchEntryImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
_$$IngredientApiSearchEntryImplCopyWith<_$IngredientApiSearchEntryImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
IngredientApiSearch _$IngredientApiSearchFromJson(Map<String, dynamic> json) {
|
||||
@@ -439,8 +436,7 @@ IngredientApiSearch _$IngredientApiSearchFromJson(Map<String, dynamic> json) {
|
||||
|
||||
/// @nodoc
|
||||
mixin _$IngredientApiSearch {
|
||||
List<IngredientApiSearchEntry> get suggestions =>
|
||||
throw _privateConstructorUsedError;
|
||||
List<IngredientApiSearchEntry> get suggestions => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this IngredientApiSearch to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -457,6 +453,7 @@ abstract class $IngredientApiSearchCopyWith<$Res> {
|
||||
factory $IngredientApiSearchCopyWith(
|
||||
IngredientApiSearch value, $Res Function(IngredientApiSearch) then) =
|
||||
_$IngredientApiSearchCopyWithImpl<$Res, IngredientApiSearch>;
|
||||
|
||||
@useResult
|
||||
$Res call({List<IngredientApiSearchEntry> suggestions});
|
||||
}
|
||||
@@ -468,6 +465,7 @@ class _$IngredientApiSearchCopyWithImpl<$Res, $Val extends IngredientApiSearch>
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -490,9 +488,10 @@ class _$IngredientApiSearchCopyWithImpl<$Res, $Val extends IngredientApiSearch>
|
||||
/// @nodoc
|
||||
abstract class _$$IngredientApiSearchImplCopyWith<$Res>
|
||||
implements $IngredientApiSearchCopyWith<$Res> {
|
||||
factory _$$IngredientApiSearchImplCopyWith(_$IngredientApiSearchImpl value,
|
||||
$Res Function(_$IngredientApiSearchImpl) then) =
|
||||
factory _$$IngredientApiSearchImplCopyWith(
|
||||
_$IngredientApiSearchImpl value, $Res Function(_$IngredientApiSearchImpl) then) =
|
||||
__$$IngredientApiSearchImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call({List<IngredientApiSearchEntry> suggestions});
|
||||
@@ -502,8 +501,8 @@ abstract class _$$IngredientApiSearchImplCopyWith<$Res>
|
||||
class __$$IngredientApiSearchImplCopyWithImpl<$Res>
|
||||
extends _$IngredientApiSearchCopyWithImpl<$Res, _$IngredientApiSearchImpl>
|
||||
implements _$$IngredientApiSearchImplCopyWith<$Res> {
|
||||
__$$IngredientApiSearchImplCopyWithImpl(_$IngredientApiSearchImpl _value,
|
||||
$Res Function(_$IngredientApiSearchImpl) _then)
|
||||
__$$IngredientApiSearchImplCopyWithImpl(
|
||||
_$IngredientApiSearchImpl _value, $Res Function(_$IngredientApiSearchImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of IngredientApiSearch
|
||||
@@ -525,14 +524,14 @@ class __$$IngredientApiSearchImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$IngredientApiSearchImpl implements _IngredientApiSearch {
|
||||
_$IngredientApiSearchImpl(
|
||||
{required final List<IngredientApiSearchEntry> suggestions})
|
||||
_$IngredientApiSearchImpl({required final List<IngredientApiSearchEntry> suggestions})
|
||||
: _suggestions = suggestions;
|
||||
|
||||
factory _$IngredientApiSearchImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$IngredientApiSearchImplFromJson(json);
|
||||
|
||||
final List<IngredientApiSearchEntry> _suggestions;
|
||||
|
||||
@override
|
||||
List<IngredientApiSearchEntry> get suggestions {
|
||||
if (_suggestions is EqualUnmodifiableListView) return _suggestions;
|
||||
@@ -550,14 +549,12 @@ class _$IngredientApiSearchImpl implements _IngredientApiSearch {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$IngredientApiSearchImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._suggestions, _suggestions));
|
||||
const DeepCollectionEquality().equals(other._suggestions, _suggestions));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_suggestions));
|
||||
int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_suggestions));
|
||||
|
||||
/// Create a copy of IngredientApiSearch
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -565,8 +562,7 @@ class _$IngredientApiSearchImpl implements _IngredientApiSearch {
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$IngredientApiSearchImplCopyWith<_$IngredientApiSearchImpl> get copyWith =>
|
||||
__$$IngredientApiSearchImplCopyWithImpl<_$IngredientApiSearchImpl>(
|
||||
this, _$identity);
|
||||
__$$IngredientApiSearchImplCopyWithImpl<_$IngredientApiSearchImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -577,8 +573,7 @@ class _$IngredientApiSearchImpl implements _IngredientApiSearch {
|
||||
}
|
||||
|
||||
abstract class _IngredientApiSearch implements IngredientApiSearch {
|
||||
factory _IngredientApiSearch(
|
||||
{required final List<IngredientApiSearchEntry> suggestions}) =
|
||||
factory _IngredientApiSearch({required final List<IngredientApiSearchEntry> suggestions}) =
|
||||
_$IngredientApiSearchImpl;
|
||||
|
||||
factory _IngredientApiSearch.fromJson(Map<String, dynamic> json) =
|
||||
|
||||
@@ -24,12 +24,10 @@ Map<String, dynamic> _$$IngredientApiSearchDetailsImplToJson(
|
||||
'image_thumbnail': instance.imageThumbnail,
|
||||
};
|
||||
|
||||
_$IngredientApiSearchEntryImpl _$$IngredientApiSearchEntryImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$IngredientApiSearchEntryImpl _$$IngredientApiSearchEntryImplFromJson(Map<String, dynamic> json) =>
|
||||
_$IngredientApiSearchEntryImpl(
|
||||
value: json['value'] as String,
|
||||
data: IngredientApiSearchDetails.fromJson(
|
||||
json['data'] as Map<String, dynamic>),
|
||||
data: IngredientApiSearchDetails.fromJson(json['data'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$IngredientApiSearchEntryImplToJson(
|
||||
@@ -39,17 +37,14 @@ Map<String, dynamic> _$$IngredientApiSearchEntryImplToJson(
|
||||
'data': instance.data,
|
||||
};
|
||||
|
||||
_$IngredientApiSearchImpl _$$IngredientApiSearchImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$IngredientApiSearchImpl _$$IngredientApiSearchImplFromJson(Map<String, dynamic> json) =>
|
||||
_$IngredientApiSearchImpl(
|
||||
suggestions: (json['suggestions'] as List<dynamic>)
|
||||
.map((e) =>
|
||||
IngredientApiSearchEntry.fromJson(e as Map<String, dynamic>))
|
||||
.map((e) => IngredientApiSearchEntry.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$IngredientApiSearchImplToJson(
|
||||
_$IngredientApiSearchImpl instance) =>
|
||||
Map<String, dynamic> _$$IngredientApiSearchImplToJson(_$IngredientApiSearchImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'suggestions': instance.suggestions,
|
||||
};
|
||||
|
||||
@@ -22,9 +22,7 @@ Translation _$TranslationFromJson(Map<String, dynamic> json) {
|
||||
return Translation(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
uuid: json['uuid'] as String?,
|
||||
created: json['created'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created'] as String),
|
||||
created: json['created'] == null ? null : DateTime.parse(json['created'] as String),
|
||||
name: json['name'] as String,
|
||||
description: json['description'] as String,
|
||||
exerciseId: (json['exercise_base'] as num?)?.toInt(),
|
||||
@@ -38,8 +36,7 @@ Translation _$TranslationFromJson(Map<String, dynamic> json) {
|
||||
.toList();
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$TranslationToJson(Translation instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$TranslationToJson(Translation instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'uuid': instance.uuid,
|
||||
'language': instance.languageId,
|
||||
|
||||
@@ -22,9 +22,7 @@ MeasurementCategory _$MeasurementCategoryFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$MeasurementCategoryToJson(
|
||||
MeasurementCategory instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$MeasurementCategoryToJson(MeasurementCategory instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'unit': instance.unit,
|
||||
|
||||
@@ -20,8 +20,7 @@ MeasurementEntry _$MeasurementEntryFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$MeasurementEntryToJson(MeasurementEntry instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$MeasurementEntryToJson(MeasurementEntry instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'category': instance.category,
|
||||
'date': toDate(instance.date),
|
||||
|
||||
@@ -51,8 +51,7 @@ Ingredient _$IngredientFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$IngredientToJson(Ingredient instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$IngredientToJson(Ingredient instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'remote_id': instance.remoteId,
|
||||
'source_name': instance.sourceName,
|
||||
|
||||
@@ -38,8 +38,7 @@ IngredientImage _$IngredientImageFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$IngredientImageToJson(IngredientImage instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$IngredientImageToJson(IngredientImage instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'uuid': instance.uuid,
|
||||
'ingredient_id': instance.ingredientId,
|
||||
|
||||
@@ -13,16 +13,14 @@ IngredientWeightUnit _$IngredientWeightUnitFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
return IngredientWeightUnit(
|
||||
id: (json['id'] as num).toInt(),
|
||||
weightUnit:
|
||||
WeightUnit.fromJson(json['weight_unit'] as Map<String, dynamic>),
|
||||
weightUnit: WeightUnit.fromJson(json['weight_unit'] as Map<String, dynamic>),
|
||||
ingredient: Ingredient.fromJson(json['ingredient'] as Map<String, dynamic>),
|
||||
grams: (json['grams'] as num).toInt(),
|
||||
amount: (json['amount'] as num).toDouble(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$IngredientWeightUnitToJson(
|
||||
IngredientWeightUnit instance) =>
|
||||
Map<String, dynamic> _$IngredientWeightUnitToJson(IngredientWeightUnit instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'weight_unit': instance.weightUnit,
|
||||
|
||||
@@ -9,14 +9,7 @@ part of 'log.dart';
|
||||
Log _$LogFromJson(Map<String, dynamic> json) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'id',
|
||||
'plan',
|
||||
'datetime',
|
||||
'ingredient',
|
||||
'weight_unit',
|
||||
'amount'
|
||||
],
|
||||
requiredKeys: const ['id', 'plan', 'datetime', 'ingredient', 'weight_unit', 'amount'],
|
||||
);
|
||||
return Log(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
|
||||
@@ -34,8 +34,7 @@ NutritionalPlan _$NutritionalPlanFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$NutritionalPlanToJson(NutritionalPlan instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$NutritionalPlanToJson(NutritionalPlan instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'description': instance.description,
|
||||
'creation_date': toDate(instance.creationDate),
|
||||
|
||||
@@ -17,8 +17,7 @@ WeightUnit _$WeightUnitFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$WeightUnitToJson(WeightUnit instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$WeightUnitToJson(WeightUnit instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
@@ -9,13 +9,7 @@ part of 'profile.dart';
|
||||
Profile _$ProfileFromJson(Map<String, dynamic> json) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'username',
|
||||
'email_verified',
|
||||
'is_trustworthy',
|
||||
'weight_unit',
|
||||
'email'
|
||||
],
|
||||
requiredKeys: const ['username', 'email_verified', 'is_trustworthy', 'weight_unit', 'email'],
|
||||
);
|
||||
return Profile(
|
||||
username: json['username'] as String,
|
||||
|
||||
@@ -15,8 +15,7 @@ Day _$DayFromJson(Map<String, dynamic> json) {
|
||||
..id = (json['id'] as num?)?.toInt()
|
||||
..workoutId = (json['training'] as num).toInt()
|
||||
..description = json['description'] as String
|
||||
..daysOfWeek =
|
||||
(json['day'] as List<dynamic>).map((e) => (e as num).toInt()).toList();
|
||||
..daysOfWeek = (json['day'] as List<dynamic>).map((e) => (e as num).toInt()).toList();
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$DayToJson(Day instance) => <String, dynamic>{
|
||||
|
||||
@@ -17,8 +17,7 @@ RepetitionUnit _$RepetitionUnitFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$RepetitionUnitToJson(RepetitionUnit instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$RepetitionUnitToJson(RepetitionUnit instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
@@ -21,15 +21,15 @@ import 'package:wger/models/exercises/exercise.dart';
|
||||
import 'package:wger/models/workouts/day.dart';
|
||||
import 'package:wger/models/workouts/log.dart';
|
||||
|
||||
part 'workout_plan.g.dart';
|
||||
part 'routine.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class WorkoutPlan {
|
||||
class Routine {
|
||||
@JsonKey(required: true)
|
||||
int? id;
|
||||
|
||||
@JsonKey(required: true, name: 'creation_date')
|
||||
late DateTime creationDate;
|
||||
@JsonKey(required: true)
|
||||
late DateTime created;
|
||||
|
||||
@JsonKey(required: true, name: 'name')
|
||||
late String name;
|
||||
@@ -37,16 +37,28 @@ class WorkoutPlan {
|
||||
@JsonKey(required: true, name: 'description')
|
||||
late String description;
|
||||
|
||||
@JsonKey(required: true, name: 'fit_in_week')
|
||||
late bool fitInWeek;
|
||||
|
||||
@JsonKey(required: true)
|
||||
late DateTime start;
|
||||
|
||||
@JsonKey(required: true)
|
||||
late DateTime end;
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
List<Day> days = [];
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
List<Log> logs = [];
|
||||
|
||||
WorkoutPlan({
|
||||
Routine({
|
||||
this.id,
|
||||
required this.creationDate,
|
||||
required this.created,
|
||||
required this.name,
|
||||
required this.start,
|
||||
required this.end,
|
||||
this.fitInWeek = false,
|
||||
String? description,
|
||||
List<Day>? days,
|
||||
List<Log>? logs,
|
||||
@@ -56,16 +68,16 @@ class WorkoutPlan {
|
||||
this.description = description ?? '';
|
||||
}
|
||||
|
||||
WorkoutPlan.empty() {
|
||||
creationDate = DateTime.now();
|
||||
Routine.empty() {
|
||||
created = DateTime.now();
|
||||
name = '';
|
||||
description = '';
|
||||
}
|
||||
|
||||
// Boilerplate
|
||||
factory WorkoutPlan.fromJson(Map<String, dynamic> json) => _$WorkoutPlanFromJson(json);
|
||||
factory Routine.fromJson(Map<String, dynamic> json) => _$RoutineFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$WorkoutPlanToJson(this);
|
||||
Map<String, dynamic> toJson() => _$RoutineToJson(this);
|
||||
|
||||
/// Filters the workout logs by exercise and sorts them by date
|
||||
///
|
||||
33
lib/models/workouts/routine.g.dart
Normal file
33
lib/models/workouts/routine.g.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'routine.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Routine _$RoutineFromJson(Map<String, dynamic> json) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const ['id', 'created', 'name', 'description', 'fit_in_week', 'start', 'end'],
|
||||
);
|
||||
return Routine(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
created: DateTime.parse(json['created'] as String),
|
||||
name: json['name'] as String,
|
||||
start: DateTime.parse(json['start'] as String),
|
||||
end: DateTime.parse(json['end'] as String),
|
||||
fitInWeek: json['fit_in_week'] as bool? ?? false,
|
||||
description: json['description'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$RoutineToJson(Routine instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'created': instance.created.toIso8601String(),
|
||||
'name': instance.name,
|
||||
'description': instance.description,
|
||||
'fit_in_week': instance.fitInWeek,
|
||||
'start': instance.start.toIso8601String(),
|
||||
'end': instance.end.toIso8601String(),
|
||||
};
|
||||
@@ -29,8 +29,8 @@ class WorkoutSession {
|
||||
@JsonKey(required: true)
|
||||
int? id;
|
||||
|
||||
@JsonKey(required: true, name: 'workout')
|
||||
late int workoutId;
|
||||
@JsonKey(required: true, name: 'routine')
|
||||
late int routineId;
|
||||
|
||||
@JsonKey(required: true, toJson: toDate)
|
||||
late DateTime date;
|
||||
@@ -51,7 +51,7 @@ class WorkoutSession {
|
||||
|
||||
WorkoutSession.withData({
|
||||
required this.id,
|
||||
required this.workoutId,
|
||||
required this.routineId,
|
||||
required this.date,
|
||||
required this.impression,
|
||||
required this.notes,
|
||||
@@ -66,6 +66,7 @@ class WorkoutSession {
|
||||
|
||||
// Boilerplate
|
||||
factory WorkoutSession.fromJson(Map<String, dynamic> json) => _$WorkoutSessionFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$WorkoutSessionToJson(this);
|
||||
|
||||
String? get impressionAsString {
|
||||
|
||||
@@ -9,18 +9,11 @@ part of 'session.dart';
|
||||
WorkoutSession _$WorkoutSessionFromJson(Map<String, dynamic> json) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'id',
|
||||
'workout',
|
||||
'date',
|
||||
'impression',
|
||||
'time_start',
|
||||
'time_end'
|
||||
],
|
||||
requiredKeys: const ['id', 'routine', 'date', 'impression', 'time_start', 'time_end'],
|
||||
);
|
||||
return WorkoutSession()
|
||||
..id = (json['id'] as num?)?.toInt()
|
||||
..workoutId = (json['workout'] as num).toInt()
|
||||
..routineId = (json['routine'] as num).toInt()
|
||||
..date = DateTime.parse(json['date'] as String)
|
||||
..impression = stringToNum(json['impression'] as String?)
|
||||
..notes = json['notes'] as String? ?? ''
|
||||
@@ -28,10 +21,9 @@ WorkoutSession _$WorkoutSessionFromJson(Map<String, dynamic> json) {
|
||||
..timeEnd = stringToTime(json['time_end'] as String?);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$WorkoutSessionToJson(WorkoutSession instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$WorkoutSessionToJson(WorkoutSession instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'workout': instance.workoutId,
|
||||
'routine': instance.routineId,
|
||||
'date': toDate(instance.date),
|
||||
'impression': numToString(instance.impression),
|
||||
'notes': instance.notes,
|
||||
|
||||
@@ -17,8 +17,7 @@ WeightUnit _$WeightUnitFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$WeightUnitToJson(WeightUnit instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$WeightUnitToJson(WeightUnit instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'workout_plan.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
WorkoutPlan _$WorkoutPlanFromJson(Map<String, dynamic> json) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const ['id', 'creation_date', 'name', 'description'],
|
||||
);
|
||||
return WorkoutPlan(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
creationDate: DateTime.parse(json['creation_date'] as String),
|
||||
name: json['name'] as String,
|
||||
description: json['description'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$WorkoutPlanToJson(WorkoutPlan instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'creation_date': instance.creationDate.toIso8601String(),
|
||||
'name': instance.name,
|
||||
'description': instance.description,
|
||||
};
|
||||
@@ -28,16 +28,16 @@ import 'package:wger/models/exercises/translation.dart';
|
||||
import 'package:wger/models/workouts/day.dart';
|
||||
import 'package:wger/models/workouts/log.dart';
|
||||
import 'package:wger/models/workouts/repetition_unit.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/models/workouts/session.dart';
|
||||
import 'package:wger/models/workouts/set.dart';
|
||||
import 'package:wger/models/workouts/setting.dart';
|
||||
import 'package:wger/models/workouts/weight_unit.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
import 'package:wger/providers/base_provider.dart';
|
||||
import 'package:wger/providers/exercises.dart';
|
||||
|
||||
class WorkoutPlansProvider with ChangeNotifier {
|
||||
static const _workoutPlansUrlPath = 'workout';
|
||||
static const _routinesUrlPath = 'routine';
|
||||
static const _daysUrlPath = 'day';
|
||||
static const _setsUrlPath = 'set';
|
||||
static const _settingsUrlPath = 'setting';
|
||||
@@ -46,21 +46,21 @@ class WorkoutPlansProvider with ChangeNotifier {
|
||||
static const _weightUnitUrlPath = 'setting-weightunit';
|
||||
static const _repetitionUnitUrlPath = 'setting-repetitionunit';
|
||||
|
||||
WorkoutPlan? _currentPlan;
|
||||
Routine? _currentPlan;
|
||||
final ExercisesProvider _exercises;
|
||||
final WgerBaseProvider baseProvider;
|
||||
List<WorkoutPlan> _workoutPlans = [];
|
||||
List<Routine> _workoutPlans = [];
|
||||
List<WeightUnit> _weightUnits = [];
|
||||
List<RepetitionUnit> _repetitionUnit = [];
|
||||
|
||||
WorkoutPlansProvider(
|
||||
this.baseProvider,
|
||||
ExercisesProvider exercises,
|
||||
List<WorkoutPlan> entries,
|
||||
List<Routine> entries,
|
||||
) : _exercises = exercises,
|
||||
_workoutPlans = entries;
|
||||
|
||||
List<WorkoutPlan> get items {
|
||||
List<Routine> get items {
|
||||
return [..._workoutPlans];
|
||||
}
|
||||
|
||||
@@ -90,11 +90,11 @@ class WorkoutPlansProvider with ChangeNotifier {
|
||||
return _repetitionUnit.firstWhere((element) => element.id == REP_UNIT_REPETITIONS);
|
||||
}
|
||||
|
||||
List<WorkoutPlan> getPlans() {
|
||||
List<Routine> getPlans() {
|
||||
return _workoutPlans;
|
||||
}
|
||||
|
||||
WorkoutPlan findById(int id) {
|
||||
Routine findById(int id) {
|
||||
return _workoutPlans.firstWhere((workoutPlan) => workoutPlan.id == id);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ class WorkoutPlansProvider with ChangeNotifier {
|
||||
}
|
||||
|
||||
/// Returns the currently "active" workout plan
|
||||
WorkoutPlan? get currentPlan {
|
||||
Routine? get currentPlan {
|
||||
return _currentPlan;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ class WorkoutPlansProvider with ChangeNotifier {
|
||||
|
||||
/// Returns the current active workout plan. At the moment this is just
|
||||
/// the latest, but this might change in the future.
|
||||
WorkoutPlan? get activePlan {
|
||||
Routine? get activePlan {
|
||||
if (_workoutPlans.isNotEmpty) {
|
||||
return _workoutPlans.first;
|
||||
}
|
||||
@@ -135,7 +135,7 @@ class WorkoutPlansProvider with ChangeNotifier {
|
||||
Future<void> fetchAndSetAllPlansFull() async {
|
||||
final data = await baseProvider.fetch(
|
||||
baseProvider.makeUrl(
|
||||
_workoutPlansUrlPath,
|
||||
_routinesUrlPath,
|
||||
query: {'ordering': '-creation_date', 'limit': '1000'},
|
||||
),
|
||||
);
|
||||
@@ -150,34 +150,34 @@ class WorkoutPlansProvider with ChangeNotifier {
|
||||
/// object itself and no child attributes
|
||||
Future<void> fetchAndSetAllPlansSparse() async {
|
||||
final data = await baseProvider.fetch(
|
||||
baseProvider.makeUrl(_workoutPlansUrlPath, query: {'limit': '1000'}),
|
||||
baseProvider.makeUrl(_routinesUrlPath, query: {'limit': '1000'}),
|
||||
);
|
||||
_workoutPlans = [];
|
||||
for (final workoutPlanData in data['results']) {
|
||||
final plan = WorkoutPlan.fromJson(workoutPlanData);
|
||||
final plan = Routine.fromJson(workoutPlanData);
|
||||
_workoutPlans.add(plan);
|
||||
}
|
||||
|
||||
_workoutPlans.sort((a, b) => b.creationDate.compareTo(a.creationDate));
|
||||
_workoutPlans.sort((a, b) => b.created.compareTo(a.created));
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
/// Fetches a workout plan sparsely, i.e. only with the data on the plan
|
||||
/// object itself and no child attributes
|
||||
Future<WorkoutPlan> fetchAndSetPlanSparse(int planId) async {
|
||||
Future<Routine> fetchAndSetPlanSparse(int planId) async {
|
||||
final fullPlanData = await baseProvider.fetch(
|
||||
baseProvider.makeUrl(_workoutPlansUrlPath, id: planId),
|
||||
baseProvider.makeUrl(_routinesUrlPath, id: planId),
|
||||
);
|
||||
final plan = WorkoutPlan.fromJson(fullPlanData);
|
||||
final plan = Routine.fromJson(fullPlanData);
|
||||
_workoutPlans.add(plan);
|
||||
_workoutPlans.sort((a, b) => b.creationDate.compareTo(a.creationDate));
|
||||
_workoutPlans.sort((a, b) => b.created.compareTo(a.created));
|
||||
|
||||
notifyListeners();
|
||||
return plan;
|
||||
}
|
||||
|
||||
/// Fetches a workout plan fully, i.e. with all corresponding child attributes
|
||||
Future<WorkoutPlan> fetchAndSetWorkoutPlanFull(int workoutId) async {
|
||||
Future<Routine> fetchAndSetWorkoutPlanFull(int workoutId) async {
|
||||
// Load a list of all settings so that we can search through it
|
||||
//
|
||||
// This is a bit ugly, but saves us sending lots of requests later on
|
||||
@@ -185,7 +185,7 @@ class WorkoutPlansProvider with ChangeNotifier {
|
||||
baseProvider.makeUrl(_settingsUrlPath, query: {'limit': '1000'}),
|
||||
);
|
||||
|
||||
WorkoutPlan plan;
|
||||
Routine plan;
|
||||
try {
|
||||
plan = findById(workoutId);
|
||||
} on StateError {
|
||||
@@ -262,21 +262,21 @@ class WorkoutPlansProvider with ChangeNotifier {
|
||||
return plan;
|
||||
}
|
||||
|
||||
Future<WorkoutPlan> addWorkout(WorkoutPlan workout) async {
|
||||
Future<Routine> addWorkout(Routine workout) async {
|
||||
final data = await baseProvider.post(
|
||||
workout.toJson(),
|
||||
baseProvider.makeUrl(_workoutPlansUrlPath),
|
||||
baseProvider.makeUrl(_routinesUrlPath),
|
||||
);
|
||||
final plan = WorkoutPlan.fromJson(data);
|
||||
final plan = Routine.fromJson(data);
|
||||
_workoutPlans.insert(0, plan);
|
||||
notifyListeners();
|
||||
return plan;
|
||||
}
|
||||
|
||||
Future<void> editWorkout(WorkoutPlan workout) async {
|
||||
Future<void> editWorkout(Routine workout) async {
|
||||
await baseProvider.patch(
|
||||
workout.toJson(),
|
||||
baseProvider.makeUrl(_workoutPlansUrlPath, id: workout.id),
|
||||
baseProvider.makeUrl(_routinesUrlPath, id: workout.id),
|
||||
);
|
||||
notifyListeners();
|
||||
}
|
||||
@@ -287,7 +287,7 @@ class WorkoutPlansProvider with ChangeNotifier {
|
||||
_workoutPlans.removeAt(existingWorkoutIndex);
|
||||
notifyListeners();
|
||||
|
||||
final response = await baseProvider.deleteRequest(_workoutPlansUrlPath, id);
|
||||
final response = await baseProvider.deleteRequest(_routinesUrlPath, id);
|
||||
|
||||
if (response.statusCode >= 400) {
|
||||
_workoutPlans.insert(existingWorkoutIndex, existingWorkout);
|
||||
@@ -297,12 +297,12 @@ class WorkoutPlansProvider with ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> fetchLogData(
|
||||
WorkoutPlan workout,
|
||||
Routine workout,
|
||||
Exercise base,
|
||||
) async {
|
||||
final data = await baseProvider.fetch(
|
||||
baseProvider.makeUrl(
|
||||
_workoutPlansUrlPath,
|
||||
_routinesUrlPath,
|
||||
id: workout.id,
|
||||
objectMethod: 'log_data',
|
||||
query: {'id': base.id.toString()},
|
||||
@@ -365,7 +365,7 @@ class WorkoutPlansProvider with ChangeNotifier {
|
||||
/*
|
||||
* Days
|
||||
*/
|
||||
Future<Day> addDay(Day day, WorkoutPlan workout) async {
|
||||
Future<Day> addDay(Day day, Routine workout) async {
|
||||
/*
|
||||
* Saves a new day instance to the DB and adds it to the given workout
|
||||
*/
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/providers/workout_plans.dart';
|
||||
import 'package:wger/screens/form_screen.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
@@ -39,6 +39,7 @@ enum WorkoutOptions {
|
||||
|
||||
class WorkoutPlanScreen extends StatefulWidget {
|
||||
const WorkoutPlanScreen();
|
||||
|
||||
static const routeName = '/workout-plan-detail';
|
||||
|
||||
@override
|
||||
@@ -54,12 +55,12 @@ class _WorkoutPlanScreenState extends State<WorkoutPlanScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
Future<WorkoutPlan> _loadFullWorkout(BuildContext context, int planId) {
|
||||
Future<Routine> _loadFullWorkout(BuildContext context, int planId) {
|
||||
return Provider.of<WorkoutPlansProvider>(context, listen: false)
|
||||
.fetchAndSetWorkoutPlanFull(planId);
|
||||
}
|
||||
|
||||
Widget getBody(WorkoutPlan plan) {
|
||||
Widget getBody(Routine plan) {
|
||||
switch (_mode) {
|
||||
case WorkoutScreenMode.workout:
|
||||
return WorkoutPlanDetail(plan, _changeMode);
|
||||
@@ -72,7 +73,7 @@ class _WorkoutPlanScreenState extends State<WorkoutPlanScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const appBarForeground = Colors.white;
|
||||
final workoutPlan = ModalRoute.of(context)!.settings.arguments as WorkoutPlan;
|
||||
final workoutPlan = ModalRoute.of(context)!.settings.arguments as Routine;
|
||||
|
||||
return Scaffold(
|
||||
body: CustomScrollView(
|
||||
@@ -130,7 +131,7 @@ class _WorkoutPlanScreenState extends State<WorkoutPlanScreen> {
|
||||
),
|
||||
FutureBuilder(
|
||||
future: _loadFullWorkout(context, workoutPlan.id!),
|
||||
builder: (context, AsyncSnapshot<WorkoutPlan> snapshot) => SliverList(
|
||||
builder: (context, AsyncSnapshot<Routine> snapshot) => SliverList(
|
||||
delegate: SliverChildListDelegate(
|
||||
[
|
||||
if (snapshot.connectionState == ConnectionState.waiting)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/providers/workout_plans.dart';
|
||||
import 'package:wger/screens/form_screen.dart';
|
||||
import 'package:wger/widgets/workouts/app_bar.dart';
|
||||
@@ -28,6 +28,7 @@ import 'package:wger/widgets/workouts/workout_plans_list.dart';
|
||||
|
||||
class WorkoutPlansScreen extends StatelessWidget {
|
||||
const WorkoutPlansScreen();
|
||||
|
||||
static const routeName = '/workout-plans-list';
|
||||
|
||||
@override
|
||||
@@ -41,7 +42,7 @@ class WorkoutPlansScreen extends StatelessWidget {
|
||||
FormScreen.routeName,
|
||||
arguments: FormScreenArguments(
|
||||
AppLocalizations.of(context).newWorkout,
|
||||
WorkoutForm(WorkoutPlan.empty()),
|
||||
WorkoutForm(Routine.empty()),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -24,7 +24,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:wger/models/nutrition/nutritional_plan.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/providers/body_weight.dart';
|
||||
import 'package:wger/providers/measurement.dart';
|
||||
import 'package:wger/providers/nutrition.dart';
|
||||
@@ -371,7 +371,7 @@ class _DashboardWorkoutWidgetState extends State<DashboardWorkoutWidget> {
|
||||
var _showDetail = false;
|
||||
bool _hasContent = false;
|
||||
|
||||
WorkoutPlan? _workoutPlan;
|
||||
Routine? _workoutPlan;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -463,7 +463,7 @@ class _DashboardWorkoutWidgetState extends State<DashboardWorkoutWidget> {
|
||||
subtitle: Text(
|
||||
_hasContent
|
||||
? DateFormat.yMd(Localizations.localeOf(context).languageCode)
|
||||
.format(_workoutPlan!.creationDate)
|
||||
.format(_workoutPlan!.created)
|
||||
: '',
|
||||
),
|
||||
leading: Icon(
|
||||
@@ -491,7 +491,7 @@ class _DashboardWorkoutWidgetState extends State<DashboardWorkoutWidget> {
|
||||
NothingFound(
|
||||
AppLocalizations.of(context).noWorkoutPlans,
|
||||
AppLocalizations.of(context).newWorkout,
|
||||
WorkoutForm(WorkoutPlan.empty()),
|
||||
WorkoutForm(Routine.empty()),
|
||||
),
|
||||
if (_hasContent)
|
||||
Row(
|
||||
|
||||
@@ -24,10 +24,10 @@ import 'package:wger/helpers/consts.dart';
|
||||
import 'package:wger/models/exercises/exercise.dart';
|
||||
import 'package:wger/models/workouts/day.dart';
|
||||
import 'package:wger/models/workouts/repetition_unit.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/models/workouts/set.dart';
|
||||
import 'package:wger/models/workouts/setting.dart';
|
||||
import 'package:wger/models/workouts/weight_unit.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
import 'package:wger/providers/exercises.dart';
|
||||
import 'package:wger/providers/workout_plans.dart';
|
||||
import 'package:wger/screens/add_exercise_screen.dart';
|
||||
@@ -35,7 +35,7 @@ import 'package:wger/screens/workout_plan_screen.dart';
|
||||
import 'package:wger/widgets/exercises/images.dart';
|
||||
|
||||
class WorkoutForm extends StatelessWidget {
|
||||
final WorkoutPlan _plan;
|
||||
final Routine _plan;
|
||||
final _form = GlobalKey<FormState>();
|
||||
|
||||
WorkoutForm(this._plan);
|
||||
@@ -108,7 +108,7 @@ class WorkoutForm extends StatelessWidget {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
} else {
|
||||
final WorkoutPlan newPlan = await Provider.of<WorkoutPlansProvider>(
|
||||
final Routine newPlan = await Provider.of<WorkoutPlansProvider>(
|
||||
context,
|
||||
listen: false,
|
||||
).addWorkout(_plan);
|
||||
@@ -161,7 +161,7 @@ class _DayCheckboxState extends State<DayCheckbox> {
|
||||
}
|
||||
|
||||
class DayFormWidget extends StatefulWidget {
|
||||
final WorkoutPlan workout;
|
||||
final Routine workout;
|
||||
final dayController = TextEditingController();
|
||||
late final Day _day;
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ import 'package:wger/helpers/ui.dart';
|
||||
import 'package:wger/models/exercises/exercise.dart';
|
||||
import 'package:wger/models/workouts/day.dart';
|
||||
import 'package:wger/models/workouts/log.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/models/workouts/session.dart';
|
||||
import 'package:wger/models/workouts/set.dart';
|
||||
import 'package:wger/models/workouts/setting.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
import 'package:wger/providers/exercises.dart';
|
||||
import 'package:wger/providers/workout_plans.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
@@ -223,7 +223,7 @@ class LogPage extends StatefulWidget {
|
||||
final Setting _setting;
|
||||
final Set _set;
|
||||
final Exercise _exerciseBase;
|
||||
final WorkoutPlan _workoutPlan;
|
||||
final Routine _workoutPlan;
|
||||
final double _ratioCompleted;
|
||||
final Map<Exercise, int> _exercisePages;
|
||||
final Log _log = Log.empty();
|
||||
@@ -707,7 +707,7 @@ class ExerciseOverview extends StatelessWidget {
|
||||
}
|
||||
|
||||
class SessionPage extends StatefulWidget {
|
||||
final WorkoutPlan _workoutPlan;
|
||||
final Routine _workoutPlan;
|
||||
final PageController _controller;
|
||||
final TimeOfDay _start;
|
||||
final Map<Exercise, int> _exercisePages;
|
||||
@@ -741,7 +741,7 @@ class _SessionPageState extends State<SessionPage> {
|
||||
|
||||
timeStartController.text = timeToString(widget._start)!;
|
||||
timeEndController.text = timeToString(TimeOfDay.now())!;
|
||||
_session.workoutId = widget._workoutPlan.id!;
|
||||
_session.routineId = widget._workoutPlan.id!;
|
||||
_session.impression = DEFAULT_IMPRESSION;
|
||||
_session.date = DateTime.now();
|
||||
}
|
||||
|
||||
@@ -22,14 +22,14 @@ import 'package:table_calendar/table_calendar.dart';
|
||||
import 'package:wger/helpers/consts.dart';
|
||||
import 'package:wger/models/exercises/exercise.dart';
|
||||
import 'package:wger/models/workouts/log.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/models/workouts/session.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
import 'package:wger/screens/workout_plan_screen.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
import 'package:wger/widgets/workouts/log.dart';
|
||||
|
||||
class WorkoutLogs extends StatefulWidget {
|
||||
final WorkoutPlan _workoutPlan;
|
||||
final Routine _workoutPlan;
|
||||
final Function _changeMode;
|
||||
|
||||
const WorkoutLogs(this._workoutPlan, this._changeMode);
|
||||
@@ -101,7 +101,7 @@ class WorkoutLogEvent {
|
||||
}
|
||||
|
||||
class WorkoutLogCalendar extends StatefulWidget {
|
||||
final WorkoutPlan _workoutPlan;
|
||||
final Routine _workoutPlan;
|
||||
|
||||
const WorkoutLogCalendar(this._workoutPlan);
|
||||
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/screens/form_screen.dart';
|
||||
import 'package:wger/screens/workout_plan_screen.dart';
|
||||
import 'package:wger/widgets/workouts/day.dart';
|
||||
import 'package:wger/widgets/workouts/forms.dart';
|
||||
|
||||
class WorkoutPlanDetail extends StatefulWidget {
|
||||
final WorkoutPlan _workoutPlan;
|
||||
final Routine _workoutPlan;
|
||||
final Function _changeMode;
|
||||
|
||||
const WorkoutPlanDetail(this._workoutPlan, this._changeMode);
|
||||
|
||||
@@ -55,7 +55,7 @@ class WorkoutPlansList extends StatelessWidget {
|
||||
subtitle: Text(
|
||||
DateFormat.yMd(
|
||||
Localizations.localeOf(context).languageCode,
|
||||
).format(currentWorkout.creationDate),
|
||||
).format(currentWorkout.created),
|
||||
),
|
||||
trailing: Row(mainAxisSize: MainAxisSize.min, children: [
|
||||
const VerticalDivider(),
|
||||
|
||||
@@ -43,7 +43,7 @@ dependencies:
|
||||
http: ^1.2.2
|
||||
image_picker: ^1.1.0
|
||||
intl: ^0.19.0
|
||||
json_annotation: ^4.8.1
|
||||
json_annotation: ^4.9.0
|
||||
version: ^3.0.2
|
||||
package_info_plus: ^8.0.3
|
||||
provider: ^6.1.2
|
||||
|
||||
@@ -34,8 +34,7 @@ class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeStreamedResponse_1 extends _i1.SmartFake
|
||||
implements _i2.StreamedResponse {
|
||||
class _FakeStreamedResponse_1 extends _i1.SmartFake implements _i2.StreamedResponse {
|
||||
_FakeStreamedResponse_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -255,14 +254,12 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
) as _i3.Future<_i6.Uint8List>);
|
||||
|
||||
@override
|
||||
_i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) =>
|
||||
(super.noSuchMethod(
|
||||
_i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#send,
|
||||
[request],
|
||||
),
|
||||
returnValue:
|
||||
_i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1(
|
||||
returnValue: _i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#send,
|
||||
|
||||
@@ -36,8 +36,7 @@ import 'package:wger/providers/nutrition.dart' as _i17;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
implements _i2.WgerBaseProvider {
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -47,8 +46,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeExerciseDatabase_1 extends _i1.SmartFake
|
||||
implements _i3.ExerciseDatabase {
|
||||
class _FakeExerciseDatabase_1 extends _i1.SmartFake implements _i3.ExerciseDatabase {
|
||||
_FakeExerciseDatabase_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -68,8 +66,7 @@ class _FakeExercise_2 extends _i1.SmartFake implements _i4.Exercise {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeExerciseCategory_3 extends _i1.SmartFake
|
||||
implements _i5.ExerciseCategory {
|
||||
class _FakeExerciseCategory_3 extends _i1.SmartFake implements _i5.ExerciseCategory {
|
||||
_FakeExerciseCategory_3(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -109,8 +106,7 @@ class _FakeLanguage_6 extends _i1.SmartFake implements _i8.Language {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeIngredientDatabase_7 extends _i1.SmartFake
|
||||
implements _i9.IngredientDatabase {
|
||||
class _FakeIngredientDatabase_7 extends _i1.SmartFake implements _i9.IngredientDatabase {
|
||||
_FakeIngredientDatabase_7(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -120,8 +116,7 @@ class _FakeIngredientDatabase_7 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeNutritionalPlan_8 extends _i1.SmartFake
|
||||
implements _i10.NutritionalPlan {
|
||||
class _FakeNutritionalPlan_8 extends _i1.SmartFake implements _i10.NutritionalPlan {
|
||||
_FakeNutritionalPlan_8(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -218,8 +213,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
|
||||
) as List<_i4.Exercise>);
|
||||
|
||||
@override
|
||||
set filteredExercises(List<_i4.Exercise>? newFilteredExercises) =>
|
||||
super.noSuchMethod(
|
||||
set filteredExercises(List<_i4.Exercise>? newFilteredExercises) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#filteredExercises,
|
||||
newFilteredExercises,
|
||||
@@ -228,8 +222,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<int, List<_i4.Exercise>> get exerciseBasesByVariation =>
|
||||
(super.noSuchMethod(
|
||||
Map<int, List<_i4.Exercise>> get exerciseBasesByVariation => (super.noSuchMethod(
|
||||
Invocation.getter(#exerciseBasesByVariation),
|
||||
returnValue: <int, List<_i4.Exercise>>{},
|
||||
) as Map<int, List<_i4.Exercise>>);
|
||||
@@ -441,8 +434,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
|
||||
) as _i15.Future<void>);
|
||||
|
||||
@override
|
||||
_i15.Future<_i4.Exercise> fetchAndSetExercise(int? exerciseId) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<_i4.Exercise> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetExercise,
|
||||
[exerciseId],
|
||||
@@ -482,8 +474,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
|
||||
) as _i15.Future<_i4.Exercise>);
|
||||
|
||||
@override
|
||||
_i15.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#initCacheTimesLocalPrefs,
|
||||
[],
|
||||
@@ -529,8 +520,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
|
||||
) as _i15.Future<void>);
|
||||
|
||||
@override
|
||||
_i15.Future<void> updateExerciseCache(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<void> updateExerciseCache(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateExerciseCache,
|
||||
[database],
|
||||
@@ -540,8 +530,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
|
||||
) as _i15.Future<void>);
|
||||
|
||||
@override
|
||||
_i15.Future<void> fetchAndSetMuscles(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<void> fetchAndSetMuscles(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetMuscles,
|
||||
[database],
|
||||
@@ -551,8 +540,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
|
||||
) as _i15.Future<void>);
|
||||
|
||||
@override
|
||||
_i15.Future<void> fetchAndSetCategories(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<void> fetchAndSetCategories(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetCategories,
|
||||
[database],
|
||||
@@ -562,8 +550,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
|
||||
) as _i15.Future<void>);
|
||||
|
||||
@override
|
||||
_i15.Future<void> fetchAndSetLanguages(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<void> fetchAndSetLanguages(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLanguages,
|
||||
[database],
|
||||
@@ -573,8 +560,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
|
||||
) as _i15.Future<void>);
|
||||
|
||||
@override
|
||||
_i15.Future<void> fetchAndSetEquipments(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<void> fetchAndSetEquipments(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetEquipments,
|
||||
[database],
|
||||
@@ -641,8 +627,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
|
||||
/// A class which mocks [NutritionPlansProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockNutritionPlansProvider extends _i1.Mock
|
||||
implements _i17.NutritionPlansProvider {
|
||||
class MockNutritionPlansProvider extends _i1.Mock implements _i17.NutritionPlansProvider {
|
||||
MockNutritionPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -752,14 +737,12 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i15.Future<void>);
|
||||
|
||||
@override
|
||||
_i15.Future<_i10.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<_i10.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
returnValue:
|
||||
_i15.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
|
||||
returnValue: _i15.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
@@ -769,14 +752,12 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i15.Future<_i10.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i15.Future<_i10.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<_i10.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
[planId],
|
||||
),
|
||||
returnValue:
|
||||
_i15.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
|
||||
returnValue: _i15.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
@@ -786,14 +767,12 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i15.Future<_i10.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i15.Future<_i10.NutritionalPlan> addPlan(_i10.NutritionalPlan? planData) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<_i10.NutritionalPlan> addPlan(_i10.NutritionalPlan? planData) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
[planData],
|
||||
),
|
||||
returnValue:
|
||||
_i15.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
|
||||
returnValue: _i15.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
@@ -898,8 +877,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i15.Future<_i12.MealItem>);
|
||||
|
||||
@override
|
||||
_i15.Future<void> deleteMealItem(_i12.MealItem? mealItem) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<void> deleteMealItem(_i12.MealItem? mealItem) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteMealItem,
|
||||
[mealItem],
|
||||
@@ -969,8 +947,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i15.Future<List<_i18.IngredientApiSearchEntry>>);
|
||||
|
||||
@override
|
||||
_i15.Future<_i13.Ingredient?> searchIngredientWithCode(String? code) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<_i13.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchIngredientWithCode,
|
||||
[code],
|
||||
@@ -1025,8 +1002,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i15.Future<void>);
|
||||
|
||||
@override
|
||||
_i15.Future<void> fetchAndSetLogs(_i10.NutritionalPlan? plan) =>
|
||||
(super.noSuchMethod(
|
||||
_i15.Future<void> fetchAndSetLogs(_i10.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLogs,
|
||||
[plan],
|
||||
|
||||
@@ -34,8 +34,7 @@ import 'package:wger/providers/user.dart' as _i15;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
implements _i2.WgerBaseProvider {
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -88,8 +87,7 @@ class _FakeAlias_4 extends _i1.SmartFake implements _i6.Alias {
|
||||
/// A class which mocks [AddExerciseProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockAddExerciseProvider extends _i1.Mock
|
||||
implements _i7.AddExerciseProvider {
|
||||
class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvider {
|
||||
MockAddExerciseProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -378,8 +376,7 @@ class MockAddExerciseProvider extends _i1.Mock
|
||||
) as _i13.Future<void>);
|
||||
|
||||
@override
|
||||
_i13.Future<_i4.Translation> addExerciseTranslation(
|
||||
_i4.Translation? exercise) =>
|
||||
_i13.Future<_i4.Translation> addExerciseTranslation(_i4.Translation? exercise) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addExerciseTranslation,
|
||||
|
||||
@@ -195,8 +195,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
) as _i6.Future<void>);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -242,8 +241,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue:
|
||||
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i6.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -268,8 +266,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i6.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -285,8 +282,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i6.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
|
||||
@@ -195,8 +195,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
) as _i6.Future<void>);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -242,8 +241,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue:
|
||||
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i6.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -268,8 +266,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i6.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -285,8 +282,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i6.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
|
||||
@@ -25,8 +25,7 @@ import 'package:wger/providers/measurement.dart' as _i4;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
implements _i2.WgerBaseProvider {
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -36,8 +35,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMeasurementCategory_1 extends _i1.SmartFake
|
||||
implements _i3.MeasurementCategory {
|
||||
class _FakeMeasurementCategory_1 extends _i1.SmartFake implements _i3.MeasurementCategory {
|
||||
_FakeMeasurementCategory_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -50,8 +48,7 @@ class _FakeMeasurementCategory_1 extends _i1.SmartFake
|
||||
/// A class which mocks [MeasurementProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockMeasurementProvider extends _i1.Mock
|
||||
implements _i4.MeasurementProvider {
|
||||
class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvider {
|
||||
MockMeasurementProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -132,8 +129,7 @@ class MockMeasurementProvider extends _i1.Mock
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> addCategory(_i3.MeasurementCategory? category) =>
|
||||
(super.noSuchMethod(
|
||||
_i5.Future<void> addCategory(_i3.MeasurementCategory? category) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addCategory,
|
||||
[category],
|
||||
|
||||
@@ -108,8 +108,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -155,8 +154,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -181,8 +179,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -198,8 +195,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
|
||||
@@ -29,8 +29,7 @@ import 'package:wger/providers/nutrition.dart' as _i8;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
implements _i2.WgerBaseProvider {
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -40,8 +39,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeIngredientDatabase_1 extends _i1.SmartFake
|
||||
implements _i3.IngredientDatabase {
|
||||
class _FakeIngredientDatabase_1 extends _i1.SmartFake implements _i3.IngredientDatabase {
|
||||
_FakeIngredientDatabase_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -51,8 +49,7 @@ class _FakeIngredientDatabase_1 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeNutritionalPlan_2 extends _i1.SmartFake
|
||||
implements _i4.NutritionalPlan {
|
||||
class _FakeNutritionalPlan_2 extends _i1.SmartFake implements _i4.NutritionalPlan {
|
||||
_FakeNutritionalPlan_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -95,8 +92,7 @@ class _FakeIngredient_5 extends _i1.SmartFake implements _i7.Ingredient {
|
||||
/// A class which mocks [NutritionPlansProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockNutritionPlansProvider extends _i1.Mock
|
||||
implements _i8.NutritionPlansProvider {
|
||||
class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansProvider {
|
||||
MockNutritionPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -206,14 +202,12 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
returnValue:
|
||||
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
@@ -223,14 +217,12 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
[planId],
|
||||
),
|
||||
returnValue:
|
||||
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
@@ -240,14 +232,12 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) =>
|
||||
(super.noSuchMethod(
|
||||
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
[planData],
|
||||
),
|
||||
returnValue:
|
||||
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
@@ -352,8 +342,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i9.Future<_i6.MealItem>);
|
||||
|
||||
@override
|
||||
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) =>
|
||||
(super.noSuchMethod(
|
||||
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteMealItem,
|
||||
[mealItem],
|
||||
@@ -423,8 +412,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i9.Future<List<_i10.IngredientApiSearchEntry>>);
|
||||
|
||||
@override
|
||||
_i9.Future<_i7.Ingredient?> searchIngredientWithCode(String? code) =>
|
||||
(super.noSuchMethod(
|
||||
_i9.Future<_i7.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchIngredientWithCode,
|
||||
[code],
|
||||
@@ -479,8 +467,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) =>
|
||||
(super.noSuchMethod(
|
||||
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLogs,
|
||||
[plan],
|
||||
|
||||
@@ -29,8 +29,7 @@ import 'package:wger/providers/nutrition.dart' as _i8;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
implements _i2.WgerBaseProvider {
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -40,8 +39,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeIngredientDatabase_1 extends _i1.SmartFake
|
||||
implements _i3.IngredientDatabase {
|
||||
class _FakeIngredientDatabase_1 extends _i1.SmartFake implements _i3.IngredientDatabase {
|
||||
_FakeIngredientDatabase_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -51,8 +49,7 @@ class _FakeIngredientDatabase_1 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeNutritionalPlan_2 extends _i1.SmartFake
|
||||
implements _i4.NutritionalPlan {
|
||||
class _FakeNutritionalPlan_2 extends _i1.SmartFake implements _i4.NutritionalPlan {
|
||||
_FakeNutritionalPlan_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -95,8 +92,7 @@ class _FakeIngredient_5 extends _i1.SmartFake implements _i7.Ingredient {
|
||||
/// A class which mocks [NutritionPlansProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockNutritionPlansProvider extends _i1.Mock
|
||||
implements _i8.NutritionPlansProvider {
|
||||
class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansProvider {
|
||||
MockNutritionPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -206,14 +202,12 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
returnValue:
|
||||
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
@@ -223,14 +217,12 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
[planId],
|
||||
),
|
||||
returnValue:
|
||||
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
@@ -240,14 +232,12 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) =>
|
||||
(super.noSuchMethod(
|
||||
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
[planData],
|
||||
),
|
||||
returnValue:
|
||||
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
@@ -352,8 +342,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i9.Future<_i6.MealItem>);
|
||||
|
||||
@override
|
||||
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) =>
|
||||
(super.noSuchMethod(
|
||||
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteMealItem,
|
||||
[mealItem],
|
||||
@@ -423,8 +412,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i9.Future<List<_i10.IngredientApiSearchEntry>>);
|
||||
|
||||
@override
|
||||
_i9.Future<_i7.Ingredient?> searchIngredientWithCode(String? code) =>
|
||||
(super.noSuchMethod(
|
||||
_i9.Future<_i7.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchIngredientWithCode,
|
||||
[code],
|
||||
@@ -479,8 +467,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) =>
|
||||
(super.noSuchMethod(
|
||||
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLogs,
|
||||
[plan],
|
||||
|
||||
@@ -68,8 +68,7 @@ class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeStreamedResponse_4 extends _i1.SmartFake
|
||||
implements _i3.StreamedResponse {
|
||||
class _FakeStreamedResponse_4 extends _i1.SmartFake implements _i3.StreamedResponse {
|
||||
_FakeStreamedResponse_4(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -124,8 +123,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -171,8 +169,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -197,8 +194,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -214,8 +210,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -280,8 +275,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
set applicationVersion(_i6.PackageInfo? _applicationVersion) =>
|
||||
super.noSuchMethod(
|
||||
set applicationVersion(_i6.PackageInfo? _applicationVersion) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#applicationVersion,
|
||||
_applicationVersion,
|
||||
@@ -415,8 +409,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
#locale: locale,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, _i2.LoginActions>>.value(
|
||||
<String, _i2.LoginActions>{}),
|
||||
returnValue: _i5.Future<Map<String, _i2.LoginActions>>.value(<String, _i2.LoginActions>{}),
|
||||
) as _i5.Future<Map<String, _i2.LoginActions>>);
|
||||
|
||||
@override
|
||||
@@ -434,8 +427,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
serverUrl,
|
||||
],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, _i2.LoginActions>>.value(
|
||||
<String, _i2.LoginActions>{}),
|
||||
returnValue: _i5.Future<Map<String, _i2.LoginActions>>.value(<String, _i2.LoginActions>{}),
|
||||
) as _i5.Future<Map<String, _i2.LoginActions>>);
|
||||
|
||||
@override
|
||||
@@ -735,14 +727,12 @@ class MockClient extends _i1.Mock implements _i3.Client {
|
||||
) as _i5.Future<_i10.Uint8List>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.StreamedResponse> send(_i3.BaseRequest? request) =>
|
||||
(super.noSuchMethod(
|
||||
_i5.Future<_i3.StreamedResponse> send(_i3.BaseRequest? request) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#send,
|
||||
[request],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_4(
|
||||
returnValue: _i5.Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_4(
|
||||
this,
|
||||
Invocation.method(
|
||||
#send,
|
||||
|
||||
@@ -68,8 +68,7 @@ class _FakeResponse_3 extends _i1.SmartFake implements _i2.Response {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeStreamedResponse_4 extends _i1.SmartFake
|
||||
implements _i2.StreamedResponse {
|
||||
class _FakeStreamedResponse_4 extends _i1.SmartFake implements _i2.StreamedResponse {
|
||||
_FakeStreamedResponse_4(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -115,8 +114,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
set applicationVersion(_i4.PackageInfo? _applicationVersion) =>
|
||||
super.noSuchMethod(
|
||||
set applicationVersion(_i4.PackageInfo? _applicationVersion) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#applicationVersion,
|
||||
_applicationVersion,
|
||||
@@ -250,8 +248,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
#locale: locale,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, _i3.LoginActions>>.value(
|
||||
<String, _i3.LoginActions>{}),
|
||||
returnValue: _i5.Future<Map<String, _i3.LoginActions>>.value(<String, _i3.LoginActions>{}),
|
||||
) as _i5.Future<Map<String, _i3.LoginActions>>);
|
||||
|
||||
@override
|
||||
@@ -269,8 +266,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
serverUrl,
|
||||
],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, _i3.LoginActions>>.value(
|
||||
<String, _i3.LoginActions>{}),
|
||||
returnValue: _i5.Future<Map<String, _i3.LoginActions>>.value(<String, _i3.LoginActions>{}),
|
||||
) as _i5.Future<Map<String, _i3.LoginActions>>);
|
||||
|
||||
@override
|
||||
@@ -405,8 +401,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i8.WgerBaseProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -452,8 +447,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i8.WgerBaseProvider {
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -478,8 +472,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i8.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -495,8 +488,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i8.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -735,14 +727,12 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
) as _i5.Future<_i10.Uint8List>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) =>
|
||||
(super.noSuchMethod(
|
||||
_i5.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#send,
|
||||
[request],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_4(
|
||||
returnValue: _i5.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_4(
|
||||
this,
|
||||
Invocation.method(
|
||||
#send,
|
||||
|
||||
@@ -34,8 +34,7 @@ class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeStreamedResponse_1 extends _i1.SmartFake
|
||||
implements _i2.StreamedResponse {
|
||||
class _FakeStreamedResponse_1 extends _i1.SmartFake implements _i2.StreamedResponse {
|
||||
_FakeStreamedResponse_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -255,14 +254,12 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
) as _i3.Future<_i6.Uint8List>);
|
||||
|
||||
@override
|
||||
_i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) =>
|
||||
(super.noSuchMethod(
|
||||
_i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#send,
|
||||
[request],
|
||||
),
|
||||
returnValue:
|
||||
_i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1(
|
||||
returnValue: _i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#send,
|
||||
|
||||
@@ -108,8 +108,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -155,8 +154,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -181,8 +179,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -198,8 +195,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
|
||||
@@ -108,8 +108,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -155,8 +154,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -181,8 +179,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -198,8 +195,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
|
||||
@@ -26,8 +26,7 @@ import 'package:wger/providers/user.dart' as _i7;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
implements _i2.WgerBaseProvider {
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -50,8 +49,7 @@ class _FakeWeightEntry_1 extends _i1.SmartFake implements _i3.WeightEntry {
|
||||
/// A class which mocks [BodyWeightProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockBodyWeightProvider extends _i1.Mock
|
||||
implements _i4.BodyWeightProvider {
|
||||
class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider {
|
||||
MockBodyWeightProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -111,8 +109,7 @@ class MockBodyWeightProvider extends _i1.Mock
|
||||
) as _i3.WeightEntry);
|
||||
|
||||
@override
|
||||
_i3.WeightEntry? findByDate(DateTime? date) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
_i3.WeightEntry? findByDate(DateTime? date) => (super.noSuchMethod(Invocation.method(
|
||||
#findByDate,
|
||||
[date],
|
||||
)) as _i3.WeightEntry?);
|
||||
@@ -123,13 +120,11 @@ class MockBodyWeightProvider extends _i1.Mock
|
||||
#fetchAndSetEntries,
|
||||
[],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<List<_i3.WeightEntry>>.value(<_i3.WeightEntry>[]),
|
||||
returnValue: _i5.Future<List<_i3.WeightEntry>>.value(<_i3.WeightEntry>[]),
|
||||
) as _i5.Future<List<_i3.WeightEntry>>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) =>
|
||||
(super.noSuchMethod(
|
||||
_i5.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addEntry,
|
||||
[entry],
|
||||
|
||||
@@ -31,7 +31,7 @@ import 'package:wger/widgets/workouts/forms.dart';
|
||||
import 'package:wger/widgets/workouts/gym_mode.dart';
|
||||
|
||||
import '../../test_data/exercises.dart';
|
||||
import '../../test_data/workouts.dart';
|
||||
import '../../test_data/routines.dart';
|
||||
import 'gym_mode_screen_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([WgerBaseProvider, ExercisesProvider])
|
||||
|
||||
@@ -71,8 +71,7 @@ class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeWgerBaseProvider_4 extends _i1.SmartFake
|
||||
implements _i4.WgerBaseProvider {
|
||||
class _FakeWgerBaseProvider_4 extends _i1.SmartFake implements _i4.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_4(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -82,8 +81,7 @@ class _FakeWgerBaseProvider_4 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeExerciseDatabase_5 extends _i1.SmartFake
|
||||
implements _i5.ExerciseDatabase {
|
||||
class _FakeExerciseDatabase_5 extends _i1.SmartFake implements _i5.ExerciseDatabase {
|
||||
_FakeExerciseDatabase_5(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -103,8 +101,7 @@ class _FakeExercise_6 extends _i1.SmartFake implements _i6.Exercise {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeExerciseCategory_7 extends _i1.SmartFake
|
||||
implements _i7.ExerciseCategory {
|
||||
class _FakeExerciseCategory_7 extends _i1.SmartFake implements _i7.ExerciseCategory {
|
||||
_FakeExerciseCategory_7(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -189,8 +186,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -236,8 +232,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue:
|
||||
_i11.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i11.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i11.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -262,8 +257,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i11.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i11.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i11.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -279,8 +273,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i11.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i11.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i11.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -366,8 +359,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
|
||||
) as List<_i6.Exercise>);
|
||||
|
||||
@override
|
||||
set filteredExercises(List<_i6.Exercise>? newFilteredExercises) =>
|
||||
super.noSuchMethod(
|
||||
set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#filteredExercises,
|
||||
newFilteredExercises,
|
||||
@@ -376,8 +368,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<int, List<_i6.Exercise>> get exerciseBasesByVariation =>
|
||||
(super.noSuchMethod(
|
||||
Map<int, List<_i6.Exercise>> get exerciseBasesByVariation => (super.noSuchMethod(
|
||||
Invocation.getter(#exerciseBasesByVariation),
|
||||
returnValue: <int, List<_i6.Exercise>>{},
|
||||
) as Map<int, List<_i6.Exercise>>);
|
||||
@@ -589,8 +580,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
|
||||
) as _i11.Future<void>);
|
||||
|
||||
@override
|
||||
_i11.Future<_i6.Exercise> fetchAndSetExercise(int? exerciseId) =>
|
||||
(super.noSuchMethod(
|
||||
_i11.Future<_i6.Exercise> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetExercise,
|
||||
[exerciseId],
|
||||
@@ -630,8 +620,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
|
||||
) as _i11.Future<_i6.Exercise>);
|
||||
|
||||
@override
|
||||
_i11.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) =>
|
||||
(super.noSuchMethod(
|
||||
_i11.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#initCacheTimesLocalPrefs,
|
||||
[],
|
||||
@@ -677,8 +666,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
|
||||
) as _i11.Future<void>);
|
||||
|
||||
@override
|
||||
_i11.Future<void> updateExerciseCache(_i5.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i11.Future<void> updateExerciseCache(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateExerciseCache,
|
||||
[database],
|
||||
@@ -688,8 +676,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
|
||||
) as _i11.Future<void>);
|
||||
|
||||
@override
|
||||
_i11.Future<void> fetchAndSetMuscles(_i5.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i11.Future<void> fetchAndSetMuscles(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetMuscles,
|
||||
[database],
|
||||
@@ -699,8 +686,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
|
||||
) as _i11.Future<void>);
|
||||
|
||||
@override
|
||||
_i11.Future<void> fetchAndSetCategories(_i5.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i11.Future<void> fetchAndSetCategories(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetCategories,
|
||||
[database],
|
||||
@@ -710,8 +696,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
|
||||
) as _i11.Future<void>);
|
||||
|
||||
@override
|
||||
_i11.Future<void> fetchAndSetLanguages(_i5.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i11.Future<void> fetchAndSetLanguages(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLanguages,
|
||||
[database],
|
||||
@@ -721,8 +706,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
|
||||
) as _i11.Future<void>);
|
||||
|
||||
@override
|
||||
_i11.Future<void> fetchAndSetEquipments(_i5.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i11.Future<void> fetchAndSetEquipments(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetEquipments,
|
||||
[database],
|
||||
|
||||
@@ -13,11 +13,11 @@ import 'package:wger/models/exercises/translation.dart' as _i14;
|
||||
import 'package:wger/models/workouts/day.dart' as _i6;
|
||||
import 'package:wger/models/workouts/log.dart' as _i10;
|
||||
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 _i9;
|
||||
import 'package:wger/models/workouts/set.dart' as _i7;
|
||||
import 'package:wger/models/workouts/setting.dart' as _i8;
|
||||
import 'package:wger/models/workouts/weight_unit.dart' as _i3;
|
||||
import 'package:wger/models/workouts/workout_plan.dart' as _i5;
|
||||
import 'package:wger/providers/base_provider.dart' as _i2;
|
||||
import 'package:wger/providers/workout_plans.dart' as _i11;
|
||||
|
||||
@@ -34,8 +34,7 @@ import 'package:wger/providers/workout_plans.dart' as _i11;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
implements _i2.WgerBaseProvider {
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -55,8 +54,7 @@ class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeRepetitionUnit_2 extends _i1.SmartFake
|
||||
implements _i4.RepetitionUnit {
|
||||
class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit {
|
||||
_FakeRepetitionUnit_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -66,8 +64,8 @@ class _FakeRepetitionUnit_2 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeWorkoutPlan_3 extends _i1.SmartFake implements _i5.WorkoutPlan {
|
||||
_FakeWorkoutPlan_3(
|
||||
class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine {
|
||||
_FakeRoutine_3(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -106,8 +104,7 @@ class _FakeSetting_6 extends _i1.SmartFake implements _i8.Setting {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeWorkoutSession_7 extends _i1.SmartFake
|
||||
implements _i9.WorkoutSession {
|
||||
class _FakeWorkoutSession_7 extends _i1.SmartFake implements _i9.WorkoutSession {
|
||||
_FakeWorkoutSession_7(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -130,8 +127,7 @@ class _FakeLog_8 extends _i1.SmartFake implements _i10.Log {
|
||||
/// A class which mocks [WorkoutPlansProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockWorkoutPlansProvider extends _i1.Mock
|
||||
implements _i11.WorkoutPlansProvider {
|
||||
class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProvider {
|
||||
MockWorkoutPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -146,10 +142,10 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i5.WorkoutPlan> get items => (super.noSuchMethod(
|
||||
List<_i5.Routine> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i5.WorkoutPlan>[],
|
||||
) as List<_i5.WorkoutPlan>);
|
||||
returnValue: <_i5.Routine>[],
|
||||
) as List<_i5.Routine>);
|
||||
|
||||
@override
|
||||
List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod(
|
||||
@@ -197,28 +193,28 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i5.WorkoutPlan> getPlans() => (super.noSuchMethod(
|
||||
List<_i5.Routine> getPlans() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getPlans,
|
||||
[],
|
||||
),
|
||||
returnValue: <_i5.WorkoutPlan>[],
|
||||
) as List<_i5.WorkoutPlan>);
|
||||
returnValue: <_i5.Routine>[],
|
||||
) as List<_i5.Routine>);
|
||||
|
||||
@override
|
||||
_i5.WorkoutPlan findById(int? id) => (super.noSuchMethod(
|
||||
_i5.Routine findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _FakeWorkoutPlan_3(
|
||||
returnValue: _FakeRoutine_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
),
|
||||
) as _i5.WorkoutPlan);
|
||||
) as _i5.Routine);
|
||||
|
||||
@override
|
||||
int findIndexById(int? id) => (super.noSuchMethod(
|
||||
@@ -268,56 +264,52 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i5.Routine> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
returnValue: _i12.Future<_i5.WorkoutPlan>.value(_FakeWorkoutPlan_3(
|
||||
returnValue: _i12.Future<_i5.Routine>.value(_FakeRoutine_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i5.WorkoutPlan>);
|
||||
) as _i12.Future<_i5.Routine>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i5.Routine> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetWorkoutPlanFull,
|
||||
[workoutId],
|
||||
),
|
||||
returnValue: _i12.Future<_i5.WorkoutPlan>.value(_FakeWorkoutPlan_3(
|
||||
returnValue: _i12.Future<_i5.Routine>.value(_FakeRoutine_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetWorkoutPlanFull,
|
||||
[workoutId],
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i5.WorkoutPlan>);
|
||||
) as _i12.Future<_i5.Routine>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i5.Routine> addWorkout(_i5.Routine? workout) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addWorkout,
|
||||
[workout],
|
||||
),
|
||||
returnValue: _i12.Future<_i5.WorkoutPlan>.value(_FakeWorkoutPlan_3(
|
||||
returnValue: _i12.Future<_i5.Routine>.value(_FakeRoutine_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addWorkout,
|
||||
[workout],
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i5.WorkoutPlan>);
|
||||
) as _i12.Future<_i5.Routine>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> editWorkout(_i5.WorkoutPlan? workout) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<void> editWorkout(_i5.Routine? workout) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#editWorkout,
|
||||
[workout],
|
||||
@@ -338,7 +330,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
|
||||
@override
|
||||
_i12.Future<Map<String, dynamic>> fetchLogData(
|
||||
_i5.WorkoutPlan? workout,
|
||||
_i5.Routine? workout,
|
||||
_i13.Exercise? base,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
@@ -349,8 +341,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
base,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i12.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i12.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i12.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -386,7 +377,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
@override
|
||||
_i12.Future<_i6.Day> addDay(
|
||||
_i6.Day? day,
|
||||
_i5.WorkoutPlan? workout,
|
||||
_i5.Routine? workout,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -470,8 +461,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i12.Future<List<_i7.Set>>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchComputedSettings(_i7.Set? workoutSet) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<void> fetchComputedSettings(_i7.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchComputedSettings,
|
||||
[workoutSet],
|
||||
@@ -516,8 +506,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addSetting,
|
||||
[workoutSetting],
|
||||
@@ -541,14 +530,12 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i12.Future<dynamic>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addSession,
|
||||
[session],
|
||||
),
|
||||
returnValue:
|
||||
_i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7(
|
||||
returnValue: _i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addSession,
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import '../../test_data/workouts.dart';
|
||||
import '../../test_data/routines.dart';
|
||||
|
||||
void main() {
|
||||
group('Test the getSmartTextRepr method for a set', () {
|
||||
|
||||
@@ -24,8 +24,7 @@ import 'package:wger/providers/body_weight.dart' as _i4;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
implements _i2.WgerBaseProvider {
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -48,8 +47,7 @@ class _FakeWeightEntry_1 extends _i1.SmartFake implements _i3.WeightEntry {
|
||||
/// A class which mocks [BodyWeightProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockBodyWeightProvider extends _i1.Mock
|
||||
implements _i4.BodyWeightProvider {
|
||||
class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider {
|
||||
MockBodyWeightProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -109,8 +107,7 @@ class MockBodyWeightProvider extends _i1.Mock
|
||||
) as _i3.WeightEntry);
|
||||
|
||||
@override
|
||||
_i3.WeightEntry? findByDate(DateTime? date) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
_i3.WeightEntry? findByDate(DateTime? date) => (super.noSuchMethod(Invocation.method(
|
||||
#findByDate,
|
||||
[date],
|
||||
)) as _i3.WeightEntry?);
|
||||
@@ -121,13 +118,11 @@ class MockBodyWeightProvider extends _i1.Mock
|
||||
#fetchAndSetEntries,
|
||||
[],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<List<_i3.WeightEntry>>.value(<_i3.WeightEntry>[]),
|
||||
returnValue: _i5.Future<List<_i3.WeightEntry>>.value(<_i3.WeightEntry>[]),
|
||||
) as _i5.Future<List<_i3.WeightEntry>>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) =>
|
||||
(super.noSuchMethod(
|
||||
_i5.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addEntry,
|
||||
[entry],
|
||||
|
||||
@@ -24,17 +24,17 @@ import 'package:mockito/mockito.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:wger/helpers/consts.dart';
|
||||
import 'package:wger/models/workouts/day.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/providers/workout_plans.dart';
|
||||
import 'package:wger/widgets/workouts/forms.dart';
|
||||
|
||||
import '../../test_data/workouts.dart';
|
||||
import '../../test_data/routines.dart';
|
||||
import 'workout_day_form_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([WorkoutPlansProvider])
|
||||
void main() {
|
||||
var mockWorkoutPlans = MockWorkoutPlansProvider();
|
||||
WorkoutPlan workoutPlan = WorkoutPlan.empty();
|
||||
Routine workoutPlan = Routine.empty();
|
||||
|
||||
setUp(() {
|
||||
workoutPlan = getWorkout();
|
||||
|
||||
@@ -13,11 +13,11 @@ import 'package:wger/models/exercises/translation.dart' as _i14;
|
||||
import 'package:wger/models/workouts/day.dart' as _i6;
|
||||
import 'package:wger/models/workouts/log.dart' as _i10;
|
||||
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 _i9;
|
||||
import 'package:wger/models/workouts/set.dart' as _i7;
|
||||
import 'package:wger/models/workouts/setting.dart' as _i8;
|
||||
import 'package:wger/models/workouts/weight_unit.dart' as _i3;
|
||||
import 'package:wger/models/workouts/workout_plan.dart' as _i5;
|
||||
import 'package:wger/providers/base_provider.dart' as _i2;
|
||||
import 'package:wger/providers/workout_plans.dart' as _i11;
|
||||
|
||||
@@ -34,8 +34,7 @@ import 'package:wger/providers/workout_plans.dart' as _i11;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
implements _i2.WgerBaseProvider {
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -55,8 +54,7 @@ class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeRepetitionUnit_2 extends _i1.SmartFake
|
||||
implements _i4.RepetitionUnit {
|
||||
class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit {
|
||||
_FakeRepetitionUnit_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -66,8 +64,8 @@ class _FakeRepetitionUnit_2 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeWorkoutPlan_3 extends _i1.SmartFake implements _i5.WorkoutPlan {
|
||||
_FakeWorkoutPlan_3(
|
||||
class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine {
|
||||
_FakeRoutine_3(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -106,8 +104,7 @@ class _FakeSetting_6 extends _i1.SmartFake implements _i8.Setting {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeWorkoutSession_7 extends _i1.SmartFake
|
||||
implements _i9.WorkoutSession {
|
||||
class _FakeWorkoutSession_7 extends _i1.SmartFake implements _i9.WorkoutSession {
|
||||
_FakeWorkoutSession_7(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -130,8 +127,7 @@ class _FakeLog_8 extends _i1.SmartFake implements _i10.Log {
|
||||
/// A class which mocks [WorkoutPlansProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockWorkoutPlansProvider extends _i1.Mock
|
||||
implements _i11.WorkoutPlansProvider {
|
||||
class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProvider {
|
||||
MockWorkoutPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -146,10 +142,10 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i5.WorkoutPlan> get items => (super.noSuchMethod(
|
||||
List<_i5.Routine> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i5.WorkoutPlan>[],
|
||||
) as List<_i5.WorkoutPlan>);
|
||||
returnValue: <_i5.Routine>[],
|
||||
) as List<_i5.Routine>);
|
||||
|
||||
@override
|
||||
List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod(
|
||||
@@ -197,28 +193,28 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i5.WorkoutPlan> getPlans() => (super.noSuchMethod(
|
||||
List<_i5.Routine> getPlans() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getPlans,
|
||||
[],
|
||||
),
|
||||
returnValue: <_i5.WorkoutPlan>[],
|
||||
) as List<_i5.WorkoutPlan>);
|
||||
returnValue: <_i5.Routine>[],
|
||||
) as List<_i5.Routine>);
|
||||
|
||||
@override
|
||||
_i5.WorkoutPlan findById(int? id) => (super.noSuchMethod(
|
||||
_i5.Routine findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _FakeWorkoutPlan_3(
|
||||
returnValue: _FakeRoutine_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
),
|
||||
) as _i5.WorkoutPlan);
|
||||
) as _i5.Routine);
|
||||
|
||||
@override
|
||||
int findIndexById(int? id) => (super.noSuchMethod(
|
||||
@@ -268,56 +264,52 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i5.Routine> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
returnValue: _i12.Future<_i5.WorkoutPlan>.value(_FakeWorkoutPlan_3(
|
||||
returnValue: _i12.Future<_i5.Routine>.value(_FakeRoutine_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i5.WorkoutPlan>);
|
||||
) as _i12.Future<_i5.Routine>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i5.Routine> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetWorkoutPlanFull,
|
||||
[workoutId],
|
||||
),
|
||||
returnValue: _i12.Future<_i5.WorkoutPlan>.value(_FakeWorkoutPlan_3(
|
||||
returnValue: _i12.Future<_i5.Routine>.value(_FakeRoutine_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetWorkoutPlanFull,
|
||||
[workoutId],
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i5.WorkoutPlan>);
|
||||
) as _i12.Future<_i5.Routine>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i5.Routine> addWorkout(_i5.Routine? workout) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addWorkout,
|
||||
[workout],
|
||||
),
|
||||
returnValue: _i12.Future<_i5.WorkoutPlan>.value(_FakeWorkoutPlan_3(
|
||||
returnValue: _i12.Future<_i5.Routine>.value(_FakeRoutine_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addWorkout,
|
||||
[workout],
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i5.WorkoutPlan>);
|
||||
) as _i12.Future<_i5.Routine>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> editWorkout(_i5.WorkoutPlan? workout) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<void> editWorkout(_i5.Routine? workout) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#editWorkout,
|
||||
[workout],
|
||||
@@ -338,7 +330,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
|
||||
@override
|
||||
_i12.Future<Map<String, dynamic>> fetchLogData(
|
||||
_i5.WorkoutPlan? workout,
|
||||
_i5.Routine? workout,
|
||||
_i13.Exercise? base,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
@@ -349,8 +341,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
base,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i12.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i12.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i12.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -386,7 +377,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
@override
|
||||
_i12.Future<_i6.Day> addDay(
|
||||
_i6.Day? day,
|
||||
_i5.WorkoutPlan? workout,
|
||||
_i5.Routine? workout,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -470,8 +461,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i12.Future<List<_i7.Set>>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchComputedSettings(_i7.Set? workoutSet) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<void> fetchComputedSettings(_i7.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchComputedSettings,
|
||||
[workoutSet],
|
||||
@@ -516,8 +506,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addSetting,
|
||||
[workoutSetting],
|
||||
@@ -541,14 +530,12 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i12.Future<dynamic>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addSession,
|
||||
[session],
|
||||
),
|
||||
returnValue:
|
||||
_i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7(
|
||||
returnValue: _i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addSession,
|
||||
|
||||
@@ -23,7 +23,7 @@ import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:wger/helpers/consts.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/providers/workout_plans.dart';
|
||||
import 'package:wger/screens/workout_plan_screen.dart';
|
||||
import 'package:wger/widgets/workouts/forms.dart';
|
||||
@@ -34,13 +34,15 @@ import './workout_form_test.mocks.dart';
|
||||
void main() {
|
||||
var mockWorkoutPlans = MockWorkoutPlansProvider();
|
||||
|
||||
final existingPlan = WorkoutPlan(
|
||||
final existingPlan = Routine(
|
||||
id: 1,
|
||||
creationDate: DateTime(2021, 1, 1),
|
||||
created: DateTime(2021, 1, 1),
|
||||
start: DateTime(2024, 11, 1),
|
||||
end: DateTime(2024, 12, 1),
|
||||
name: 'test 1',
|
||||
description: 'description 1',
|
||||
);
|
||||
final newPlan = WorkoutPlan.empty();
|
||||
final newPlan = Routine.empty();
|
||||
|
||||
setUp(() {
|
||||
mockWorkoutPlans = MockWorkoutPlansProvider();
|
||||
@@ -49,7 +51,7 @@ void main() {
|
||||
.thenAnswer((_) => Future.value(existingPlan));
|
||||
});
|
||||
|
||||
Widget createHomeScreen(WorkoutPlan workoutPlan, {locale = 'en'}) {
|
||||
Widget createHomeScreen(Routine workoutPlan, {locale = 'en'}) {
|
||||
final key = GlobalKey<NavigatorState>();
|
||||
|
||||
return ChangeNotifierProvider<WorkoutPlansProvider>(
|
||||
@@ -106,9 +108,11 @@ void main() {
|
||||
});
|
||||
|
||||
testWidgets('Test creating a new workout - only name', (WidgetTester tester) async {
|
||||
final editWorkout = WorkoutPlan(
|
||||
final editWorkout = Routine(
|
||||
id: 2,
|
||||
creationDate: newPlan.creationDate,
|
||||
created: newPlan.created,
|
||||
start: DateTime(2024, 11, 1),
|
||||
end: DateTime(2024, 12, 1),
|
||||
name: 'New cool workout',
|
||||
);
|
||||
|
||||
@@ -130,9 +134,11 @@ void main() {
|
||||
});
|
||||
|
||||
testWidgets('Test creating a new workout - name and description', (WidgetTester tester) async {
|
||||
final editWorkout = WorkoutPlan(
|
||||
final editWorkout = Routine(
|
||||
id: 2,
|
||||
creationDate: newPlan.creationDate,
|
||||
created: newPlan.created,
|
||||
start: DateTime(2024, 11, 1),
|
||||
end: DateTime(2024, 12, 1),
|
||||
name: 'My workout',
|
||||
description: 'Get yuuuge',
|
||||
);
|
||||
|
||||
@@ -13,11 +13,11 @@ import 'package:wger/models/exercises/translation.dart' as _i14;
|
||||
import 'package:wger/models/workouts/day.dart' as _i6;
|
||||
import 'package:wger/models/workouts/log.dart' as _i10;
|
||||
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 _i9;
|
||||
import 'package:wger/models/workouts/set.dart' as _i7;
|
||||
import 'package:wger/models/workouts/setting.dart' as _i8;
|
||||
import 'package:wger/models/workouts/weight_unit.dart' as _i3;
|
||||
import 'package:wger/models/workouts/workout_plan.dart' as _i5;
|
||||
import 'package:wger/providers/base_provider.dart' as _i2;
|
||||
import 'package:wger/providers/workout_plans.dart' as _i11;
|
||||
|
||||
@@ -34,8 +34,7 @@ import 'package:wger/providers/workout_plans.dart' as _i11;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
implements _i2.WgerBaseProvider {
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -55,8 +54,7 @@ class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeRepetitionUnit_2 extends _i1.SmartFake
|
||||
implements _i4.RepetitionUnit {
|
||||
class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit {
|
||||
_FakeRepetitionUnit_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -66,8 +64,8 @@ class _FakeRepetitionUnit_2 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeWorkoutPlan_3 extends _i1.SmartFake implements _i5.WorkoutPlan {
|
||||
_FakeWorkoutPlan_3(
|
||||
class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine {
|
||||
_FakeRoutine_3(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -106,8 +104,7 @@ class _FakeSetting_6 extends _i1.SmartFake implements _i8.Setting {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeWorkoutSession_7 extends _i1.SmartFake
|
||||
implements _i9.WorkoutSession {
|
||||
class _FakeWorkoutSession_7 extends _i1.SmartFake implements _i9.WorkoutSession {
|
||||
_FakeWorkoutSession_7(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -130,8 +127,7 @@ class _FakeLog_8 extends _i1.SmartFake implements _i10.Log {
|
||||
/// A class which mocks [WorkoutPlansProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockWorkoutPlansProvider extends _i1.Mock
|
||||
implements _i11.WorkoutPlansProvider {
|
||||
class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProvider {
|
||||
MockWorkoutPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -146,10 +142,10 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i5.WorkoutPlan> get items => (super.noSuchMethod(
|
||||
List<_i5.Routine> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i5.WorkoutPlan>[],
|
||||
) as List<_i5.WorkoutPlan>);
|
||||
returnValue: <_i5.Routine>[],
|
||||
) as List<_i5.Routine>);
|
||||
|
||||
@override
|
||||
List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod(
|
||||
@@ -197,28 +193,28 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i5.WorkoutPlan> getPlans() => (super.noSuchMethod(
|
||||
List<_i5.Routine> getPlans() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getPlans,
|
||||
[],
|
||||
),
|
||||
returnValue: <_i5.WorkoutPlan>[],
|
||||
) as List<_i5.WorkoutPlan>);
|
||||
returnValue: <_i5.Routine>[],
|
||||
) as List<_i5.Routine>);
|
||||
|
||||
@override
|
||||
_i5.WorkoutPlan findById(int? id) => (super.noSuchMethod(
|
||||
_i5.Routine findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _FakeWorkoutPlan_3(
|
||||
returnValue: _FakeRoutine_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
),
|
||||
) as _i5.WorkoutPlan);
|
||||
) as _i5.Routine);
|
||||
|
||||
@override
|
||||
int findIndexById(int? id) => (super.noSuchMethod(
|
||||
@@ -268,56 +264,52 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i5.Routine> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
returnValue: _i12.Future<_i5.WorkoutPlan>.value(_FakeWorkoutPlan_3(
|
||||
returnValue: _i12.Future<_i5.Routine>.value(_FakeRoutine_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i5.WorkoutPlan>);
|
||||
) as _i12.Future<_i5.Routine>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i5.Routine> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetWorkoutPlanFull,
|
||||
[workoutId],
|
||||
),
|
||||
returnValue: _i12.Future<_i5.WorkoutPlan>.value(_FakeWorkoutPlan_3(
|
||||
returnValue: _i12.Future<_i5.Routine>.value(_FakeRoutine_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetWorkoutPlanFull,
|
||||
[workoutId],
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i5.WorkoutPlan>);
|
||||
) as _i12.Future<_i5.Routine>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i5.Routine> addWorkout(_i5.Routine? workout) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addWorkout,
|
||||
[workout],
|
||||
),
|
||||
returnValue: _i12.Future<_i5.WorkoutPlan>.value(_FakeWorkoutPlan_3(
|
||||
returnValue: _i12.Future<_i5.Routine>.value(_FakeRoutine_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addWorkout,
|
||||
[workout],
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i5.WorkoutPlan>);
|
||||
) as _i12.Future<_i5.Routine>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> editWorkout(_i5.WorkoutPlan? workout) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<void> editWorkout(_i5.Routine? workout) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#editWorkout,
|
||||
[workout],
|
||||
@@ -338,7 +330,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
|
||||
@override
|
||||
_i12.Future<Map<String, dynamic>> fetchLogData(
|
||||
_i5.WorkoutPlan? workout,
|
||||
_i5.Routine? workout,
|
||||
_i13.Exercise? base,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
@@ -349,8 +341,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
base,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i12.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i12.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i12.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -386,7 +377,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
@override
|
||||
_i12.Future<_i6.Day> addDay(
|
||||
_i6.Day? day,
|
||||
_i5.WorkoutPlan? workout,
|
||||
_i5.Routine? workout,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -470,8 +461,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i12.Future<List<_i7.Set>>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchComputedSettings(_i7.Set? workoutSet) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<void> fetchComputedSettings(_i7.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchComputedSettings,
|
||||
[workoutSet],
|
||||
@@ -516,8 +506,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addSetting,
|
||||
[workoutSetting],
|
||||
@@ -541,14 +530,12 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i12.Future<dynamic>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) =>
|
||||
(super.noSuchMethod(
|
||||
_i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addSession,
|
||||
[session],
|
||||
),
|
||||
returnValue:
|
||||
_i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7(
|
||||
returnValue: _i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addSession,
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import '../../test_data/exercises.dart';
|
||||
import '../../test_data/workouts.dart';
|
||||
import '../../test_data/routines.dart';
|
||||
|
||||
void main() {
|
||||
group('model tests', () {
|
||||
|
||||
@@ -28,7 +28,7 @@ import 'package:wger/providers/exercises.dart';
|
||||
import 'package:wger/providers/workout_plans.dart';
|
||||
import 'package:wger/screens/workout_plan_screen.dart';
|
||||
|
||||
import '../../test_data/workouts.dart';
|
||||
import '../../test_data/routines.dart';
|
||||
import 'workout_plan_screen_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([WgerBaseProvider])
|
||||
|
||||
@@ -108,8 +108,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -155,8 +154,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -181,8 +179,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -198,8 +195,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
|
||||
@@ -25,7 +25,7 @@ import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:wger/database/exercises/exercise_database.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/providers/base_provider.dart';
|
||||
import 'package:wger/providers/exercises.dart';
|
||||
import 'package:wger/providers/workout_plans.dart';
|
||||
@@ -62,8 +62,20 @@ void main() {
|
||||
mockBaseProvider,
|
||||
testExercisesProvider,
|
||||
[
|
||||
WorkoutPlan(id: 1, creationDate: DateTime(2021, 01, 01), name: 'test 1'),
|
||||
WorkoutPlan(id: 2, creationDate: DateTime(2021, 02, 12), name: 'test 2'),
|
||||
Routine(
|
||||
id: 1,
|
||||
created: DateTime(2021, 01, 01),
|
||||
start: DateTime(2024, 11, 1),
|
||||
end: DateTime(2024, 12, 1),
|
||||
name: 'test 1',
|
||||
),
|
||||
Routine(
|
||||
id: 2,
|
||||
created: DateTime(2021, 02, 12),
|
||||
start: DateTime(2024, 11, 1),
|
||||
end: DateTime(2024, 12, 1),
|
||||
name: 'test 2',
|
||||
),
|
||||
],
|
||||
),
|
||||
child: MaterialApp(
|
||||
|
||||
@@ -108,8 +108,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -155,8 +154,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -181,8 +179,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -198,8 +195,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
|
||||
@@ -27,8 +27,8 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:wger/core/locator.dart';
|
||||
import 'package:wger/helpers/consts.dart';
|
||||
import 'package:wger/models/workouts/repetition_unit.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/models/workouts/weight_unit.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
import 'package:wger/providers/base_provider.dart';
|
||||
import 'package:wger/providers/exercises.dart';
|
||||
import 'package:wger/providers/workout_plans.dart';
|
||||
@@ -66,7 +66,7 @@ void main() {
|
||||
final plans = provider.getPlans();
|
||||
|
||||
// Check that everything is ok
|
||||
expect(plan, isA<WorkoutPlan>());
|
||||
expect(plan, isA<Routine>());
|
||||
expect(plan.id, 325397);
|
||||
expect(plan.description, 'Test workout abcd');
|
||||
expect(plans.length, 1);
|
||||
|
||||
@@ -108,8 +108,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -155,8 +154,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -181,8 +179,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -198,8 +195,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
|
||||
@@ -32,7 +32,7 @@ import 'package:wger/providers/workout_plans.dart';
|
||||
import 'package:wger/widgets/workouts/forms.dart';
|
||||
|
||||
import '../../test_data/exercises.dart';
|
||||
import '../../test_data/workouts.dart';
|
||||
import '../../test_data/routines.dart';
|
||||
import 'workout_set_form_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([ExercisesProvider, WgerBaseProvider, WorkoutPlansProvider])
|
||||
|
||||
@@ -19,11 +19,11 @@ import 'package:wger/models/exercises/translation.dart' as _i23;
|
||||
import 'package:wger/models/workouts/day.dart' as _i14;
|
||||
import 'package:wger/models/workouts/log.dart' as _i18;
|
||||
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 _i17;
|
||||
import 'package:wger/models/workouts/set.dart' as _i15;
|
||||
import 'package:wger/models/workouts/setting.dart' as _i16;
|
||||
import 'package:wger/models/workouts/weight_unit.dart' as _i11;
|
||||
import 'package:wger/models/workouts/workout_plan.dart' as _i13;
|
||||
import 'package:wger/providers/auth.dart' as _i9;
|
||||
import 'package:wger/providers/base_provider.dart' as _i2;
|
||||
import 'package:wger/providers/exercises.dart' as _i19;
|
||||
@@ -42,8 +42,7 @@ import 'package:wger/providers/workout_plans.dart' as _i22;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
implements _i2.WgerBaseProvider {
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -53,8 +52,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeExerciseDatabase_1 extends _i1.SmartFake
|
||||
implements _i3.ExerciseDatabase {
|
||||
class _FakeExerciseDatabase_1 extends _i1.SmartFake implements _i3.ExerciseDatabase {
|
||||
_FakeExerciseDatabase_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -74,8 +72,7 @@ class _FakeExercise_2 extends _i1.SmartFake implements _i4.Exercise {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeExerciseCategory_3 extends _i1.SmartFake
|
||||
implements _i5.ExerciseCategory {
|
||||
class _FakeExerciseCategory_3 extends _i1.SmartFake implements _i5.ExerciseCategory {
|
||||
_FakeExerciseCategory_3(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -165,8 +162,7 @@ class _FakeWeightUnit_11 extends _i1.SmartFake implements _i11.WeightUnit {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeRepetitionUnit_12 extends _i1.SmartFake
|
||||
implements _i12.RepetitionUnit {
|
||||
class _FakeRepetitionUnit_12 extends _i1.SmartFake implements _i12.RepetitionUnit {
|
||||
_FakeRepetitionUnit_12(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -176,8 +172,8 @@ class _FakeRepetitionUnit_12 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeWorkoutPlan_13 extends _i1.SmartFake implements _i13.WorkoutPlan {
|
||||
_FakeWorkoutPlan_13(
|
||||
class _FakeRoutine_13 extends _i1.SmartFake implements _i13.Routine {
|
||||
_FakeRoutine_13(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -216,8 +212,7 @@ class _FakeSetting_16 extends _i1.SmartFake implements _i16.Setting {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeWorkoutSession_17 extends _i1.SmartFake
|
||||
implements _i17.WorkoutSession {
|
||||
class _FakeWorkoutSession_17 extends _i1.SmartFake implements _i17.WorkoutSession {
|
||||
_FakeWorkoutSession_17(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -294,8 +289,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
|
||||
) as List<_i4.Exercise>);
|
||||
|
||||
@override
|
||||
set filteredExercises(List<_i4.Exercise>? newFilteredExercises) =>
|
||||
super.noSuchMethod(
|
||||
set filteredExercises(List<_i4.Exercise>? newFilteredExercises) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#filteredExercises,
|
||||
newFilteredExercises,
|
||||
@@ -304,8 +298,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<int, List<_i4.Exercise>> get exerciseBasesByVariation =>
|
||||
(super.noSuchMethod(
|
||||
Map<int, List<_i4.Exercise>> get exerciseBasesByVariation => (super.noSuchMethod(
|
||||
Invocation.getter(#exerciseBasesByVariation),
|
||||
returnValue: <int, List<_i4.Exercise>>{},
|
||||
) as Map<int, List<_i4.Exercise>>);
|
||||
@@ -517,8 +510,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
|
||||
) as _i20.Future<void>);
|
||||
|
||||
@override
|
||||
_i20.Future<_i4.Exercise> fetchAndSetExercise(int? exerciseId) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<_i4.Exercise> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetExercise,
|
||||
[exerciseId],
|
||||
@@ -558,8 +550,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
|
||||
) as _i20.Future<_i4.Exercise>);
|
||||
|
||||
@override
|
||||
_i20.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#initCacheTimesLocalPrefs,
|
||||
[],
|
||||
@@ -605,8 +596,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
|
||||
) as _i20.Future<void>);
|
||||
|
||||
@override
|
||||
_i20.Future<void> updateExerciseCache(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<void> updateExerciseCache(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateExerciseCache,
|
||||
[database],
|
||||
@@ -616,8 +606,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
|
||||
) as _i20.Future<void>);
|
||||
|
||||
@override
|
||||
_i20.Future<void> fetchAndSetMuscles(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<void> fetchAndSetMuscles(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetMuscles,
|
||||
[database],
|
||||
@@ -627,8 +616,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
|
||||
) as _i20.Future<void>);
|
||||
|
||||
@override
|
||||
_i20.Future<void> fetchAndSetCategories(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<void> fetchAndSetCategories(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetCategories,
|
||||
[database],
|
||||
@@ -638,8 +626,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
|
||||
) as _i20.Future<void>);
|
||||
|
||||
@override
|
||||
_i20.Future<void> fetchAndSetLanguages(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<void> fetchAndSetLanguages(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLanguages,
|
||||
[database],
|
||||
@@ -649,8 +636,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
|
||||
) as _i20.Future<void>);
|
||||
|
||||
@override
|
||||
_i20.Future<void> fetchAndSetEquipments(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<void> fetchAndSetEquipments(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetEquipments,
|
||||
[database],
|
||||
@@ -759,8 +745,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -806,8 +791,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue:
|
||||
_i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i20.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -832,8 +816,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i20.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -849,8 +832,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i20.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -882,8 +864,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
/// A class which mocks [WorkoutPlansProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockWorkoutPlansProvider extends _i1.Mock
|
||||
implements _i22.WorkoutPlansProvider {
|
||||
class MockWorkoutPlansProvider extends _i1.Mock implements _i22.WorkoutPlansProvider {
|
||||
MockWorkoutPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -898,10 +879,10 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i13.WorkoutPlan> get items => (super.noSuchMethod(
|
||||
List<_i13.Routine> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i13.WorkoutPlan>[],
|
||||
) as List<_i13.WorkoutPlan>);
|
||||
returnValue: <_i13.Routine>[],
|
||||
) as List<_i13.Routine>);
|
||||
|
||||
@override
|
||||
List<_i11.WeightUnit> get weightUnits => (super.noSuchMethod(
|
||||
@@ -949,28 +930,28 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i13.WorkoutPlan> getPlans() => (super.noSuchMethod(
|
||||
List<_i13.Routine> getPlans() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getPlans,
|
||||
[],
|
||||
),
|
||||
returnValue: <_i13.WorkoutPlan>[],
|
||||
) as List<_i13.WorkoutPlan>);
|
||||
returnValue: <_i13.Routine>[],
|
||||
) as List<_i13.Routine>);
|
||||
|
||||
@override
|
||||
_i13.WorkoutPlan findById(int? id) => (super.noSuchMethod(
|
||||
_i13.Routine findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _FakeWorkoutPlan_13(
|
||||
returnValue: _FakeRoutine_13(
|
||||
this,
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
),
|
||||
) as _i13.WorkoutPlan);
|
||||
) as _i13.Routine);
|
||||
|
||||
@override
|
||||
int findIndexById(int? id) => (super.noSuchMethod(
|
||||
@@ -1020,56 +1001,52 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i20.Future<void>);
|
||||
|
||||
@override
|
||||
_i20.Future<_i13.WorkoutPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<_i13.Routine> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
returnValue: _i20.Future<_i13.WorkoutPlan>.value(_FakeWorkoutPlan_13(
|
||||
returnValue: _i20.Future<_i13.Routine>.value(_FakeRoutine_13(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
)),
|
||||
) as _i20.Future<_i13.WorkoutPlan>);
|
||||
) as _i20.Future<_i13.Routine>);
|
||||
|
||||
@override
|
||||
_i20.Future<_i13.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<_i13.Routine> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetWorkoutPlanFull,
|
||||
[workoutId],
|
||||
),
|
||||
returnValue: _i20.Future<_i13.WorkoutPlan>.value(_FakeWorkoutPlan_13(
|
||||
returnValue: _i20.Future<_i13.Routine>.value(_FakeRoutine_13(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetWorkoutPlanFull,
|
||||
[workoutId],
|
||||
),
|
||||
)),
|
||||
) as _i20.Future<_i13.WorkoutPlan>);
|
||||
) as _i20.Future<_i13.Routine>);
|
||||
|
||||
@override
|
||||
_i20.Future<_i13.WorkoutPlan> addWorkout(_i13.WorkoutPlan? workout) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<_i13.Routine> addWorkout(_i13.Routine? workout) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addWorkout,
|
||||
[workout],
|
||||
),
|
||||
returnValue: _i20.Future<_i13.WorkoutPlan>.value(_FakeWorkoutPlan_13(
|
||||
returnValue: _i20.Future<_i13.Routine>.value(_FakeRoutine_13(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addWorkout,
|
||||
[workout],
|
||||
),
|
||||
)),
|
||||
) as _i20.Future<_i13.WorkoutPlan>);
|
||||
) as _i20.Future<_i13.Routine>);
|
||||
|
||||
@override
|
||||
_i20.Future<void> editWorkout(_i13.WorkoutPlan? workout) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<void> editWorkout(_i13.Routine? workout) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#editWorkout,
|
||||
[workout],
|
||||
@@ -1090,7 +1067,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
|
||||
@override
|
||||
_i20.Future<Map<String, dynamic>> fetchLogData(
|
||||
_i13.WorkoutPlan? workout,
|
||||
_i13.Routine? workout,
|
||||
_i4.Exercise? base,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
@@ -1101,8 +1078,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
base,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue: _i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i20.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
@@ -1138,7 +1114,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
@override
|
||||
_i20.Future<_i14.Day> addDay(
|
||||
_i14.Day? day,
|
||||
_i13.WorkoutPlan? workout,
|
||||
_i13.Routine? workout,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -1222,8 +1198,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i20.Future<List<_i15.Set>>);
|
||||
|
||||
@override
|
||||
_i20.Future<void> fetchComputedSettings(_i15.Set? workoutSet) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<void> fetchComputedSettings(_i15.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchComputedSettings,
|
||||
[workoutSet],
|
||||
@@ -1268,8 +1243,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i20.Future<void>);
|
||||
|
||||
@override
|
||||
_i20.Future<_i16.Setting> addSetting(_i16.Setting? workoutSetting) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<_i16.Setting> addSetting(_i16.Setting? workoutSetting) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addSetting,
|
||||
[workoutSetting],
|
||||
@@ -1293,14 +1267,12 @@ class MockWorkoutPlansProvider extends _i1.Mock
|
||||
) as _i20.Future<dynamic>);
|
||||
|
||||
@override
|
||||
_i20.Future<_i17.WorkoutSession> addSession(_i17.WorkoutSession? session) =>
|
||||
(super.noSuchMethod(
|
||||
_i20.Future<_i17.WorkoutSession> addSession(_i17.WorkoutSession? session) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addSession,
|
||||
[session],
|
||||
),
|
||||
returnValue:
|
||||
_i20.Future<_i17.WorkoutSession>.value(_FakeWorkoutSession_17(
|
||||
returnValue: _i20.Future<_i17.WorkoutSession>.value(_FakeWorkoutSession_17(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addSession,
|
||||
|
||||
@@ -20,10 +20,10 @@ import 'package:wger/models/exercises/exercise.dart';
|
||||
import 'package:wger/models/workouts/day.dart';
|
||||
import 'package:wger/models/workouts/log.dart';
|
||||
import 'package:wger/models/workouts/repetition_unit.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/models/workouts/set.dart';
|
||||
import 'package:wger/models/workouts/setting.dart';
|
||||
import 'package:wger/models/workouts/weight_unit.dart';
|
||||
import 'package:wger/models/workouts/workout_plan.dart';
|
||||
|
||||
import './exercises.dart';
|
||||
|
||||
@@ -33,7 +33,7 @@ const weightUnit2 = WeightUnit(id: 2, name: 'metric tonnes');
|
||||
const RepetitionUnit repetitionUnit1 = RepetitionUnit(id: 1, name: 'Repetitions');
|
||||
const RepetitionUnit repetitionUnit2 = RepetitionUnit(id: 2, name: 'Hours');
|
||||
|
||||
WorkoutPlan getWorkout({List<Exercise>? exercises}) {
|
||||
Routine getWorkout({List<Exercise>? exercises}) {
|
||||
final testBases = exercises ?? getTestExercises();
|
||||
|
||||
final log1 = Log.empty()
|
||||
@@ -150,13 +150,15 @@ WorkoutPlan getWorkout({List<Exercise>? exercises}) {
|
||||
..daysOfWeek = [4];
|
||||
dayLegs.sets.add(setSquat);
|
||||
|
||||
final workout = WorkoutPlan(
|
||||
final routine = Routine(
|
||||
id: 1,
|
||||
creationDate: DateTime(2021, 01, 01),
|
||||
created: DateTime(2021, 01, 01),
|
||||
name: '3 day workout',
|
||||
start: DateTime(2024, 11, 01),
|
||||
end: DateTime(2024, 12, 01),
|
||||
days: [dayChestShoulders, dayLegs],
|
||||
logs: [log1, log2, log3],
|
||||
);
|
||||
|
||||
return workout;
|
||||
return routine;
|
||||
}
|
||||
Reference in New Issue
Block a user