diff --git a/integration_test/1_dashboard.dart b/integration_test/1_dashboard.dart index a0084a03..680e2ddd 100644 --- a/integration_test/1_dashboard.dart +++ b/integration_test/1_dashboard.dart @@ -4,8 +4,6 @@ import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/workouts/session.dart'; -import 'package:wger/providers/auth.dart'; -import 'package:wger/providers/base_provider.dart'; import 'package:wger/providers/body_weight_repository.dart'; import 'package:wger/providers/body_weight_riverpod.dart'; import 'package:wger/providers/body_weight_state.dart'; @@ -54,8 +52,7 @@ Widget createDashboardScreen({String locale = 'en'}) { when(mockNutritionProvider.items).thenReturn([getNutritionalPlanScreenshot()]); // Prepare a BodyWeightState (Riverpod) with screenshot entries - final auth = AuthProvider(); - final repo = BodyWeightRepository(WgerBaseProvider(auth)); + final repo = BodyWeightRepository(); final bwState = BodyWeightState(repo); bwState.state = getScreenshotWeightEntries(); diff --git a/integration_test/5_nutritional_plan.dart b/integration_test/5_nutritional_plan.dart index 1b49bb98..6be243e1 100644 --- a/integration_test/5_nutritional_plan.dart +++ b/integration_test/5_nutritional_plan.dart @@ -4,8 +4,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart' as riverpod; import 'package:provider/provider.dart'; import 'package:wger/database/ingredients/ingredients_database.dart'; import 'package:wger/l10n/generated/app_localizations.dart'; -import 'package:wger/providers/auth.dart'; -import 'package:wger/providers/base_provider.dart'; import 'package:wger/providers/body_weight_repository.dart'; import 'package:wger/providers/body_weight_riverpod.dart'; import 'package:wger/providers/body_weight_state.dart'; @@ -29,8 +27,7 @@ Widget createNutritionalPlanScreen({locale = 'en'}) { ); // Riverpod: prepare BodyWeightState with no entries for this test (or mock via mockBaseProvider) - final auth = AuthProvider(); - final repo = BodyWeightRepository(WgerBaseProvider(auth)); + final repo = BodyWeightRepository(); final bwState = BodyWeightState(repo); return riverpod.ProviderScope( diff --git a/integration_test/6_weight.dart b/integration_test/6_weight.dart index fff84708..896ad5af 100644 --- a/integration_test/6_weight.dart +++ b/integration_test/6_weight.dart @@ -3,8 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart' as riverpod; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; import 'package:wger/l10n/generated/app_localizations.dart'; -import 'package:wger/providers/auth.dart'; -import 'package:wger/providers/base_provider.dart'; import 'package:wger/providers/body_weight_repository.dart'; import 'package:wger/providers/body_weight_riverpod.dart'; import 'package:wger/providers/body_weight_state.dart'; @@ -21,8 +19,7 @@ import '../test_data/profile.dart'; Widget createWeightScreen({locale = 'en'}) { // Build a Riverpod override so tests use the new BodyWeightState - final auth = AuthProvider(); - final repo = BodyWeightRepository(WgerBaseProvider(auth)); + final repo = BodyWeightRepository(); final bwState = BodyWeightState(repo); bwState.state = getScreenshotWeightEntries(); diff --git a/lib/database/exercises/exercise_database.g.dart b/lib/database/exercises/exercise_database.g.dart index 0a90da24..9199883a 100644 --- a/lib/database/exercises/exercise_database.g.dart +++ b/lib/database/exercises/exercise_database.g.dart @@ -3,8 +3,7 @@ part of 'exercise_database.dart'; // ignore_for_file: type=lint -class $ExercisesTable extends Exercises - with TableInfo<$ExercisesTable, ExerciseTable> { +class $ExercisesTable extends Exercises with TableInfo<$ExercisesTable, ExerciseTable> { @override final GeneratedDatabase attachedDatabase; final String? _alias; @@ -201,12 +200,8 @@ class ExerciseTable extends DataClass implements Insertable { return ExerciseTable( id: data.id.present ? data.id.value : this.id, data: data.data.present ? data.data.value : this.data, - lastUpdate: data.lastUpdate.present - ? data.lastUpdate.value - : this.lastUpdate, - lastFetched: data.lastFetched.present - ? data.lastFetched.value - : this.lastFetched, + lastUpdate: data.lastUpdate.present ? data.lastUpdate.value : this.lastUpdate, + lastFetched: data.lastFetched.present ? data.lastFetched.value : this.lastFetched, ); } @@ -337,14 +332,13 @@ class $MusclesTable extends Muscles with TableInfo<$MusclesTable, MuscleTable> { requiredDuringInsert: true, ); @override - late final GeneratedColumnWithTypeConverter data = - GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ).withConverter($MusclesTable.$converterdata); + late final GeneratedColumnWithTypeConverter data = GeneratedColumn( + 'data', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ).withConverter($MusclesTable.$converterdata); @override List get $columns => [id, data]; @override @@ -524,8 +518,7 @@ class MusclesCompanion extends UpdateCompanion { } } -class $EquipmentsTable extends Equipments - with TableInfo<$EquipmentsTable, EquipmentTable> { +class $EquipmentsTable extends Equipments with TableInfo<$EquipmentsTable, EquipmentTable> { @override final GeneratedDatabase attachedDatabase; final String? _alias; @@ -540,14 +533,13 @@ class $EquipmentsTable extends Equipments requiredDuringInsert: true, ); @override - late final GeneratedColumnWithTypeConverter data = - GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ).withConverter($EquipmentsTable.$converterdata); + late final GeneratedColumnWithTypeConverter data = GeneratedColumn( + 'data', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ).withConverter($EquipmentsTable.$converterdata); @override List get $columns => [id, data]; @override @@ -594,8 +586,7 @@ class $EquipmentsTable extends Equipments return $EquipmentsTable(attachedDatabase, alias); } - static TypeConverter $converterdata = - const EquipmentConverter(); + static TypeConverter $converterdata = const EquipmentConverter(); } class EquipmentTable extends DataClass implements Insertable { @@ -660,9 +651,7 @@ class EquipmentTable extends DataClass implements Insertable { @override bool operator ==(Object other) => identical(this, other) || - (other is EquipmentTable && - other.id == this.id && - other.data == this.data); + (other is EquipmentTable && other.id == this.id && other.data == this.data); } class EquipmentsCompanion extends UpdateCompanion { @@ -732,8 +721,7 @@ class EquipmentsCompanion extends UpdateCompanion { } } -class $CategoriesTable extends Categories - with TableInfo<$CategoriesTable, CategoryTable> { +class $CategoriesTable extends Categories with TableInfo<$CategoriesTable, CategoryTable> { @override final GeneratedDatabase attachedDatabase; final String? _alias; @@ -802,8 +790,7 @@ class $CategoriesTable extends Categories return $CategoriesTable(attachedDatabase, alias); } - static TypeConverter $converterdata = - const ExerciseCategoryConverter(); + static TypeConverter $converterdata = const ExerciseCategoryConverter(); } class CategoryTable extends DataClass implements Insertable { @@ -868,9 +855,7 @@ class CategoryTable extends DataClass implements Insertable { @override bool operator ==(Object other) => identical(this, other) || - (other is CategoryTable && - other.id == this.id && - other.data == this.data); + (other is CategoryTable && other.id == this.id && other.data == this.data); } class CategoriesCompanion extends UpdateCompanion { @@ -940,8 +925,7 @@ class CategoriesCompanion extends UpdateCompanion { } } -class $LanguagesTable extends Languages - with TableInfo<$LanguagesTable, LanguagesTable> { +class $LanguagesTable extends Languages with TableInfo<$LanguagesTable, LanguagesTable> { @override final GeneratedDatabase attachedDatabase; final String? _alias; @@ -956,14 +940,13 @@ class $LanguagesTable extends Languages requiredDuringInsert: true, ); @override - late final GeneratedColumnWithTypeConverter data = - GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ).withConverter($LanguagesTable.$converterdata); + late final GeneratedColumnWithTypeConverter data = GeneratedColumn( + 'data', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ).withConverter($LanguagesTable.$converterdata); @override List get $columns => [id, data]; @override @@ -1010,8 +993,7 @@ class $LanguagesTable extends Languages return $LanguagesTable(attachedDatabase, alias); } - static TypeConverter $converterdata = - const LanguageConverter(); + static TypeConverter $converterdata = const LanguageConverter(); } class LanguagesTable extends DataClass implements Insertable { @@ -1076,9 +1058,7 @@ class LanguagesTable extends DataClass implements Insertable { @override bool operator ==(Object other) => identical(this, other) || - (other is LanguagesTable && - other.id == this.id && - other.data == this.data); + (other is LanguagesTable && other.id == this.id && other.data == this.data); } class LanguagesCompanion extends UpdateCompanion { @@ -1168,8 +1148,7 @@ abstract class _$ExerciseDatabase extends GeneratedDatabase { languages, ]; @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); + DriftDatabaseOptions get options => const DriftDatabaseOptions(storeDateTimeAsText: true); } typedef $$ExercisesTableCreateCompanionBuilder = @@ -1189,8 +1168,7 @@ typedef $$ExercisesTableUpdateCompanionBuilder = Value rowid, }); -class $$ExercisesTableFilterComposer - extends Composer<_$ExerciseDatabase, $ExercisesTable> { +class $$ExercisesTableFilterComposer extends Composer<_$ExerciseDatabase, $ExercisesTable> { $$ExercisesTableFilterComposer({ required super.$db, required super.$table, @@ -1219,8 +1197,7 @@ class $$ExercisesTableFilterComposer ); } -class $$ExercisesTableOrderingComposer - extends Composer<_$ExerciseDatabase, $ExercisesTable> { +class $$ExercisesTableOrderingComposer extends Composer<_$ExerciseDatabase, $ExercisesTable> { $$ExercisesTableOrderingComposer({ required super.$db, required super.$table, @@ -1249,8 +1226,7 @@ class $$ExercisesTableOrderingComposer ); } -class $$ExercisesTableAnnotationComposer - extends Composer<_$ExerciseDatabase, $ExercisesTable> { +class $$ExercisesTableAnnotationComposer extends Composer<_$ExerciseDatabase, $ExercisesTable> { $$ExercisesTableAnnotationComposer({ required super.$db, required super.$table, @@ -1258,8 +1234,7 @@ class $$ExercisesTableAnnotationComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); + GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get data => $composableBuilder(column: $table.data, builder: (column) => column); @@ -1286,10 +1261,7 @@ class $$ExercisesTableTableManager $$ExercisesTableAnnotationComposer, $$ExercisesTableCreateCompanionBuilder, $$ExercisesTableUpdateCompanionBuilder, - ( - ExerciseTable, - BaseReferences<_$ExerciseDatabase, $ExercisesTable, ExerciseTable>, - ), + (ExerciseTable, BaseReferences<_$ExerciseDatabase, $ExercisesTable, ExerciseTable>), ExerciseTable, PrefetchHooks Function() > { @@ -1298,10 +1270,8 @@ class $$ExercisesTableTableManager TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$ExercisesTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$ExercisesTableOrderingComposer($db: db, $table: table), + createFilteringComposer: () => $$ExercisesTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => $$ExercisesTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$ExercisesTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: @@ -1332,9 +1302,8 @@ class $$ExercisesTableTableManager 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, ), ); @@ -1350,10 +1319,7 @@ typedef $$ExercisesTableProcessedTableManager = $$ExercisesTableAnnotationComposer, $$ExercisesTableCreateCompanionBuilder, $$ExercisesTableUpdateCompanionBuilder, - ( - ExerciseTable, - BaseReferences<_$ExerciseDatabase, $ExercisesTable, ExerciseTable>, - ), + (ExerciseTable, BaseReferences<_$ExerciseDatabase, $ExercisesTable, ExerciseTable>), ExerciseTable, PrefetchHooks Function() >; @@ -1370,8 +1336,7 @@ typedef $$MusclesTableUpdateCompanionBuilder = Value rowid, }); -class $$MusclesTableFilterComposer - extends Composer<_$ExerciseDatabase, $MusclesTable> { +class $$MusclesTableFilterComposer extends Composer<_$ExerciseDatabase, $MusclesTable> { $$MusclesTableFilterComposer({ required super.$db, required super.$table, @@ -1384,15 +1349,13 @@ class $$MusclesTableFilterComposer builder: (column) => ColumnFilters(column), ); - ColumnWithTypeConverterFilters get data => - $composableBuilder( - column: $table.data, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); + ColumnWithTypeConverterFilters get data => $composableBuilder( + column: $table.data, + builder: (column) => ColumnWithTypeConverterFilters(column), + ); } -class $$MusclesTableOrderingComposer - extends Composer<_$ExerciseDatabase, $MusclesTable> { +class $$MusclesTableOrderingComposer extends Composer<_$ExerciseDatabase, $MusclesTable> { $$MusclesTableOrderingComposer({ required super.$db, required super.$table, @@ -1411,8 +1374,7 @@ class $$MusclesTableOrderingComposer ); } -class $$MusclesTableAnnotationComposer - extends Composer<_$ExerciseDatabase, $MusclesTable> { +class $$MusclesTableAnnotationComposer extends Composer<_$ExerciseDatabase, $MusclesTable> { $$MusclesTableAnnotationComposer({ required super.$db, required super.$table, @@ -1420,8 +1382,7 @@ class $$MusclesTableAnnotationComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); + GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumnWithTypeConverter get data => $composableBuilder(column: $table.data, builder: (column) => column); @@ -1438,10 +1399,7 @@ class $$MusclesTableTableManager $$MusclesTableAnnotationComposer, $$MusclesTableCreateCompanionBuilder, $$MusclesTableUpdateCompanionBuilder, - ( - MuscleTable, - BaseReferences<_$ExerciseDatabase, $MusclesTable, MuscleTable>, - ), + (MuscleTable, BaseReferences<_$ExerciseDatabase, $MusclesTable, MuscleTable>), MuscleTable, PrefetchHooks Function() > { @@ -1450,10 +1408,8 @@ class $$MusclesTableTableManager TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$MusclesTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$MusclesTableOrderingComposer($db: db, $table: table), + createFilteringComposer: () => $$MusclesTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => $$MusclesTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$MusclesTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: @@ -1468,9 +1424,8 @@ class $$MusclesTableTableManager required Muscle data, Value rowid = const Value.absent(), }) => MusclesCompanion.insert(id: id, data: data, 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, ), ); @@ -1486,10 +1441,7 @@ typedef $$MusclesTableProcessedTableManager = $$MusclesTableAnnotationComposer, $$MusclesTableCreateCompanionBuilder, $$MusclesTableUpdateCompanionBuilder, - ( - MuscleTable, - BaseReferences<_$ExerciseDatabase, $MusclesTable, MuscleTable>, - ), + (MuscleTable, BaseReferences<_$ExerciseDatabase, $MusclesTable, MuscleTable>), MuscleTable, PrefetchHooks Function() >; @@ -1506,8 +1458,7 @@ typedef $$EquipmentsTableUpdateCompanionBuilder = Value rowid, }); -class $$EquipmentsTableFilterComposer - extends Composer<_$ExerciseDatabase, $EquipmentsTable> { +class $$EquipmentsTableFilterComposer extends Composer<_$ExerciseDatabase, $EquipmentsTable> { $$EquipmentsTableFilterComposer({ required super.$db, required super.$table, @@ -1520,15 +1471,13 @@ class $$EquipmentsTableFilterComposer builder: (column) => ColumnFilters(column), ); - ColumnWithTypeConverterFilters get data => - $composableBuilder( - column: $table.data, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); + ColumnWithTypeConverterFilters get data => $composableBuilder( + column: $table.data, + builder: (column) => ColumnWithTypeConverterFilters(column), + ); } -class $$EquipmentsTableOrderingComposer - extends Composer<_$ExerciseDatabase, $EquipmentsTable> { +class $$EquipmentsTableOrderingComposer extends Composer<_$ExerciseDatabase, $EquipmentsTable> { $$EquipmentsTableOrderingComposer({ required super.$db, required super.$table, @@ -1547,8 +1496,7 @@ class $$EquipmentsTableOrderingComposer ); } -class $$EquipmentsTableAnnotationComposer - extends Composer<_$ExerciseDatabase, $EquipmentsTable> { +class $$EquipmentsTableAnnotationComposer extends Composer<_$ExerciseDatabase, $EquipmentsTable> { $$EquipmentsTableAnnotationComposer({ required super.$db, required super.$table, @@ -1556,8 +1504,7 @@ class $$EquipmentsTableAnnotationComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); + GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumnWithTypeConverter get data => $composableBuilder(column: $table.data, builder: (column) => column); @@ -1574,14 +1521,7 @@ class $$EquipmentsTableTableManager $$EquipmentsTableAnnotationComposer, $$EquipmentsTableCreateCompanionBuilder, $$EquipmentsTableUpdateCompanionBuilder, - ( - EquipmentTable, - BaseReferences< - _$ExerciseDatabase, - $EquipmentsTable, - EquipmentTable - >, - ), + (EquipmentTable, BaseReferences<_$ExerciseDatabase, $EquipmentsTable, EquipmentTable>), EquipmentTable, PrefetchHooks Function() > { @@ -1590,10 +1530,8 @@ class $$EquipmentsTableTableManager TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$EquipmentsTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$EquipmentsTableOrderingComposer($db: db, $table: table), + createFilteringComposer: () => $$EquipmentsTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => $$EquipmentsTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$EquipmentsTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: @@ -1607,11 +1545,9 @@ class $$EquipmentsTableTableManager required int id, required Equipment data, Value rowid = const Value.absent(), - }) => - EquipmentsCompanion.insert(id: id, data: data, rowid: rowid), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), + }) => EquipmentsCompanion.insert(id: id, data: data, rowid: rowid), + withReferenceMapper: (p0) => + p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), prefetchHooksCallback: null, ), ); @@ -1627,10 +1563,7 @@ typedef $$EquipmentsTableProcessedTableManager = $$EquipmentsTableAnnotationComposer, $$EquipmentsTableCreateCompanionBuilder, $$EquipmentsTableUpdateCompanionBuilder, - ( - EquipmentTable, - BaseReferences<_$ExerciseDatabase, $EquipmentsTable, EquipmentTable>, - ), + (EquipmentTable, BaseReferences<_$ExerciseDatabase, $EquipmentsTable, EquipmentTable>), EquipmentTable, PrefetchHooks Function() >; @@ -1647,8 +1580,7 @@ typedef $$CategoriesTableUpdateCompanionBuilder = Value rowid, }); -class $$CategoriesTableFilterComposer - extends Composer<_$ExerciseDatabase, $CategoriesTable> { +class $$CategoriesTableFilterComposer extends Composer<_$ExerciseDatabase, $CategoriesTable> { $$CategoriesTableFilterComposer({ required super.$db, required super.$table, @@ -1661,15 +1593,14 @@ class $$CategoriesTableFilterComposer builder: (column) => ColumnFilters(column), ); - ColumnWithTypeConverterFilters - get data => $composableBuilder( - column: $table.data, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); + ColumnWithTypeConverterFilters get data => + $composableBuilder( + column: $table.data, + builder: (column) => ColumnWithTypeConverterFilters(column), + ); } -class $$CategoriesTableOrderingComposer - extends Composer<_$ExerciseDatabase, $CategoriesTable> { +class $$CategoriesTableOrderingComposer extends Composer<_$ExerciseDatabase, $CategoriesTable> { $$CategoriesTableOrderingComposer({ required super.$db, required super.$table, @@ -1688,8 +1619,7 @@ class $$CategoriesTableOrderingComposer ); } -class $$CategoriesTableAnnotationComposer - extends Composer<_$ExerciseDatabase, $CategoriesTable> { +class $$CategoriesTableAnnotationComposer extends Composer<_$ExerciseDatabase, $CategoriesTable> { $$CategoriesTableAnnotationComposer({ required super.$db, required super.$table, @@ -1697,8 +1627,7 @@ class $$CategoriesTableAnnotationComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); + GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumnWithTypeConverter get data => $composableBuilder(column: $table.data, builder: (column) => column); @@ -1715,10 +1644,7 @@ class $$CategoriesTableTableManager $$CategoriesTableAnnotationComposer, $$CategoriesTableCreateCompanionBuilder, $$CategoriesTableUpdateCompanionBuilder, - ( - CategoryTable, - BaseReferences<_$ExerciseDatabase, $CategoriesTable, CategoryTable>, - ), + (CategoryTable, BaseReferences<_$ExerciseDatabase, $CategoriesTable, CategoryTable>), CategoryTable, PrefetchHooks Function() > { @@ -1727,10 +1653,8 @@ class $$CategoriesTableTableManager TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$CategoriesTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$CategoriesTableOrderingComposer($db: db, $table: table), + createFilteringComposer: () => $$CategoriesTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => $$CategoriesTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$CategoriesTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: @@ -1744,11 +1668,9 @@ class $$CategoriesTableTableManager required int id, required ExerciseCategory data, Value rowid = const Value.absent(), - }) => - CategoriesCompanion.insert(id: id, data: data, rowid: rowid), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), + }) => CategoriesCompanion.insert(id: id, data: data, rowid: rowid), + withReferenceMapper: (p0) => + p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), prefetchHooksCallback: null, ), ); @@ -1764,10 +1686,7 @@ typedef $$CategoriesTableProcessedTableManager = $$CategoriesTableAnnotationComposer, $$CategoriesTableCreateCompanionBuilder, $$CategoriesTableUpdateCompanionBuilder, - ( - CategoryTable, - BaseReferences<_$ExerciseDatabase, $CategoriesTable, CategoryTable>, - ), + (CategoryTable, BaseReferences<_$ExerciseDatabase, $CategoriesTable, CategoryTable>), CategoryTable, PrefetchHooks Function() >; @@ -1784,8 +1703,7 @@ typedef $$LanguagesTableUpdateCompanionBuilder = Value rowid, }); -class $$LanguagesTableFilterComposer - extends Composer<_$ExerciseDatabase, $LanguagesTable> { +class $$LanguagesTableFilterComposer extends Composer<_$ExerciseDatabase, $LanguagesTable> { $$LanguagesTableFilterComposer({ required super.$db, required super.$table, @@ -1798,15 +1716,13 @@ class $$LanguagesTableFilterComposer builder: (column) => ColumnFilters(column), ); - ColumnWithTypeConverterFilters get data => - $composableBuilder( - column: $table.data, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); + ColumnWithTypeConverterFilters get data => $composableBuilder( + column: $table.data, + builder: (column) => ColumnWithTypeConverterFilters(column), + ); } -class $$LanguagesTableOrderingComposer - extends Composer<_$ExerciseDatabase, $LanguagesTable> { +class $$LanguagesTableOrderingComposer extends Composer<_$ExerciseDatabase, $LanguagesTable> { $$LanguagesTableOrderingComposer({ required super.$db, required super.$table, @@ -1825,8 +1741,7 @@ class $$LanguagesTableOrderingComposer ); } -class $$LanguagesTableAnnotationComposer - extends Composer<_$ExerciseDatabase, $LanguagesTable> { +class $$LanguagesTableAnnotationComposer extends Composer<_$ExerciseDatabase, $LanguagesTable> { $$LanguagesTableAnnotationComposer({ required super.$db, required super.$table, @@ -1834,8 +1749,7 @@ class $$LanguagesTableAnnotationComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); + GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumnWithTypeConverter get data => $composableBuilder(column: $table.data, builder: (column) => column); @@ -1852,10 +1766,7 @@ class $$LanguagesTableTableManager $$LanguagesTableAnnotationComposer, $$LanguagesTableCreateCompanionBuilder, $$LanguagesTableUpdateCompanionBuilder, - ( - LanguagesTable, - BaseReferences<_$ExerciseDatabase, $LanguagesTable, LanguagesTable>, - ), + (LanguagesTable, BaseReferences<_$ExerciseDatabase, $LanguagesTable, LanguagesTable>), LanguagesTable, PrefetchHooks Function() > { @@ -1864,10 +1775,8 @@ class $$LanguagesTableTableManager TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$LanguagesTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$LanguagesTableOrderingComposer($db: db, $table: table), + createFilteringComposer: () => $$LanguagesTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => $$LanguagesTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => $$LanguagesTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: @@ -1882,9 +1791,8 @@ class $$LanguagesTableTableManager required Language data, Value rowid = const Value.absent(), }) => LanguagesCompanion.insert(id: id, data: data, 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, ), ); @@ -1900,10 +1808,7 @@ typedef $$LanguagesTableProcessedTableManager = $$LanguagesTableAnnotationComposer, $$LanguagesTableCreateCompanionBuilder, $$LanguagesTableUpdateCompanionBuilder, - ( - LanguagesTable, - BaseReferences<_$ExerciseDatabase, $LanguagesTable, LanguagesTable>, - ), + (LanguagesTable, BaseReferences<_$ExerciseDatabase, $LanguagesTable, LanguagesTable>), LanguagesTable, PrefetchHooks Function() >; @@ -1911,14 +1816,11 @@ typedef $$LanguagesTableProcessedTableManager = class $ExerciseDatabaseManager { final _$ExerciseDatabase _db; $ExerciseDatabaseManager(this._db); - $$ExercisesTableTableManager get exercises => - $$ExercisesTableTableManager(_db, _db.exercises); - $$MusclesTableTableManager get muscles => - $$MusclesTableTableManager(_db, _db.muscles); + $$ExercisesTableTableManager get exercises => $$ExercisesTableTableManager(_db, _db.exercises); + $$MusclesTableTableManager get muscles => $$MusclesTableTableManager(_db, _db.muscles); $$EquipmentsTableTableManager get equipments => $$EquipmentsTableTableManager(_db, _db.equipments); $$CategoriesTableTableManager get categories => $$CategoriesTableTableManager(_db, _db.categories); - $$LanguagesTableTableManager get languages => - $$LanguagesTableTableManager(_db, _db.languages); + $$LanguagesTableTableManager get languages => $$LanguagesTableTableManager(_db, _db.languages); } diff --git a/lib/database/ingredients/ingredients_database.g.dart b/lib/database/ingredients/ingredients_database.g.dart index 411f5550..d4f8a495 100644 --- a/lib/database/ingredients/ingredients_database.g.dart +++ b/lib/database/ingredients/ingredients_database.g.dart @@ -3,8 +3,7 @@ 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; @@ -155,19 +154,16 @@ class IngredientTable extends DataClass implements Insertable { }; } - IngredientTable copyWith({int? id, String? data, DateTime? lastFetched}) => - IngredientTable( - id: id ?? this.id, - data: data ?? this.data, - lastFetched: lastFetched ?? this.lastFetched, - ); + 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, ); } @@ -279,8 +275,7 @@ abstract class _$IngredientDatabase extends GeneratedDatabase { @override List get allSchemaEntities => [ingredients]; @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); + DriftDatabaseOptions get options => const DriftDatabaseOptions(storeDateTimeAsText: true); } typedef $$IngredientsTableCreateCompanionBuilder = @@ -298,8 +293,7 @@ typedef $$IngredientsTableUpdateCompanionBuilder = Value rowid, }); -class $$IngredientsTableFilterComposer - extends Composer<_$IngredientDatabase, $IngredientsTable> { +class $$IngredientsTableFilterComposer extends Composer<_$IngredientDatabase, $IngredientsTable> { $$IngredientsTableFilterComposer({ required super.$db, required super.$table, @@ -323,8 +317,7 @@ class $$IngredientsTableFilterComposer ); } -class $$IngredientsTableOrderingComposer - extends Composer<_$IngredientDatabase, $IngredientsTable> { +class $$IngredientsTableOrderingComposer extends Composer<_$IngredientDatabase, $IngredientsTable> { $$IngredientsTableOrderingComposer({ required super.$db, required super.$table, @@ -357,8 +350,7 @@ class $$IngredientsTableAnnotationComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); + GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); GeneratedColumn get data => $composableBuilder(column: $table.data, builder: (column) => column); @@ -382,11 +374,7 @@ class $$IngredientsTableTableManager $$IngredientsTableUpdateCompanionBuilder, ( IngredientTable, - BaseReferences< - _$IngredientDatabase, - $IngredientsTable, - IngredientTable - >, + BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>, ), IngredientTable, PrefetchHooks Function() @@ -398,10 +386,8 @@ class $$IngredientsTableTableManager 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: @@ -428,9 +414,8 @@ class $$IngredientsTableTableManager 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, ), ); @@ -446,14 +431,7 @@ typedef $$IngredientsTableProcessedTableManager = $$IngredientsTableAnnotationComposer, $$IngredientsTableCreateCompanionBuilder, $$IngredientsTableUpdateCompanionBuilder, - ( - IngredientTable, - BaseReferences< - _$IngredientDatabase, - $IngredientsTable, - IngredientTable - >, - ), + (IngredientTable, BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>), IngredientTable, PrefetchHooks Function() >; diff --git a/lib/database/powersync/database.dart b/lib/database/powersync/database.dart index 95821918..0a06b9a1 100644 --- a/lib/database/powersync/database.dart +++ b/lib/database/powersync/database.dart @@ -15,8 +15,8 @@ part 'database.g.dart'; ], //include: {'queries.drift'}, ) -class AppDatabase extends _$AppDatabase { - AppDatabase(super.e); +class DriftPowersyncDatabase extends _$DriftPowersyncDatabase { + DriftPowersyncDatabase(super.e); @override int get schemaVersion => 1; @@ -42,7 +42,7 @@ class AppDatabase extends _$AppDatabase { } final driftPowerSyncDatabase = Provider((ref) { - return AppDatabase( + return DriftPowersyncDatabase( DatabaseConnection.delayed( Future(() async { final database = await ref.read(powerSyncInstanceProvider.future); diff --git a/lib/database/powersync/database.g.dart b/lib/database/powersync/database.g.dart index 24c9d6a5..09976329 100644 --- a/lib/database/powersync/database.g.dart +++ b/lib/database/powersync/database.g.dart @@ -173,9 +173,9 @@ class WeightEntryTableCompanion extends UpdateCompanion { } } -abstract class _$AppDatabase extends GeneratedDatabase { - _$AppDatabase(QueryExecutor e) : super(e); - $AppDatabaseManager get managers => $AppDatabaseManager(this); +abstract class _$DriftPowersyncDatabase extends GeneratedDatabase { + _$DriftPowersyncDatabase(QueryExecutor e) : super(e); + $DriftPowersyncDatabaseManager get managers => $DriftPowersyncDatabaseManager(this); late final $WeightEntryTableTable weightEntryTable = $WeightEntryTableTable( this, ); @@ -185,8 +185,7 @@ abstract class _$AppDatabase extends GeneratedDatabase { @override List get allSchemaEntities => [weightEntryTable]; @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); + DriftDatabaseOptions get options => const DriftDatabaseOptions(storeDateTimeAsText: true); } typedef $$WeightEntryTableTableCreateCompanionBuilder = @@ -205,7 +204,7 @@ typedef $$WeightEntryTableTableUpdateCompanionBuilder = }); class $$WeightEntryTableTableFilterComposer - extends Composer<_$AppDatabase, $WeightEntryTableTable> { + extends Composer<_$DriftPowersyncDatabase, $WeightEntryTableTable> { $$WeightEntryTableTableFilterComposer({ required super.$db, required super.$table, @@ -230,7 +229,7 @@ class $$WeightEntryTableTableFilterComposer } class $$WeightEntryTableTableOrderingComposer - extends Composer<_$AppDatabase, $WeightEntryTableTable> { + extends Composer<_$DriftPowersyncDatabase, $WeightEntryTableTable> { $$WeightEntryTableTableOrderingComposer({ required super.$db, required super.$table, @@ -255,7 +254,7 @@ class $$WeightEntryTableTableOrderingComposer } class $$WeightEntryTableTableAnnotationComposer - extends Composer<_$AppDatabase, $WeightEntryTableTable> { + extends Composer<_$DriftPowersyncDatabase, $WeightEntryTableTable> { $$WeightEntryTableTableAnnotationComposer({ required super.$db, required super.$table, @@ -276,7 +275,7 @@ class $$WeightEntryTableTableAnnotationComposer class $$WeightEntryTableTableTableManager extends RootTableManager< - _$AppDatabase, + _$DriftPowersyncDatabase, $WeightEntryTableTable, WeightEntry, $$WeightEntryTableTableFilterComposer, @@ -286,13 +285,13 @@ class $$WeightEntryTableTableTableManager $$WeightEntryTableTableUpdateCompanionBuilder, ( WeightEntry, - BaseReferences<_$AppDatabase, $WeightEntryTableTable, WeightEntry>, + BaseReferences<_$DriftPowersyncDatabase, $WeightEntryTableTable, WeightEntry>, ), WeightEntry, PrefetchHooks Function() > { $$WeightEntryTableTableTableManager( - _$AppDatabase db, + _$DriftPowersyncDatabase db, $WeightEntryTableTable table, ) : super( TableManagerState( @@ -328,9 +327,8 @@ class $$WeightEntryTableTableTableManager date: date, 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, ), ); @@ -338,7 +336,7 @@ class $$WeightEntryTableTableTableManager typedef $$WeightEntryTableTableProcessedTableManager = ProcessedTableManager< - _$AppDatabase, + _$DriftPowersyncDatabase, $WeightEntryTableTable, WeightEntry, $$WeightEntryTableTableFilterComposer, @@ -346,17 +344,14 @@ typedef $$WeightEntryTableTableProcessedTableManager = $$WeightEntryTableTableAnnotationComposer, $$WeightEntryTableTableCreateCompanionBuilder, $$WeightEntryTableTableUpdateCompanionBuilder, - ( - WeightEntry, - BaseReferences<_$AppDatabase, $WeightEntryTableTable, WeightEntry>, - ), + (WeightEntry, BaseReferences<_$DriftPowersyncDatabase, $WeightEntryTableTable, WeightEntry>), WeightEntry, PrefetchHooks Function() >; -class $AppDatabaseManager { - final _$AppDatabase _db; - $AppDatabaseManager(this._db); +class $DriftPowersyncDatabaseManager { + final _$DriftPowersyncDatabase _db; + $DriftPowersyncDatabaseManager(this._db); $$WeightEntryTableTableTableManager get weightEntryTable => $$WeightEntryTableTableTableManager(_db, _db.weightEntryTable); } diff --git a/lib/powersync/connector.dart b/lib/powersync/connector.dart index 53d4de09..9bc15b60 100644 --- a/lib/powersync/connector.dart +++ b/lib/powersync/connector.dart @@ -62,19 +62,21 @@ class DjangoConnector extends PowerSyncBackendConnector { 'data': {'id': op.id, ...?op.opData}, }; - logger.fine('Uploading record', record); + logger.fine('Uploading record $record'); + logger.fine(op.clientId); + logger.fine(op.metadata); switch (op.op) { case UpdateType.put: - logger.fine('Upserting record', record); + logger.fine('Upserting record'); await apiClient.upsert(record); break; case UpdateType.patch: - logger.fine('Patching record', record); + logger.fine('Patching record'); await apiClient.update(record); break; case UpdateType.delete: - logger.fine('Deleting record', record); + logger.fine('Deleting record'); await apiClient.delete(record); break; } diff --git a/lib/providers/body_weight_powersync.dart b/lib/providers/body_weight_powersync.dart index 47b04ef4..9ab7e41c 100644 --- a/lib/providers/body_weight_powersync.dart +++ b/lib/providers/body_weight_powersync.dart @@ -6,6 +6,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:wger/models/body_weight/weight_entry.dart'; import '../database/powersync/database.dart'; +import 'body_weight_riverpod.dart'; part 'body_weight_powersync.g.dart'; @@ -16,27 +17,32 @@ final class WeightEntryNotifier extends _$WeightEntryNotifier { @override Stream> build() { final database = ref.watch(driftPowerSyncDatabase); - final query = database.select(database.weightEntryTable) - ..orderBy([(t) => OrderingTerm(expression: t.date)]); - return query.watch(); + final repo = ref.watch(bodyWeightRepositoryProvider); + return repo.watchAllDrift(database); } Future deleteEntry(String id) async { final db = ref.read(driftPowerSyncDatabase); - - await (db.delete(db.weightEntryTable)..where((t) => t.id.equals(id))).go(); + final repo = ref.read(bodyWeightRepositoryProvider); + await repo.deleteLocalDrift(db, id); } Future updateEntry(WeightEntry entry) async { final db = ref.read(driftPowerSyncDatabase); + final repo = ref.read(bodyWeightRepositoryProvider); + await repo.updateLocalDrift(db, entry); + } - final stmt = db.update(db.weightEntryTable)..where((t) => t.id.equals(entry.id!)); - - await stmt.write( - WeightEntryTableCompanion( - date: Value(entry.date), - weight: Value(entry.weight as double), - ), - ); + Future addEntry(WeightEntry entry) async { + final db = ref.read(driftPowerSyncDatabase); + _log.info('Adding new weight entry on local drift: ${entry.date} - ${entry.weight}'); + await db + .into(db.weightEntryTable) + .insertReturning( + WeightEntryTableCompanion.insert( + date: Value(entry.date), + weight: entry.weight as double, + ), + ); } } diff --git a/lib/providers/body_weight_powersync.g.dart b/lib/providers/body_weight_powersync.g.dart index b8abbcba..34a44cdf 100644 --- a/lib/providers/body_weight_powersync.g.dart +++ b/lib/providers/body_weight_powersync.g.dart @@ -33,18 +33,15 @@ final class WeightEntryNotifierProvider WeightEntryNotifier create() => WeightEntryNotifier(); } -String _$weightEntryNotifierHash() => - r'e1ebd97614bf12e7fd64c4613a13b082cb01eb33'; +String _$weightEntryNotifierHash() => r'df37b137d038b82b0937333a4f1cc3be7148f932'; -abstract class _$WeightEntryNotifier - extends $StreamNotifier> { +abstract class _$WeightEntryNotifier extends $StreamNotifier> { Stream> build(); @$mustCallSuper @override void runBuild() { final created = build(); - final ref = - this.ref as $Ref>, List>; + final ref = this.ref as $Ref>, List>; final element = ref.element as $ClassProviderElement< diff --git a/lib/providers/body_weight_repository.dart b/lib/providers/body_weight_repository.dart index d1831a7a..5fd918da 100644 --- a/lib/providers/body_weight_repository.dart +++ b/lib/providers/body_weight_repository.dart @@ -2,80 +2,37 @@ * Repository for body weight network operations. */ +import 'package:drift/drift.dart'; import 'package:logging/logging.dart'; -import 'package:powersync/powersync.dart'; import 'package:wger/models/body_weight/weight_entry.dart'; -import 'package:wger/powersync.dart' as ps; -import 'package:wger/powersync/schema.dart'; + +import '../database/powersync/database.dart'; class BodyWeightRepository { final _logger = Logger('BodyWeightRepository'); - static const BODY_WEIGHT_URL = 'weightentry'; - BodyWeightRepository(); - /// Fetches all weight entries (paginated on the server side) - Future> fetchAll() async { - _logger.info('Repository: fetching all body weight entries'); - - // final data = await baseProvider.fetchPaginated( - // baseProvider.makeUrl( - // BODY_WEIGHT_URL, - // query: {'ordering': '-date', 'limit': API_MAX_PAGE_SIZE}, - // ), - // ); - - final out = []; - // for (final entry in data) { - // out.add(WeightEntry.fromJson(entry)); - // } - - return out; + Stream> watchAllDrift(DriftPowersyncDatabase db) { + _logger.finer('Watching all local weight entries'); + final query = db.select(db.weightEntryTable) + ..orderBy([(t) => OrderingTerm(expression: t.date, mode: OrderingMode.desc)]); + return query.watch(); } - /// Creates a new weight entry on the server and returns the created object - Future create(WeightEntry entry) async { - _logger.info('Repository: creating weight entry'); - final result = await ps.db.execute( - 'INSERT INTO $tableBodyWeight (id, weight, date) VALUES (?, ?, ?)', - [ - uuid.v4(), - entry.weight, - entry.date.toIso8601String(), - ], - ); - _logger.fine('result of insert: $result'); - - return WeightEntry(); - return WeightEntry.fromRow(result.first); + Future deleteLocalDrift(DriftPowersyncDatabase db, String id) async { + _logger.finer('Deleting local weight entry $id'); + await (db.delete(db.weightEntryTable)..where((t) => t.id.equals(id))).go(); } - /// Updates an existing weight entry on the server - Future update(WeightEntry entry) async { - _logger.info('Repository: updating weight entry ${entry.id}'); - - final result = await ps.db.execute( - 'UPDATE $tableBodyWeight SET weight = ?, date = ? WHERE id = ?', - [ - entry.weight, - entry.date.toIso8601String(), - entry.id, - ], - ); - - _logger.fine('result of update: $result'); - - return WeightEntry(); - return WeightEntry.fromRow(result.first); - } - - /// Deletes a weight entry on the server - Future delete(String id) async { - _logger.info('Repository: deleting weight entry $id'); - await ps.db.execute( - 'DELETE FROM $tableBodyWeight WHERE id = ?', - [id], + Future updateLocalDrift(DriftPowersyncDatabase db, WeightEntry entry) async { + _logger.finer('Updating local weight entry ${entry.id}'); + final stmt = db.update(db.weightEntryTable)..where((t) => t.id.equals(entry.id!)); + await stmt.write( + WeightEntryTableCompanion( + date: Value(entry.date), + weight: Value(entry.weight as double), + ), ); } } diff --git a/lib/providers/body_weight_state.dart b/lib/providers/body_weight_state.dart index 0ebd7a9c..29729978 100644 --- a/lib/providers/body_weight_state.dart +++ b/lib/providers/body_weight_state.dart @@ -1,5 +1,3 @@ -import 'dart:async'; - import 'package:logging/logging.dart'; import 'package:state_notifier/state_notifier.dart'; import 'package:wger/models/body_weight/weight_entry.dart'; @@ -15,7 +13,7 @@ class BodyWeightState extends StateNotifier> { WeightEntry? getNewestEntry() => state.isNotEmpty ? state.first : null; - WeightEntry? findById(int id) { + WeightEntry? findById(String id) { try { return state.firstWhere((e) => e.id == id); } on StateError { @@ -32,48 +30,4 @@ class BodyWeightState extends StateNotifier> { } void clear() => state = []; - - Future fetchAndSetEntries() async { - _logger.info('State: fetching entries'); - final entries = await repository.fetchAll(); - // Ensure sorted by date desc - entries.sort((a, b) => b.date.compareTo(a.date)); - state = entries; - } - - Future addEntry(WeightEntry entry) async { - final created = await repository.create(entry); - final newList = [...state, created]; - newList.sort((a, b) => b.date.compareTo(a.date)); - state = newList; - return created; - } - - Future editEntry(WeightEntry entry) async { - return repository.update(entry); - } - - Future deleteEntry(String id) async { - final idx = state.indexWhere((e) => e.id == id); - if (idx < 0) { - return; - } - - final removed = state[idx]; - final newList = [...state]..removeAt(idx); - state = newList; - - try { - final response = await repository.delete(id); - // if (response.statusCode >= 400) { - // // Revert - // state = [...state]..insert(idx, removed); - // throw Exception('Failed to delete: ${response.statusCode}'); - // } - } catch (e) { - // Revert on any error and rethrow - state = [...state]..insert(idx, removed); - rethrow; - } - } } diff --git a/lib/widgets/dashboard/widgets/weight.dart b/lib/widgets/dashboard/widgets/weight.dart index 2d1c53cc..064b20fb 100644 --- a/lib/widgets/dashboard/widgets/weight.dart +++ b/lib/widgets/dashboard/widgets/weight.dart @@ -21,10 +21,11 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; import 'package:wger/l10n/generated/app_localizations.dart'; -import 'package:wger/providers/body_weight_riverpod.dart'; +import 'package:wger/providers/body_weight_powersync.dart'; import 'package:wger/providers/user.dart'; import 'package:wger/screens/form_screen.dart'; import 'package:wger/screens/weight_screen.dart'; +import 'package:wger/widgets/core/progress_indicator.dart'; import 'package:wger/widgets/dashboard/widgets/nothing_found.dart'; import 'package:wger/widgets/measurements/charts.dart'; import 'package:wger/widgets/measurements/helpers.dart'; @@ -36,11 +37,11 @@ class DashboardWeightWidget extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final profile = context.read().profile; - final entriesList = ref.watch(bodyWeightStateProvider); + final entriesList = ref.watch(weightEntryProvider); - final (entriesAll, entries7dAvg) = sensibleRange( - entriesList.map((e) => MeasurementChartEntry(e.weight, e.date)).toList(), - ); + // final (entriesAll, entries7dAvg) = sensibleRange( + // entriesList.map((e) => MeasurementChartEntry(e.weight, e.date)).toList(), + // ); return Card( child: Column( @@ -56,62 +57,81 @@ class DashboardWeightWidget extends ConsumerWidget { color: Theme.of(context).textTheme.headlineSmall!.color, ), ), - Column( - children: [ - if (entriesList.isNotEmpty) - Column( - children: [ - SizedBox( - height: 200, - child: MeasurementChartWidgetFl( - entriesAll, - weightUnit(profile!.isMetric, context), - avgs: entries7dAvg, - ), - ), - if (entries7dAvg.isNotEmpty) - MeasurementOverallChangeWidget( - entries7dAvg.first, - entries7dAvg.last, - weightUnit(profile.isMetric, context), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + entriesList.when( + data: (entriesList) { + final (entriesAll, entries7dAvg) = sensibleRange( + entriesList.map((e) => MeasurementChartEntry(e.weight, e.date)).toList(), + ); + + return Column( + children: [ + if (entriesList.isNotEmpty) + Column( children: [ - TextButton( - child: Text( - AppLocalizations.of(context).goToDetailPage, + SizedBox( + height: 200, + child: MeasurementChartWidgetFl( + entriesAll, + weightUnit(profile!.isMetric, context), + avgs: entries7dAvg, ), - onPressed: () { - Navigator.of(context).pushNamed(WeightScreen.routeName); - }, ), - IconButton( - icon: const Icon(Icons.add), - onPressed: () { - Navigator.pushNamed( - context, - FormScreen.routeName, - arguments: FormScreenArguments( - AppLocalizations.of(context).newEntry, - WeightForm( - entriesList.first.copyWith(id: null, date: DateTime.now()), - ), + if (entries7dAvg.isNotEmpty) + MeasurementOverallChangeWidget( + entries7dAvg.first, + entries7dAvg.last, + weightUnit(profile.isMetric, context), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + TextButton( + child: Text( + AppLocalizations.of(context).goToDetailPage, ), - ); - }, + onPressed: () { + Navigator.of(context).pushNamed(WeightScreen.routeName); + }, + ), + IconButton( + icon: const Icon(Icons.add), + onPressed: () { + Navigator.pushNamed( + context, + FormScreen.routeName, + arguments: FormScreenArguments( + AppLocalizations.of(context).newEntry, + WeightForm( + entriesList.first.copyWith(id: null, date: DateTime.now()), + ), + ), + ); + }, + ), + ], ), ], + ) + else + NothingFound( + AppLocalizations.of(context).noWeightEntries, + AppLocalizations.of(context).newEntry, + WeightForm(), ), - ], - ) - else - NothingFound( - AppLocalizations.of(context).noWeightEntries, - AppLocalizations.of(context).newEntry, - WeightForm(), - ), - ], + ], + ); + }, + loading: () => const BoxedProgressIndicator(), + error: (err, st) { + return Column( + children: [ + Text('Error loading local weights: $err'), + Text(st.toString()), + + const SizedBox(height: 200, child: Center(child: Icon(Icons.error))), + ], + ); + }, ), ], ), diff --git a/lib/widgets/nutrition/nutritional_plan_detail.dart b/lib/widgets/nutrition/nutritional_plan_detail.dart index 4ef239eb..88e81ab5 100644 --- a/lib/widgets/nutrition/nutritional_plan_detail.dart +++ b/lib/widgets/nutrition/nutritional_plan_detail.dart @@ -19,11 +19,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart' as riverpod; import 'package:intl/intl.dart'; -import 'package:provider/provider.dart'; import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/body_weight/weight_entry.dart'; import 'package:wger/models/nutrition/nutritional_plan.dart'; -import 'package:wger/providers/auth.dart'; import 'package:wger/providers/body_weight_riverpod.dart'; import 'package:wger/widgets/nutrition/charts.dart'; import 'package:wger/widgets/nutrition/macro_nutrients_table.dart'; @@ -38,7 +36,6 @@ class NutritionalPlanDetailWidget extends riverpod.ConsumerWidget { @override Widget build(BuildContext context, riverpod.WidgetRef ref) { final nutritionalGoals = _nutritionalPlan.nutritionalGoals; - final auth = context.read(); final entriesList = ref.watch(bodyWeightStateProvider); final WeightEntry? lastWeightEntry = entriesList.isNotEmpty ? entriesList.first : null; final nutritionalGoalsGperKg = lastWeightEntry != null diff --git a/lib/widgets/weight/forms.dart b/lib/widgets/weight/forms.dart index 9400e259..97ca342f 100644 --- a/lib/widgets/weight/forms.dart +++ b/lib/widgets/weight/forms.dart @@ -23,7 +23,7 @@ import 'package:intl/intl.dart'; import 'package:wger/helpers/consts.dart'; import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/body_weight/weight_entry.dart'; -import 'package:wger/providers/body_weight_riverpod.dart'; +import 'package:wger/providers/body_weight_powersync.dart'; class WeightForm extends riverpod.ConsumerWidget { final _form = GlobalKey(); @@ -197,7 +197,6 @@ class WeightForm extends riverpod.ConsumerWidget { return null; }, ), - Text("ID: ${_weightEntry.id}"), ElevatedButton( key: const Key(SUBMIT_BUTTON_KEY_NAME), child: Text(AppLocalizations.of(context).save), @@ -210,10 +209,10 @@ class WeightForm extends riverpod.ConsumerWidget { _form.currentState!.save(); // Save the entry on the server - final notifier = ref.read(bodyWeightStateProvider.notifier); + final notifier = ref.read(weightEntryProvider.notifier); _weightEntry.id == null ? await notifier.addEntry(_weightEntry) - : await notifier.editEntry(_weightEntry); + : await notifier.updateEntry(_weightEntry); if (context.mounted) { Navigator.of(context).pop(); diff --git a/lib/widgets/weight/weight_overview.dart b/lib/widgets/weight/weight_overview.dart index 7237d618..56fda4f1 100644 --- a/lib/widgets/weight/weight_overview.dart +++ b/lib/widgets/weight/weight_overview.dart @@ -22,10 +22,10 @@ import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/providers/body_weight_powersync.dart'; -import 'package:wger/providers/body_weight_riverpod.dart'; import 'package:wger/providers/nutrition.dart'; import 'package:wger/providers/user.dart'; import 'package:wger/screens/form_screen.dart'; +import 'package:wger/widgets/core/progress_indicator.dart'; import 'package:wger/widgets/measurements/charts.dart'; import 'package:wger/widgets/measurements/helpers.dart'; import 'package:wger/widgets/weight/forms.dart'; @@ -40,9 +40,6 @@ class WeightOverview extends riverpod.ConsumerWidget { final plans = context.read().items; final entries = ref.watch(weightEntryProvider); - // final entriesAsync = ref.watch(bodyWeightStreamProvider); - - // Handle stream states (loading/error/data) and reuse the existing UI return entries.when( data: (entriesList) { final entriesAll = entriesList.map((e) => MeasurementChartEntry(e.weight, e.date)).toList(); @@ -75,78 +72,67 @@ class WeightOverview extends riverpod.ConsumerWidget { ), SizedBox( height: 300, - child: RefreshIndicator( - onRefresh: () => ref.read(bodyWeightStateProvider.notifier).fetchAndSetEntries(), - child: ListView.builder( - padding: const EdgeInsets.all(10.0), - itemCount: entriesList.length, - itemBuilder: (context, index) { - final currentEntry = entriesList[index]; - return Card( - child: ListTile( - title: Text( - '${numberFormat.format(currentEntry.weight)} ${weightUnit(profile.isMetric, context)}', - ), - subtitle: Text( - DateFormat.yMd( - Localizations.localeOf(context).languageCode, - ).add_Hm().format(currentEntry.date), - ), - trailing: PopupMenuButton( - itemBuilder: (BuildContext context) { - return [ - PopupMenuItem( - child: Text(AppLocalizations.of(context).edit), - onTap: () => Navigator.pushNamed( - context, - FormScreen.routeName, - arguments: FormScreenArguments( - AppLocalizations.of(context).edit, - WeightForm(currentEntry), - ), + child: ListView.builder( + padding: const EdgeInsets.all(10.0), + itemCount: entriesList.length, + itemBuilder: (context, index) { + final currentEntry = entriesList[index]; + return Card( + child: ListTile( + title: Text( + '${numberFormat.format(currentEntry.weight)} ${weightUnit(profile.isMetric, context)}', + ), + subtitle: Text( + DateFormat.yMd( + Localizations.localeOf(context).languageCode, + ).add_Hm().format(currentEntry.date), + ), + trailing: PopupMenuButton( + itemBuilder: (BuildContext context) { + return [ + PopupMenuItem( + child: Text(AppLocalizations.of(context).edit), + onTap: () => Navigator.pushNamed( + context, + FormScreen.routeName, + arguments: FormScreenArguments( + AppLocalizations.of(context).edit, + WeightForm(currentEntry), ), ), - PopupMenuItem( - child: Text(AppLocalizations.of(context).delete), - onTap: () async { - // Delete entry from DB - await ref - .read(bodyWeightStateProvider.notifier) - .deleteEntry(currentEntry.id!); + ), + PopupMenuItem( + child: Text(AppLocalizations.of(context).delete), + onTap: () async { + await ref + .read(weightEntryProvider.notifier) + .deleteEntry(currentEntry.id!); - // and inform the user - if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - AppLocalizations.of(context).successfullyDeleted, - textAlign: TextAlign.center, - ), + // and inform the user + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + AppLocalizations.of(context).successfullyDeleted, + textAlign: TextAlign.center, ), - ); - } - }, - ), - ]; - }, - ), + ), + ); + } + }, + ), + ]; + }, ), - ); - }, - ), + ), + ); + }, ), ), ], ); }, - loading: () { - // Show a small loading indicator while waiting for the first data set - return const Column( - children: [ - SizedBox(height: 200, child: Center(child: CircularProgressIndicator())), - ], - ); - }, + loading: () => const BoxedProgressIndicator(), error: (err, st) { return Column( children: [ diff --git a/test/auth/auth_screen_test.mocks.dart b/test/auth/auth_screen_test.mocks.dart index a002f051..0f2e0cc7 100644 --- a/test/auth/auth_screen_test.mocks.dart +++ b/test/auth/auth_screen_test.mocks.dart @@ -26,12 +26,10 @@ import 'package:mockito/src/dummies.dart' as _i5; // ignore_for_file: subtype_of_sealed_class class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response { - _FakeResponse_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeResponse_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeStreamedResponse_1 extends _i1.SmartFake - implements _i2.StreamedResponse { +class _FakeStreamedResponse_1 extends _i1.SmartFake implements _i2.StreamedResponse { _FakeStreamedResponse_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } diff --git a/test/core/settings_test.mocks.dart b/test/core/settings_test.mocks.dart index d398ea2f..208aca6e 100644 --- a/test/core/settings_test.mocks.dart +++ b/test/core/settings_test.mocks.dart @@ -42,73 +42,60 @@ import 'package:wger/providers/user.dart' as _i21; // 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) : super(parent, parentInvocation); } -class _FakeExerciseDatabase_1 extends _i1.SmartFake - implements _i3.ExerciseDatabase { +class _FakeExerciseDatabase_1 extends _i1.SmartFake implements _i3.ExerciseDatabase { _FakeExerciseDatabase_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeExercise_2 extends _i1.SmartFake implements _i4.Exercise { - _FakeExercise_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeExercise_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeExerciseCategory_3 extends _i1.SmartFake - implements _i5.ExerciseCategory { +class _FakeExerciseCategory_3 extends _i1.SmartFake implements _i5.ExerciseCategory { _FakeExerciseCategory_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeEquipment_4 extends _i1.SmartFake implements _i6.Equipment { - _FakeEquipment_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeEquipment_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMuscle_5 extends _i1.SmartFake implements _i7.Muscle { - _FakeMuscle_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMuscle_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLanguage_6 extends _i1.SmartFake implements _i8.Language { - _FakeLanguage_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLanguage_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeIngredientDatabase_7 extends _i1.SmartFake - implements _i9.IngredientDatabase { +class _FakeIngredientDatabase_7 extends _i1.SmartFake implements _i9.IngredientDatabase { _FakeIngredientDatabase_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeNutritionalPlan_8 extends _i1.SmartFake - implements _i10.NutritionalPlan { +class _FakeNutritionalPlan_8 extends _i1.SmartFake implements _i10.NutritionalPlan { _FakeNutritionalPlan_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMeal_9 extends _i1.SmartFake implements _i11.Meal { - _FakeMeal_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMeal_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMealItem_10 extends _i1.SmartFake implements _i12.MealItem { - _FakeMealItem_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMealItem_10(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeIngredient_11 extends _i1.SmartFake implements _i13.Ingredient { - _FakeIngredient_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeIngredient_11(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeSharedPreferencesAsync_12 extends _i1.SmartFake - implements _i14.SharedPreferencesAsync { +class _FakeSharedPreferencesAsync_12 extends _i1.SmartFake implements _i14.SharedPreferencesAsync { _FakeSharedPreferencesAsync_12(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } @@ -119,18 +106,15 @@ class _FakeAuthProvider_13 extends _i1.SmartFake implements _i15.AuthProvider { } class _FakeClient_14 extends _i1.SmartFake implements _i16.Client { - _FakeClient_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeClient_14(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeUri_15 extends _i1.SmartFake implements Uri { - _FakeUri_15(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUri_15(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeResponse_16 extends _i1.SmartFake implements _i16.Response { - _FakeResponse_16(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeResponse_16(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [ExercisesProvider]. @@ -232,11 +216,10 @@ class MockExercisesProvider extends _i1.Mock implements _i17.ExercisesProvider { ); @override - set filteredExercises(List<_i4.Exercise>? newFilteredExercises) => - super.noSuchMethod( - Invocation.setter(#filteredExercises, newFilteredExercises), - returnValueForMissingStub: null, - ); + set filteredExercises(List<_i4.Exercise>? newFilteredExercises) => super.noSuchMethod( + Invocation.setter(#filteredExercises, newFilteredExercises), + returnValueForMissingStub: null, + ); @override set languages(List<_i8.Language>? languages) => super.noSuchMethod( @@ -246,8 +229,7 @@ class MockExercisesProvider extends _i1.Mock implements _i17.ExercisesProvider { @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override _i18.Future setFilters(_i17.Filters? newFilters) => @@ -560,8 +542,7 @@ class MockExercisesProvider extends _i1.Mock implements _i17.ExercisesProvider { /// A class which mocks [NutritionPlansProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockNutritionPlansProvider extends _i1.Mock - implements _i20.NutritionPlansProvider { +class MockNutritionPlansProvider extends _i1.Mock implements _i20.NutritionPlansProvider { MockNutritionPlansProvider() { _i1.throwOnMissingStub(this); } @@ -618,8 +599,7 @@ class MockNutritionPlansProvider extends _i1.Mock @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( @@ -640,8 +620,7 @@ class MockNutritionPlansProvider extends _i1.Mock @override _i11.Meal? findMealById(int? id) => - (super.noSuchMethod(Invocation.method(#findMealById, [id])) - as _i11.Meal?); + (super.noSuchMethod(Invocation.method(#findMealById, [id])) as _i11.Meal?); @override _i18.Future fetchAndSetAllPlansSparse() => @@ -967,8 +946,7 @@ class MockUserProvider extends _i1.Mock implements _i21.UserProvider { @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( @@ -1164,8 +1142,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider { /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockSharedPreferencesAsync extends _i1.Mock - implements _i14.SharedPreferencesAsync { +class MockSharedPreferencesAsync extends _i1.Mock implements _i14.SharedPreferencesAsync { MockSharedPreferencesAsync() { _i1.throwOnMissingStub(this); } diff --git a/test/exercises/contribute_exercise_test.mocks.dart b/test/exercises/contribute_exercise_test.mocks.dart index 012f064d..021fd2b7 100644 --- a/test/exercises/contribute_exercise_test.mocks.dart +++ b/test/exercises/contribute_exercise_test.mocks.dart @@ -39,60 +39,50 @@ import 'package:wger/providers/user.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) : super(parent, parentInvocation); } class _FakeVariation_1 extends _i1.SmartFake implements _i3.Variation { - _FakeVariation_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeVariation_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeSharedPreferencesAsync_2 extends _i1.SmartFake - implements _i4.SharedPreferencesAsync { +class _FakeSharedPreferencesAsync_2 extends _i1.SmartFake implements _i4.SharedPreferencesAsync { _FakeSharedPreferencesAsync_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeExerciseDatabase_3 extends _i1.SmartFake - implements _i5.ExerciseDatabase { +class _FakeExerciseDatabase_3 extends _i1.SmartFake implements _i5.ExerciseDatabase { _FakeExerciseDatabase_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeExercise_4 extends _i1.SmartFake implements _i6.Exercise { - _FakeExercise_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeExercise_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeExerciseCategory_5 extends _i1.SmartFake - implements _i7.ExerciseCategory { +class _FakeExerciseCategory_5 extends _i1.SmartFake implements _i7.ExerciseCategory { _FakeExerciseCategory_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeEquipment_6 extends _i1.SmartFake implements _i8.Equipment { - _FakeEquipment_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeEquipment_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMuscle_7 extends _i1.SmartFake implements _i9.Muscle { - _FakeMuscle_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMuscle_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLanguage_8 extends _i1.SmartFake implements _i10.Language { - _FakeLanguage_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLanguage_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [AddExerciseProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockAddExerciseProvider extends _i1.Mock - implements _i11.AddExerciseProvider { +class MockAddExerciseProvider extends _i1.Mock implements _i11.AddExerciseProvider { MockAddExerciseProvider() { _i1.throwOnMissingStub(this); } @@ -153,8 +143,7 @@ class MockAddExerciseProvider extends _i1.Mock @override bool get newVariation => - (super.noSuchMethod(Invocation.getter(#newVariation), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#newVariation), returnValue: false) as bool); @override _i3.Variation get variation => @@ -228,11 +217,10 @@ class MockAddExerciseProvider extends _i1.Mock ); @override - set languageTranslation(_i10.Language? _languageTranslation) => - super.noSuchMethod( - Invocation.setter(#languageTranslation, _languageTranslation), - returnValueForMissingStub: null, - ); + set languageTranslation(_i10.Language? _languageTranslation) => super.noSuchMethod( + Invocation.setter(#languageTranslation, _languageTranslation), + returnValueForMissingStub: null, + ); @override set alternateNamesEn(List? _alternateNamesEn) => super.noSuchMethod( @@ -241,11 +229,10 @@ class MockAddExerciseProvider extends _i1.Mock ); @override - set alternateNamesTrans(List? _alternateNamesTrans) => - super.noSuchMethod( - Invocation.setter(#alternateNamesTrans, _alternateNamesTrans), - returnValueForMissingStub: null, - ); + set alternateNamesTrans(List? _alternateNamesTrans) => super.noSuchMethod( + Invocation.setter(#alternateNamesTrans, _alternateNamesTrans), + returnValueForMissingStub: null, + ); @override set category(_i7.ExerciseCategory? _category) => super.noSuchMethod( @@ -285,8 +272,7 @@ class MockAddExerciseProvider extends _i1.Mock @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( @@ -295,11 +281,10 @@ class MockAddExerciseProvider extends _i1.Mock ); @override - void addExerciseImages(List<_i13.ExerciseSubmissionImage>? images) => - super.noSuchMethod( - Invocation.method(#addExerciseImages, [images]), - returnValueForMissingStub: null, - ); + void addExerciseImages(List<_i13.ExerciseSubmissionImage>? images) => super.noSuchMethod( + Invocation.method(#addExerciseImages, [images]), + returnValueForMissingStub: null, + ); @override void removeImage(String? path) => super.noSuchMethod( @@ -423,8 +408,7 @@ class MockUserProvider extends _i1.Mock implements _i17.UserProvider { @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( @@ -589,11 +573,10 @@ class MockExercisesProvider extends _i1.Mock implements _i20.ExercisesProvider { ); @override - set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => - super.noSuchMethod( - Invocation.setter(#filteredExercises, newFilteredExercises), - returnValueForMissingStub: null, - ); + set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => super.noSuchMethod( + Invocation.setter(#filteredExercises, newFilteredExercises), + returnValueForMissingStub: null, + ); @override set languages(List<_i10.Language>? languages) => super.noSuchMethod( @@ -603,8 +586,7 @@ class MockExercisesProvider extends _i1.Mock implements _i20.ExercisesProvider { @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override _i15.Future setFilters(_i20.Filters? newFilters) => diff --git a/test/exercises/exercises_detail_widget_test.mocks.dart b/test/exercises/exercises_detail_widget_test.mocks.dart index b7d32696..b3163b5e 100644 --- a/test/exercises/exercises_detail_widget_test.mocks.dart +++ b/test/exercises/exercises_detail_widget_test.mocks.dart @@ -30,42 +30,35 @@ import 'package:wger/providers/exercises.dart' as _i9; // 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) : super(parent, parentInvocation); } -class _FakeExerciseDatabase_1 extends _i1.SmartFake - implements _i3.ExerciseDatabase { +class _FakeExerciseDatabase_1 extends _i1.SmartFake implements _i3.ExerciseDatabase { _FakeExerciseDatabase_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeExercise_2 extends _i1.SmartFake implements _i4.Exercise { - _FakeExercise_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeExercise_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeExerciseCategory_3 extends _i1.SmartFake - implements _i5.ExerciseCategory { +class _FakeExerciseCategory_3 extends _i1.SmartFake implements _i5.ExerciseCategory { _FakeExerciseCategory_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeEquipment_4 extends _i1.SmartFake implements _i6.Equipment { - _FakeEquipment_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeEquipment_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMuscle_5 extends _i1.SmartFake implements _i7.Muscle { - _FakeMuscle_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMuscle_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLanguage_6 extends _i1.SmartFake implements _i8.Language { - _FakeLanguage_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLanguage_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [ExercisesProvider]. @@ -167,11 +160,10 @@ class MockExercisesProvider extends _i1.Mock implements _i9.ExercisesProvider { ); @override - set filteredExercises(List<_i4.Exercise>? newFilteredExercises) => - super.noSuchMethod( - Invocation.setter(#filteredExercises, newFilteredExercises), - returnValueForMissingStub: null, - ); + set filteredExercises(List<_i4.Exercise>? newFilteredExercises) => super.noSuchMethod( + Invocation.setter(#filteredExercises, newFilteredExercises), + returnValueForMissingStub: null, + ); @override set languages(List<_i8.Language>? languages) => super.noSuchMethod( @@ -181,8 +173,7 @@ class MockExercisesProvider extends _i1.Mock implements _i9.ExercisesProvider { @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override _i10.Future setFilters(_i9.Filters? newFilters) => diff --git a/test/measurements/measurement_categories_screen_test.mocks.dart b/test/measurements/measurement_categories_screen_test.mocks.dart index a3b1db13..d5110922 100644 --- a/test/measurements/measurement_categories_screen_test.mocks.dart +++ b/test/measurements/measurement_categories_screen_test.mocks.dart @@ -26,14 +26,12 @@ 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) : super(parent, parentInvocation); } -class _FakeMeasurementCategory_1 extends _i1.SmartFake - implements _i3.MeasurementCategory { +class _FakeMeasurementCategory_1 extends _i1.SmartFake implements _i3.MeasurementCategory { _FakeMeasurementCategory_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } @@ -41,8 +39,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); } @@ -68,8 +65,7 @@ class MockMeasurementProvider extends _i1.Mock @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/nutrition/nutritional_meal_form_test.mocks.dart b/test/nutrition/nutritional_meal_form_test.mocks.dart index 3d955f61..5354395b 100644 --- a/test/nutrition/nutritional_meal_form_test.mocks.dart +++ b/test/nutrition/nutritional_meal_form_test.mocks.dart @@ -29,44 +29,37 @@ 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) : super(parent, parentInvocation); } -class _FakeIngredientDatabase_1 extends _i1.SmartFake - implements _i3.IngredientDatabase { +class _FakeIngredientDatabase_1 extends _i1.SmartFake implements _i3.IngredientDatabase { _FakeIngredientDatabase_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeNutritionalPlan_2 extends _i1.SmartFake - implements _i4.NutritionalPlan { +class _FakeNutritionalPlan_2 extends _i1.SmartFake implements _i4.NutritionalPlan { _FakeNutritionalPlan_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMeal_3 extends _i1.SmartFake implements _i5.Meal { - _FakeMeal_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMeal_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMealItem_4 extends _i1.SmartFake implements _i6.MealItem { - _FakeMealItem_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMealItem_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeIngredient_5 extends _i1.SmartFake implements _i7.Ingredient { - _FakeIngredient_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeIngredient_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// 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); } @@ -123,8 +116,7 @@ class MockNutritionPlansProvider extends _i1.Mock @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/nutrition/nutritional_plan_form_test.mocks.dart b/test/nutrition/nutritional_plan_form_test.mocks.dart index b2413e94..5f854e56 100644 --- a/test/nutrition/nutritional_plan_form_test.mocks.dart +++ b/test/nutrition/nutritional_plan_form_test.mocks.dart @@ -29,44 +29,37 @@ 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) : super(parent, parentInvocation); } -class _FakeIngredientDatabase_1 extends _i1.SmartFake - implements _i3.IngredientDatabase { +class _FakeIngredientDatabase_1 extends _i1.SmartFake implements _i3.IngredientDatabase { _FakeIngredientDatabase_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeNutritionalPlan_2 extends _i1.SmartFake - implements _i4.NutritionalPlan { +class _FakeNutritionalPlan_2 extends _i1.SmartFake implements _i4.NutritionalPlan { _FakeNutritionalPlan_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMeal_3 extends _i1.SmartFake implements _i5.Meal { - _FakeMeal_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMeal_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMealItem_4 extends _i1.SmartFake implements _i6.MealItem { - _FakeMealItem_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMealItem_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeIngredient_5 extends _i1.SmartFake implements _i7.Ingredient { - _FakeIngredient_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeIngredient_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// 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); } @@ -123,8 +116,7 @@ class MockNutritionPlansProvider extends _i1.Mock @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/nutrition/nutritional_plan_screen_test.mocks.dart b/test/nutrition/nutritional_plan_screen_test.mocks.dart index a4d7d927..3bf866a9 100644 --- a/test/nutrition/nutritional_plan_screen_test.mocks.dart +++ b/test/nutrition/nutritional_plan_screen_test.mocks.dart @@ -30,27 +30,22 @@ import 'package:wger/providers/base_provider.dart' as _i4; // ignore_for_file: subtype_of_sealed_class class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider { - _FakeAuthProvider_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeClient_1 extends _i1.SmartFake implements _i3.Client { - _FakeClient_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeUri_2 extends _i1.SmartFake implements Uri { - _FakeUri_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { - _FakeResponse_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeStreamedResponse_4 extends _i1.SmartFake - implements _i3.StreamedResponse { +class _FakeStreamedResponse_4 extends _i1.SmartFake implements _i3.StreamedResponse { _FakeStreamedResponse_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } @@ -212,13 +207,10 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider { @override bool get dataInit => - (super.noSuchMethod(Invocation.getter(#dataInit), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#dataInit), returnValue: false) as bool); @override - bool get isAuth => - (super.noSuchMethod(Invocation.getter(#isAuth), returnValue: false) - as bool); + bool get isAuth => (super.noSuchMethod(Invocation.getter(#isAuth), returnValue: false) as bool); @override set token(String? _token) => super.noSuchMethod( @@ -239,11 +231,10 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider { ); @override - set applicationVersion(_i6.PackageInfo? _applicationVersion) => - super.noSuchMethod( - Invocation.setter(#applicationVersion, _applicationVersion), - returnValueForMissingStub: null, - ); + set applicationVersion(_i6.PackageInfo? _applicationVersion) => super.noSuchMethod( + Invocation.setter(#applicationVersion, _applicationVersion), + returnValueForMissingStub: null, + ); @override set metadata(Map? _metadata) => super.noSuchMethod( @@ -271,8 +262,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider { @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override _i5.Future setServerVersion() => diff --git a/test/nutrition/nutritional_plans_screen_test.mocks.dart b/test/nutrition/nutritional_plans_screen_test.mocks.dart index 0eee8615..504203fe 100644 --- a/test/nutrition/nutritional_plans_screen_test.mocks.dart +++ b/test/nutrition/nutritional_plans_screen_test.mocks.dart @@ -30,27 +30,22 @@ import 'package:wger/providers/base_provider.dart' as _i8; // ignore_for_file: subtype_of_sealed_class class _FakeClient_0 extends _i1.SmartFake implements _i2.Client { - _FakeClient_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeClient_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeAuthProvider_1 extends _i1.SmartFake implements _i3.AuthProvider { - _FakeAuthProvider_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeAuthProvider_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeUri_2 extends _i1.SmartFake implements Uri { - _FakeUri_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeResponse_3 extends _i1.SmartFake implements _i2.Response { - _FakeResponse_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeStreamedResponse_4 extends _i1.SmartFake - implements _i2.StreamedResponse { +class _FakeStreamedResponse_4 extends _i1.SmartFake implements _i2.StreamedResponse { _FakeStreamedResponse_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } @@ -89,13 +84,10 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider { @override bool get dataInit => - (super.noSuchMethod(Invocation.getter(#dataInit), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#dataInit), returnValue: false) as bool); @override - bool get isAuth => - (super.noSuchMethod(Invocation.getter(#isAuth), returnValue: false) - as bool); + bool get isAuth => (super.noSuchMethod(Invocation.getter(#isAuth), returnValue: false) as bool); @override set token(String? _token) => super.noSuchMethod( @@ -116,11 +108,10 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider { ); @override - set applicationVersion(_i4.PackageInfo? _applicationVersion) => - super.noSuchMethod( - Invocation.setter(#applicationVersion, _applicationVersion), - returnValueForMissingStub: null, - ); + set applicationVersion(_i4.PackageInfo? _applicationVersion) => super.noSuchMethod( + Invocation.setter(#applicationVersion, _applicationVersion), + returnValueForMissingStub: null, + ); @override set metadata(Map? _metadata) => super.noSuchMethod( @@ -148,8 +139,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider { @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override _i5.Future setServerVersion() => diff --git a/test/other/base_provider_test.mocks.dart b/test/other/base_provider_test.mocks.dart index 11feb4a5..e2d63e28 100644 --- a/test/other/base_provider_test.mocks.dart +++ b/test/other/base_provider_test.mocks.dart @@ -26,12 +26,10 @@ import 'package:mockito/src/dummies.dart' as _i5; // ignore_for_file: subtype_of_sealed_class class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response { - _FakeResponse_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeResponse_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeStreamedResponse_1 extends _i1.SmartFake - implements _i2.StreamedResponse { +class _FakeStreamedResponse_1 extends _i1.SmartFake implements _i2.StreamedResponse { _FakeStreamedResponse_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } diff --git a/test/routine/day_form_test.mocks.dart b/test/routine/day_form_test.mocks.dart index 87245999..56b69c61 100644 --- a/test/routine/day_form_test.mocks.dart +++ b/test/routine/day_form_test.mocks.dart @@ -36,57 +36,47 @@ import 'package:wger/providers/routines.dart' as _i12; // 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) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake - implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -167,16 +157,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => - super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/routine/forms/session_form_test.mocks.dart b/test/routine/forms/session_form_test.mocks.dart index d7e318dd..89bc37be 100644 --- a/test/routine/forms/session_form_test.mocks.dart +++ b/test/routine/forms/session_form_test.mocks.dart @@ -36,57 +36,47 @@ import 'package:wger/providers/routines.dart' as _i12; // 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) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake - implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -167,16 +157,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => - super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/routine/gym_mode_screen_test.mocks.dart b/test/routine/gym_mode_screen_test.mocks.dart index ab46ba31..d19125f8 100644 --- a/test/routine/gym_mode_screen_test.mocks.dart +++ b/test/routine/gym_mode_screen_test.mocks.dart @@ -45,108 +45,88 @@ import 'package:wger/providers/routines.dart' as _i23; // ignore_for_file: subtype_of_sealed_class class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider { - _FakeAuthProvider_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeClient_1 extends _i1.SmartFake implements _i3.Client { - _FakeClient_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeUri_2 extends _i1.SmartFake implements Uri { - _FakeUri_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { - _FakeResponse_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWgerBaseProvider_4 extends _i1.SmartFake - implements _i4.WgerBaseProvider { +class _FakeWgerBaseProvider_4 extends _i1.SmartFake implements _i4.WgerBaseProvider { _FakeWgerBaseProvider_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeExerciseDatabase_5 extends _i1.SmartFake - implements _i5.ExerciseDatabase { +class _FakeExerciseDatabase_5 extends _i1.SmartFake implements _i5.ExerciseDatabase { _FakeExerciseDatabase_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeExercise_6 extends _i1.SmartFake implements _i6.Exercise { - _FakeExercise_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeExercise_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeExerciseCategory_7 extends _i1.SmartFake - implements _i7.ExerciseCategory { +class _FakeExerciseCategory_7 extends _i1.SmartFake implements _i7.ExerciseCategory { _FakeExerciseCategory_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeEquipment_8 extends _i1.SmartFake implements _i8.Equipment { - _FakeEquipment_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeEquipment_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMuscle_9 extends _i1.SmartFake implements _i9.Muscle { - _FakeMuscle_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMuscle_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLanguage_10 extends _i1.SmartFake implements _i10.Language { - _FakeLanguage_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLanguage_10(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeWeightUnit_11 extends _i1.SmartFake implements _i11.WeightUnit { - _FakeWeightUnit_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWeightUnit_11(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeRepetitionUnit_12 extends _i1.SmartFake - implements _i12.RepetitionUnit { +class _FakeRepetitionUnit_12 extends _i1.SmartFake implements _i12.RepetitionUnit { _FakeRepetitionUnit_12(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_13 extends _i1.SmartFake implements _i13.Routine { - _FakeRoutine_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeRoutine_13(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeDay_14 extends _i1.SmartFake implements _i14.Day { - _FakeDay_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDay_14(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlot_15 extends _i1.SmartFake implements _i15.Slot { - _FakeSlot_15(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlot_15(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlotEntry_16 extends _i1.SmartFake implements _i16.SlotEntry { - _FakeSlotEntry_16(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlotEntry_16(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeBaseConfig_17 extends _i1.SmartFake implements _i17.BaseConfig { - _FakeBaseConfig_17(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseConfig_17(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWorkoutSession_18 extends _i1.SmartFake - implements _i18.WorkoutSession { +class _FakeWorkoutSession_18 extends _i1.SmartFake implements _i18.WorkoutSession { _FakeWorkoutSession_18(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_19 extends _i1.SmartFake implements _i19.Log { - _FakeLog_19(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLog_19(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [WgerBaseProvider]. @@ -374,11 +354,10 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { ); @override - set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => - super.noSuchMethod( - Invocation.setter(#filteredExercises, newFilteredExercises), - returnValueForMissingStub: null, - ); + set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => super.noSuchMethod( + Invocation.setter(#filteredExercises, newFilteredExercises), + returnValueForMissingStub: null, + ); @override set languages(List<_i10.Language>? languages) => super.noSuchMethod( @@ -388,8 +367,7 @@ class MockExercisesProvider extends _i1.Mock implements _i21.ExercisesProvider { @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override _i20.Future setFilters(_i21.Filters? newFilters) => @@ -777,16 +755,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i23.RoutinesProvider { ); @override - set repetitionUnits(List<_i12.RepetitionUnit>? repetitionUnits) => - super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i12.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/routine/gym_mode_session_screen_test.mocks.dart b/test/routine/gym_mode_session_screen_test.mocks.dart index 43460e2c..6c2c6964 100644 --- a/test/routine/gym_mode_session_screen_test.mocks.dart +++ b/test/routine/gym_mode_session_screen_test.mocks.dart @@ -36,57 +36,47 @@ import 'package:wger/providers/routines.dart' as _i12; // 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) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake - implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -167,16 +157,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => - super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/routine/repetition_unit_form_widget_test.mocks.dart b/test/routine/repetition_unit_form_widget_test.mocks.dart index 07693867..601de390 100644 --- a/test/routine/repetition_unit_form_widget_test.mocks.dart +++ b/test/routine/repetition_unit_form_widget_test.mocks.dart @@ -36,57 +36,47 @@ import 'package:wger/providers/routines.dart' as _i12; // 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) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake - implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -167,16 +157,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => - super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/routine/routine_edit_screen_test.mocks.dart b/test/routine/routine_edit_screen_test.mocks.dart index f486f7b9..a9bda573 100644 --- a/test/routine/routine_edit_screen_test.mocks.dart +++ b/test/routine/routine_edit_screen_test.mocks.dart @@ -36,57 +36,47 @@ import 'package:wger/providers/routines.dart' as _i12; // 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) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake - implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -167,16 +157,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => - super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/routine/routine_edit_test.mocks.dart b/test/routine/routine_edit_test.mocks.dart index ae62e6b0..8acac819 100644 --- a/test/routine/routine_edit_test.mocks.dart +++ b/test/routine/routine_edit_test.mocks.dart @@ -36,57 +36,47 @@ import 'package:wger/providers/routines.dart' as _i12; // 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) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake - implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -167,16 +157,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => - super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/routine/routine_form_test.mocks.dart b/test/routine/routine_form_test.mocks.dart index 1c7158e6..ccda27b4 100644 --- a/test/routine/routine_form_test.mocks.dart +++ b/test/routine/routine_form_test.mocks.dart @@ -36,57 +36,47 @@ import 'package:wger/providers/routines.dart' as _i12; // 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) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake - implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -167,16 +157,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => - super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/routine/routine_logs_screen_test.mocks.dart b/test/routine/routine_logs_screen_test.mocks.dart index 5eaed5da..da42a068 100644 --- a/test/routine/routine_logs_screen_test.mocks.dart +++ b/test/routine/routine_logs_screen_test.mocks.dart @@ -36,57 +36,47 @@ import 'package:wger/providers/routines.dart' as _i12; // 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) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake - implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -167,16 +157,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => - super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/routine/routine_screen_test.mocks.dart b/test/routine/routine_screen_test.mocks.dart index de59b077..0f41767a 100644 --- a/test/routine/routine_screen_test.mocks.dart +++ b/test/routine/routine_screen_test.mocks.dart @@ -25,23 +25,19 @@ import 'package:wger/providers/base_provider.dart' as _i4; // ignore_for_file: subtype_of_sealed_class class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider { - _FakeAuthProvider_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeClient_1 extends _i1.SmartFake implements _i3.Client { - _FakeClient_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeUri_2 extends _i1.SmartFake implements Uri { - _FakeUri_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { - _FakeResponse_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [WgerBaseProvider]. diff --git a/test/routine/routines_provider_test.mocks.dart b/test/routine/routines_provider_test.mocks.dart index 6a756b7b..e0309339 100644 --- a/test/routine/routines_provider_test.mocks.dart +++ b/test/routine/routines_provider_test.mocks.dart @@ -33,61 +33,50 @@ import 'package:wger/providers/exercises.dart' as _i12; // ignore_for_file: subtype_of_sealed_class class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider { - _FakeAuthProvider_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeClient_1 extends _i1.SmartFake implements _i3.Client { - _FakeClient_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeUri_2 extends _i1.SmartFake implements Uri { - _FakeUri_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { - _FakeResponse_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWgerBaseProvider_4 extends _i1.SmartFake - implements _i4.WgerBaseProvider { +class _FakeWgerBaseProvider_4 extends _i1.SmartFake implements _i4.WgerBaseProvider { _FakeWgerBaseProvider_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeExerciseDatabase_5 extends _i1.SmartFake - implements _i5.ExerciseDatabase { +class _FakeExerciseDatabase_5 extends _i1.SmartFake implements _i5.ExerciseDatabase { _FakeExerciseDatabase_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeExercise_6 extends _i1.SmartFake implements _i6.Exercise { - _FakeExercise_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeExercise_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeExerciseCategory_7 extends _i1.SmartFake - implements _i7.ExerciseCategory { +class _FakeExerciseCategory_7 extends _i1.SmartFake implements _i7.ExerciseCategory { _FakeExerciseCategory_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeEquipment_8 extends _i1.SmartFake implements _i8.Equipment { - _FakeEquipment_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeEquipment_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMuscle_9 extends _i1.SmartFake implements _i9.Muscle { - _FakeMuscle_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMuscle_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLanguage_10 extends _i1.SmartFake implements _i10.Language { - _FakeLanguage_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLanguage_10(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [WgerBaseProvider]. @@ -315,11 +304,10 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { ); @override - set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => - super.noSuchMethod( - Invocation.setter(#filteredExercises, newFilteredExercises), - returnValueForMissingStub: null, - ); + set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => super.noSuchMethod( + Invocation.setter(#filteredExercises, newFilteredExercises), + returnValueForMissingStub: null, + ); @override set languages(List<_i10.Language>? languages) => super.noSuchMethod( @@ -329,8 +317,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override _i11.Future setFilters(_i12.Filters? newFilters) => diff --git a/test/routine/routines_screen_test.mocks.dart b/test/routine/routines_screen_test.mocks.dart index 534b4ac8..6e905b79 100644 --- a/test/routine/routines_screen_test.mocks.dart +++ b/test/routine/routines_screen_test.mocks.dart @@ -25,23 +25,19 @@ import 'package:wger/providers/base_provider.dart' as _i4; // ignore_for_file: subtype_of_sealed_class class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider { - _FakeAuthProvider_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeClient_1 extends _i1.SmartFake implements _i3.Client { - _FakeClient_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeUri_2 extends _i1.SmartFake implements Uri { - _FakeUri_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { - _FakeResponse_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [WgerBaseProvider]. diff --git a/test/routine/slot_entry_form_test.mocks.dart b/test/routine/slot_entry_form_test.mocks.dart index d9e4d721..87fefd78 100644 --- a/test/routine/slot_entry_form_test.mocks.dart +++ b/test/routine/slot_entry_form_test.mocks.dart @@ -36,57 +36,47 @@ import 'package:wger/providers/routines.dart' as _i12; // 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) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake - implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -167,16 +157,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => - super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/routine/weight_unit_form_widget_test.mocks.dart b/test/routine/weight_unit_form_widget_test.mocks.dart index 8f8c332c..2e031632 100644 --- a/test/routine/weight_unit_form_widget_test.mocks.dart +++ b/test/routine/weight_unit_form_widget_test.mocks.dart @@ -36,57 +36,47 @@ import 'package:wger/providers/routines.dart' as _i12; // 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) : super(parent, parentInvocation); } class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { - _FakeRoutine_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { - _FakeSlot_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { - _FakeSlotEntry_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { - _FakeBaseConfig_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWorkoutSession_8 extends _i1.SmartFake - implements _i10.WorkoutSession { +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { - _FakeLog_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [RoutinesProvider]. @@ -167,16 +157,14 @@ class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { ); @override - set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => - super.noSuchMethod( - Invocation.setter(#repetitionUnits, repetitionUnits), - returnValueForMissingStub: null, - ); + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( diff --git a/test/weight/weight_screen_test.mocks.dart b/test/weight/weight_screen_test.mocks.dart index c333a2cb..867aeba5 100644 --- a/test/weight/weight_screen_test.mocks.dart +++ b/test/weight/weight_screen_test.mocks.dart @@ -33,43 +33,36 @@ import 'package:wger/providers/user.dart' as _i9; // 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) : super(parent, parentInvocation); } -class _FakeSharedPreferencesAsync_1 extends _i1.SmartFake - implements _i3.SharedPreferencesAsync { +class _FakeSharedPreferencesAsync_1 extends _i1.SmartFake implements _i3.SharedPreferencesAsync { _FakeSharedPreferencesAsync_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeIngredientDatabase_2 extends _i1.SmartFake - implements _i4.IngredientDatabase { +class _FakeIngredientDatabase_2 extends _i1.SmartFake implements _i4.IngredientDatabase { _FakeIngredientDatabase_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeNutritionalPlan_3 extends _i1.SmartFake - implements _i5.NutritionalPlan { +class _FakeNutritionalPlan_3 extends _i1.SmartFake implements _i5.NutritionalPlan { _FakeNutritionalPlan_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMeal_4 extends _i1.SmartFake implements _i6.Meal { - _FakeMeal_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMeal_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeMealItem_5 extends _i1.SmartFake implements _i7.MealItem { - _FakeMealItem_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeMealItem_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeIngredient_6 extends _i1.SmartFake implements _i8.Ingredient { - _FakeIngredient_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeIngredient_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [UserProvider]. @@ -130,8 +123,7 @@ class MockUserProvider extends _i1.Mock implements _i9.UserProvider { @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod( @@ -200,8 +192,7 @@ class MockUserProvider extends _i1.Mock implements _i9.UserProvider { /// A class which mocks [NutritionPlansProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockNutritionPlansProvider extends _i1.Mock - implements _i14.NutritionPlansProvider { +class MockNutritionPlansProvider extends _i1.Mock implements _i14.NutritionPlansProvider { MockNutritionPlansProvider() { _i1.throwOnMissingStub(this); } @@ -258,8 +249,7 @@ class MockNutritionPlansProvider extends _i1.Mock @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override void clear() => super.noSuchMethod(