diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index c9ade366..e3aecf65 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -10,8 +10,8 @@
-
+
diff --git a/lib/models/measurements/measurement_category.dart b/lib/models/measurements/measurement_category.dart
index 2674e0c7..17dde893 100644
--- a/lib/models/measurements/measurement_category.dart
+++ b/lib/models/measurements/measurement_category.dart
@@ -1,6 +1,5 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
-import 'package:uuid/uuid.dart';
import 'package:wger/exceptions/no_such_entry_exception.dart';
import 'package:wger/models/measurements/measurement_entry.dart';
@@ -11,9 +10,6 @@ class MeasurementCategory extends Equatable {
@JsonKey(required: true)
final int? id;
- @JsonKey(required: true)
- final String? uuid;
-
@JsonKey(required: true)
final String name;
@@ -23,38 +19,35 @@ class MeasurementCategory extends Equatable {
@JsonKey(required: true)
final String unit;
- @JsonKey(required: true)
- final String source;
+ @JsonKey(required: true, name: 'externally_synced')
+ final bool externallySynced;
- @JsonKey(defaultValue: [], toJson: _nullValue)
+ @JsonKey(toJson: _nullValue)
final List entries;
- MeasurementCategory({
+ const MeasurementCategory({
this.id,
required this.name,
required this.unit,
this.entries = const [],
this.internalName,
- this.source = 'manual',
- String? uuid,
- }) : uuid = uuid ?? const Uuid().v7();
+ this.externallySynced = false,
+ });
MeasurementCategory copyWith({
int? id,
- String? uuid,
String? name,
String? internalName,
String? unit,
- String? source,
+ bool? externallySynced,
List? entries,
}) {
return MeasurementCategory(
id: id ?? this.id,
- uuid: uuid ?? this.uuid,
name: name ?? this.name,
internalName: internalName ?? this.internalName,
unit: unit ?? this.unit,
- source: source ?? this.source,
+ externallySynced: externallySynced ?? this.externallySynced,
entries: entries ?? this.entries,
);
}
@@ -66,10 +59,6 @@ class MeasurementCategory extends Equatable {
);
}
- bool get isExternal => source != 'manual';
-
- bool get isInternal => source == 'manual';
-
// Boilerplate
factory MeasurementCategory.fromJson(Map json) =>
_$MeasurementCategoryFromJson(json);
diff --git a/lib/models/measurements/measurement_category.g.dart b/lib/models/measurements/measurement_category.g.dart
index 8abe2f26..2790ba71 100644
--- a/lib/models/measurements/measurement_category.g.dart
+++ b/lib/models/measurements/measurement_category.g.dart
@@ -7,7 +7,10 @@ part of 'measurement_category.dart';
// **************************************************************************
MeasurementCategory _$MeasurementCategoryFromJson(Map json) {
- $checkKeys(json, requiredKeys: const ['id', 'uuid', 'name', 'internal_name', 'unit', 'source']);
+ $checkKeys(
+ json,
+ requiredKeys: const ['id', 'name', 'internal_name', 'unit', 'externally_synced'],
+ );
return MeasurementCategory(
id: (json['id'] as num?)?.toInt(),
name: json['name'] as String,
@@ -16,19 +19,17 @@ MeasurementCategory _$MeasurementCategoryFromJson(Map json) {
(json['entries'] as List?)
?.map((e) => MeasurementEntry.fromJson(e as Map))
.toList() ??
- [],
+ const [],
internalName: json['internal_name'] as String?,
- source: json['source'] as String? ?? 'manual',
- uuid: json['uuid'] as String?,
+ externallySynced: json['externally_synced'] as bool? ?? false,
);
}
Map _$MeasurementCategoryToJson(MeasurementCategory instance) => {
'id': instance.id,
- 'uuid': instance.uuid,
'name': instance.name,
'internal_name': instance.internalName,
'unit': instance.unit,
- 'source': instance.source,
+ 'externally_synced': instance.externallySynced,
'entries': MeasurementCategory._nullValue(instance.entries),
};
diff --git a/lib/providers/measurement.dart b/lib/providers/measurement.dart
index e4925565..bd650d60 100644
--- a/lib/providers/measurement.dart
+++ b/lib/providers/measurement.dart
@@ -146,7 +146,7 @@ class MeasurementProvider with ChangeNotifier {
final Uri postUri = baseProvider.makeUrl(_entryUrl);
final Map newEntryMap = await baseProvider.post(entry.toJson(), postUri);
- final MeasurementEntry newEntry = MeasurementEntry.fromJson(newEntryMap);
+ final newEntry = MeasurementEntry.fromJson(newEntryMap);
final MeasurementCategory category = findCategoryById(newEntry.category);
diff --git a/lib/screens/health_service.dart b/lib/screens/health_service.dart
index f99bc4ca..6214b55e 100644
--- a/lib/screens/health_service.dart
+++ b/lib/screens/health_service.dart
@@ -33,7 +33,7 @@ class HealthService {
try {
final granted = await health.requestAuthorization(types, permissions: permissions);
if (granted) {
- await _syncHistoricalData();
+ await syncHistoricalData();
}
provider.setConnected(granted);
provider.setLoading(false);
@@ -59,10 +59,56 @@ class HealthService {
}
}
- String internalNameForType(HealthDataType type) {
+ static String internalNameForType(HealthDataType type) {
return type.toString().split('.').last.toLowerCase();
}
+ // TODO: i18n
+ String displayNameForType(HealthDataType type) {
+ switch (type) {
+ case HealthDataType.HEART_RATE:
+ return 'Heart Rate';
+ case HealthDataType.STEPS:
+ return 'Steps';
+ case HealthDataType.ACTIVE_ENERGY_BURNED:
+ return 'Active Energy Burned';
+ case HealthDataType.SLEEP_ASLEEP:
+ return 'Sleep Asleep';
+ case HealthDataType.DISTANCE_DELTA:
+ return 'Distance';
+ default:
+ return internalNameForType(type);
+ }
+ }
+
+ // TODO: i18n
+ String unitForType(HealthDataType type) {
+ switch (type) {
+ case HealthDataType.HEART_RATE:
+ return 'bpm';
+ case HealthDataType.STEPS:
+ return 'steps';
+ case HealthDataType.ACTIVE_ENERGY_BURNED:
+ return 'kcal';
+ case HealthDataType.SLEEP_ASLEEP:
+ return 'minutes';
+ case HealthDataType.DISTANCE_DELTA:
+ return 'm';
+ default:
+ return '';
+ }
+ }
+
+ String sourceForPlatform() {
+ if (Platform.isAndroid) {
+ return 'google_health';
+ }
+ if (Platform.isIOS) {
+ return 'apple_health';
+ }
+ return '';
+ }
+
/// Ensures all required categories for the given HealthDataTypes exist in MeasurementProvider
Future _ensureCategoriesExist(List types) async {
// Only run on Android and iOS
@@ -72,46 +118,6 @@ class HealthService {
await measurementProvider.fetchAndSetCategories();
final existingCategories = measurementProvider.categories;
- String displayNameForType(HealthDataType type) {
- switch (type) {
- case HealthDataType.HEART_RATE:
- return 'Heart Rate';
- case HealthDataType.STEPS:
- return 'Steps';
- case HealthDataType.ACTIVE_ENERGY_BURNED:
- return 'Active Energy Burned';
- case HealthDataType.SLEEP_ASLEEP:
- return 'Sleep Asleep';
- case HealthDataType.DISTANCE_DELTA:
- return 'Distance';
- default:
- return internalNameForType(type);
- }
- }
-
- String unitForType(HealthDataType type) {
- switch (type) {
- case HealthDataType.HEART_RATE:
- return 'bpm';
- case HealthDataType.STEPS:
- return 'steps';
- case HealthDataType.ACTIVE_ENERGY_BURNED:
- return 'kcal';
- case HealthDataType.SLEEP_ASLEEP:
- return 'minutes';
- case HealthDataType.DISTANCE_DELTA:
- return 'm';
- default:
- return '';
- }
- }
-
- String sourceForPlatform() {
- if (Platform.isAndroid) return 'google_health';
- if (Platform.isIOS) return 'apple_health';
- return '';
- }
-
for (final type in types) {
final internalName = internalNameForType(type);
final exists = existingCategories.any((cat) => cat.internalName == internalName);
@@ -121,7 +127,7 @@ class HealthService {
name: displayNameForType(type),
internalName: internalName,
unit: unitForType(type),
- source: sourceForPlatform(),
+ externallySynced: true,
),
);
}
@@ -129,9 +135,12 @@ class HealthService {
}
/// Fetch historical health data for the last 30 days
- Future _syncHistoricalData() async {
+ Future syncHistoricalData() async {
+ provider.setLoading(true);
+ provider.setError(null);
+
final now = DateTime.now();
- final startTime = now.subtract(const Duration(days: 30));
+ final startTime = now.subtract(const Duration(days: 5));
final types = [
HealthDataType.HEART_RATE,
HealthDataType.STEPS,
@@ -152,48 +161,38 @@ class HealthService {
types: types,
);
final entries = dataPoints.map((point) {
- String unit;
- switch (point.type) {
- case HealthDataType.HEART_RATE:
- unit = 'bpm';
- break;
- case HealthDataType.STEPS:
- unit = 'steps';
- break;
- case HealthDataType.ACTIVE_ENERGY_BURNED:
- unit = 'kcal';
- break;
- case HealthDataType.SLEEP_ASLEEP:
- unit = 'minutes';
- break;
- case HealthDataType.DISTANCE_DELTA:
- unit = 'm';
- break;
- default:
- unit = point.unitString ?? '';
- }
- // Kategorie-ID dynamisch suchen
+ final unit = unitForType(point.type);
final internalName = internalNameForType(point.type);
final category = updatedCategories.firstWhere(
(cat) => cat.internalName == internalName,
orElse: () => throw Exception('No category for $internalName'),
);
+ final value = point.value is NumericHealthValue
+ ? (point.value as NumericHealthValue).numericValue
+ : 0;
+ if (value is! NumericHealthValue) {
+ _logger.warning('Skipping non-numeric value for ${point.type}: ${point.value}');
+ }
+ //final value = point.value is NumericHealthValue ? point.value : 0;
return MeasurementEntry(
id: null,
category: category.id!,
date: point.dateFrom,
- value: 3,
- // value: point.value,
+ value: value,
notes: unit,
source: point.sourceName ?? 'health_platform',
uuid: point.uuid ?? null,
created: DateTime.now(),
);
}).toList();
+ _logger.info('Created ${entries.length} entries');
await measurementProvider.addEntries(entries);
- } catch (e) {
+ } catch (e, stackTrace) {
_logger.warning('Error syncing historical health data: $e');
+ _logger.warning(stackTrace);
provider.setError('Error syncing historical health data: $e');
+ } finally {
+ provider.setLoading(false);
}
}
}
diff --git a/lib/screens/health_settings_screen.dart b/lib/screens/health_settings_screen.dart
index b63cf84a..fad25ecb 100644
--- a/lib/screens/health_settings_screen.dart
+++ b/lib/screens/health_settings_screen.dart
@@ -32,19 +32,47 @@ class _HealthSettingsScreenState extends State {
final measurementProvider = Provider.of(context, listen: false);
healthService = HealthService(provider, measurementProvider);
return Scaffold(
- appBar: AppBar(title: const Text('Health Data Connection')),
+ appBar: AppBar(title: const Text('Health Connect')),
body: Center(
child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
+ mainAxisSize: MainAxisSize.max,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ spacing: 8,
children: [
- SizedBox(
- width: 220,
- height: 48,
- child: ElevatedButton(
- onPressed: provider.isLoading || provider.isConnected
+ const Icon(Icons.sync, size: 50),
+ Text(
+ 'Sync your health data with wger',
+ style: Theme.of(context).textTheme.headlineMedium,
+ ),
+ const Text(
+ 'You can sync data from Android Health or Apple Health to wger, the '
+ 'data will be imported as measurements. You can choose which data to '
+ 'sync in the next step.',
+ ),
+ const Text('To stop syncing, disconnect in the settings.'),
+ ElevatedButton(
+ onPressed: provider.isLoading || provider.isConnected
+ ? null
+ : () async {
+ await healthService.requestPermissions();
+ },
+ child: provider.isLoading
+ ? const SizedBox(
+ width: 24,
+ height: 24,
+ child: CircularProgressIndicator(
+ strokeWidth: 2,
+ valueColor: AlwaysStoppedAnimation(Colors.white),
+ ),
+ )
+ : Text(provider.isConnected ? 'Connected' : 'Connect to Health Data'),
+ ),
+ if (provider.isConnected)
+ ElevatedButton(
+ onPressed: provider.isLoading
? null
: () async {
- await healthService.requestPermissions();
+ await healthService.syncHistoricalData();
},
child: provider.isLoading
? const SizedBox(
@@ -55,9 +83,8 @@ class _HealthSettingsScreenState extends State {
valueColor: AlwaysStoppedAnimation(Colors.white),
),
)
- : Text(provider.isConnected ? 'Connected' : 'Connect to Health Data'),
+ : Text('Fetch data'),
),
- ),
if (provider.errorMessage != null)
Padding(
padding: const EdgeInsets.only(top: 16.0),
diff --git a/lib/screens/measurement_entries_screen.dart b/lib/screens/measurement_entries_screen.dart
index a575029a..af035b5d 100644
--- a/lib/screens/measurement_entries_screen.dart
+++ b/lib/screens/measurement_entries_screen.dart
@@ -114,7 +114,7 @@ class MeasurementEntriesScreen extends StatelessWidget {
),
],
),
- floatingActionButton: category.isInternal
+ floatingActionButton: category.externallySynced
? FloatingActionButton(
child: const Icon(Icons.add, color: Colors.white),
onPressed: () {
diff --git a/lib/widgets/measurements/categories_card.dart b/lib/widgets/measurements/categories_card.dart
index 85ace2e5..2e22bd96 100644
--- a/lib/widgets/measurements/categories_card.dart
+++ b/lib/widgets/measurements/categories_card.dart
@@ -30,10 +30,14 @@ class CategoriesCard extends StatelessWidget {
padding: const EdgeInsets.only(top: 5),
child: Text(currentCategory.name, style: Theme.of(context).textTheme.titleLarge),
),
- Padding(
- padding: const EdgeInsets.only(top: 5),
- child: Text('Externally synchronized', style: Theme.of(context).textTheme.titleSmall),
- ),
+ if (currentCategory.externallySynced)
+ Padding(
+ padding: const EdgeInsets.only(top: 5),
+ child: Text(
+ 'Externally synchronized',
+ style: Theme.of(context).textTheme.titleSmall,
+ ),
+ ),
Container(
padding: const EdgeInsets.all(10),
height: 220,
@@ -59,7 +63,7 @@ class CategoriesCard extends StatelessWidget {
);
},
),
- if (currentCategory.isInternal)
+ if (!currentCategory.externallySynced)
IconButton(
onPressed: () async {
await Navigator.pushNamed(
diff --git a/test/auth/auth_screen_test.mocks.dart b/test/auth/auth_screen_test.mocks.dart
index 3d3e2163..f303de9d 100644
--- a/test/auth/auth_screen_test.mocks.dart
+++ b/test/auth/auth_screen_test.mocks.dart
@@ -27,23 +27,12 @@ import 'package:mockito/src/dummies.dart' as _i5;
// ignore_for_file: invalid_use_of_internal_member
class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response {
- _FakeResponse_0(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeResponse_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeStreamedResponse_1 extends _i1.SmartFake implements _i2.StreamedResponse {
- _FakeStreamedResponse_1(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeStreamedResponse_1(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
/// A class which mocks [Client].
@@ -55,46 +44,24 @@ class MockClient extends _i1.Mock implements _i2.Client {
}
@override
- _i3.Future<_i2.Response> head(
- Uri? url, {
- Map? headers,
- }) =>
+ _i3.Future<_i2.Response> head(Uri? url, {Map? headers}) =>
(super.noSuchMethod(
- Invocation.method(
- #head,
- [url],
- {#headers: headers},
- ),
- returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
- this,
- Invocation.method(
- #head,
- [url],
- {#headers: headers},
- ),
- )),
- ) as _i3.Future<_i2.Response>);
+ Invocation.method(#head, [url], {#headers: headers}),
+ returnValue: _i3.Future<_i2.Response>.value(
+ _FakeResponse_0(this, Invocation.method(#head, [url], {#headers: headers})),
+ ),
+ )
+ as _i3.Future<_i2.Response>);
@override
- _i3.Future<_i2.Response> get(
- Uri? url, {
- Map? headers,
- }) =>
+ _i3.Future<_i2.Response> get(Uri? url, {Map? headers}) =>
(super.noSuchMethod(
- Invocation.method(
- #get,
- [url],
- {#headers: headers},
- ),
- returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
- this,
- Invocation.method(
- #get,
- [url],
- {#headers: headers},
- ),
- )),
- ) as _i3.Future<_i2.Response>);
+ Invocation.method(#get, [url], {#headers: headers}),
+ returnValue: _i3.Future<_i2.Response>.value(
+ _FakeResponse_0(this, Invocation.method(#get, [url], {#headers: headers})),
+ ),
+ )
+ as _i3.Future<_i2.Response>);
@override
_i3.Future<_i2.Response> post(
@@ -104,28 +71,19 @@ class MockClient extends _i1.Mock implements _i2.Client {
_i4.Encoding? encoding,
}) =>
(super.noSuchMethod(
- Invocation.method(
- #post,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
- this,
- Invocation.method(
- #post,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- )),
- ) as _i3.Future<_i2.Response>);
+ Invocation.method(#post, [url], {#headers: headers, #body: body, #encoding: encoding}),
+ returnValue: _i3.Future<_i2.Response>.value(
+ _FakeResponse_0(
+ this,
+ Invocation.method(
+ #post,
+ [url],
+ {#headers: headers, #body: body, #encoding: encoding},
+ ),
+ ),
+ ),
+ )
+ as _i3.Future<_i2.Response>);
@override
_i3.Future<_i2.Response> put(
@@ -135,28 +93,19 @@ class MockClient extends _i1.Mock implements _i2.Client {
_i4.Encoding? encoding,
}) =>
(super.noSuchMethod(
- Invocation.method(
- #put,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
- this,
- Invocation.method(
- #put,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- )),
- ) as _i3.Future<_i2.Response>);
+ Invocation.method(#put, [url], {#headers: headers, #body: body, #encoding: encoding}),
+ returnValue: _i3.Future<_i2.Response>.value(
+ _FakeResponse_0(
+ this,
+ Invocation.method(
+ #put,
+ [url],
+ {#headers: headers, #body: body, #encoding: encoding},
+ ),
+ ),
+ ),
+ )
+ as _i3.Future<_i2.Response>);
@override
_i3.Future<_i2.Response> patch(
@@ -166,28 +115,19 @@ class MockClient extends _i1.Mock implements _i2.Client {
_i4.Encoding? encoding,
}) =>
(super.noSuchMethod(
- Invocation.method(
- #patch,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
- this,
- Invocation.method(
- #patch,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- )),
- ) as _i3.Future<_i2.Response>);
+ Invocation.method(#patch, [url], {#headers: headers, #body: body, #encoding: encoding}),
+ returnValue: _i3.Future<_i2.Response>.value(
+ _FakeResponse_0(
+ this,
+ Invocation.method(
+ #patch,
+ [url],
+ {#headers: headers, #body: body, #encoding: encoding},
+ ),
+ ),
+ ),
+ )
+ as _i3.Future<_i2.Response>);
@override
_i3.Future<_i2.Response> delete(
@@ -197,85 +137,53 @@ class MockClient extends _i1.Mock implements _i2.Client {
_i4.Encoding? encoding,
}) =>
(super.noSuchMethod(
- Invocation.method(
- #delete,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
- this,
- Invocation.method(
- #delete,
- [url],
- {
- #headers: headers,
- #body: body,
- #encoding: encoding,
- },
- ),
- )),
- ) as _i3.Future<_i2.Response>);
+ Invocation.method(
+ #delete,
+ [url],
+ {#headers: headers, #body: body, #encoding: encoding},
+ ),
+ returnValue: _i3.Future<_i2.Response>.value(
+ _FakeResponse_0(
+ this,
+ Invocation.method(
+ #delete,
+ [url],
+ {#headers: headers, #body: body, #encoding: encoding},
+ ),
+ ),
+ ),
+ )
+ as _i3.Future<_i2.Response>);
@override
- _i3.Future read(
- Uri? url, {
- Map? headers,
- }) =>
+ _i3.Future read(Uri? url, {Map? headers}) =>
(super.noSuchMethod(
- Invocation.method(
- #read,
- [url],
- {#headers: headers},
- ),
- returnValue: _i3.Future.value(_i5.dummyValue(
- this,
- Invocation.method(
- #read,
- [url],
- {#headers: headers},
- ),
- )),
- ) as _i3.Future);
+ Invocation.method(#read, [url], {#headers: headers}),
+ returnValue: _i3.Future.value(
+ _i5.dummyValue(this, Invocation.method(#read, [url], {#headers: headers})),
+ ),
+ )
+ as _i3.Future);
@override
- _i3.Future<_i6.Uint8List> readBytes(
- Uri? url, {
- Map? headers,
- }) =>
+ _i3.Future<_i6.Uint8List> readBytes(Uri? url, {Map? headers}) =>
(super.noSuchMethod(
- Invocation.method(
- #readBytes,
- [url],
- {#headers: headers},
- ),
- returnValue: _i3.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
- ) as _i3.Future<_i6.Uint8List>);
+ Invocation.method(#readBytes, [url], {#headers: headers}),
+ returnValue: _i3.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
+ )
+ as _i3.Future<_i6.Uint8List>);
@override
- _i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod(
- Invocation.method(
- #send,
- [request],
- ),
- returnValue: _i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1(
- this,
- Invocation.method(
- #send,
- [request],
- ),
- )),
- ) as _i3.Future<_i2.StreamedResponse>);
+ _i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) =>
+ (super.noSuchMethod(
+ Invocation.method(#send, [request]),
+ returnValue: _i3.Future<_i2.StreamedResponse>.value(
+ _FakeStreamedResponse_1(this, Invocation.method(#send, [request])),
+ ),
+ )
+ as _i3.Future<_i2.StreamedResponse>);
@override
- void close() => super.noSuchMethod(
- Invocation.method(
- #close,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void close() =>
+ super.noSuchMethod(Invocation.method(#close, []), returnValueForMissingStub: null);
}
diff --git a/test/exercises/contribute_exercise_test.mocks.dart b/test/exercises/contribute_exercise_test.mocks.dart
index 25cee87e..0ad7e7b6 100644
--- a/test/exercises/contribute_exercise_test.mocks.dart
+++ b/test/exercises/contribute_exercise_test.mocks.dart
@@ -41,93 +41,43 @@ import 'package:wger/providers/user.dart' as _i17;
// ignore_for_file: invalid_use_of_internal_member
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
- _FakeWgerBaseProvider_0(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
class _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 {
- _FakeSharedPreferencesAsync_2(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeSharedPreferencesAsync_2(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
class _FakeExerciseDatabase_3 extends _i1.SmartFake implements _i5.ExerciseDatabase {
- _FakeExerciseDatabase_3(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _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 {
- _FakeExerciseCategory_5(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _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].
@@ -139,321 +89,218 @@ class MockAddExerciseProvider extends _i1.Mock implements _i11.AddExerciseProvid
}
@override
- _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
- Invocation.getter(#baseProvider),
- returnValue: _FakeWgerBaseProvider_0(
- this,
- Invocation.getter(#baseProvider),
- ),
- ) as _i2.WgerBaseProvider);
+ _i2.WgerBaseProvider get baseProvider =>
+ (super.noSuchMethod(
+ Invocation.getter(#baseProvider),
+ returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)),
+ )
+ as _i2.WgerBaseProvider);
@override
- List<_i12.File> get exerciseImages => (super.noSuchMethod(
- Invocation.getter(#exerciseImages),
- returnValue: <_i12.File>[],
- ) as List<_i12.File>);
+ List<_i12.File> get exerciseImages =>
+ (super.noSuchMethod(Invocation.getter(#exerciseImages), returnValue: <_i12.File>[])
+ as List<_i12.File>);
@override
- List get alternateNamesEn => (super.noSuchMethod(
- Invocation.getter(#alternateNamesEn),
- returnValue: [],
- ) as List);
+ List get alternateNamesEn =>
+ (super.noSuchMethod(Invocation.getter(#alternateNamesEn), returnValue: [])
+ as List);
@override
- List get alternateNamesTrans => (super.noSuchMethod(
- Invocation.getter(#alternateNamesTrans),
- returnValue: [],
- ) as List);
+ List get alternateNamesTrans =>
+ (super.noSuchMethod(Invocation.getter(#alternateNamesTrans), returnValue: [])
+ as List);
@override
- List<_i8.Equipment> get equipment => (super.noSuchMethod(
- Invocation.getter(#equipment),
- returnValue: <_i8.Equipment>[],
- ) as List<_i8.Equipment>);
+ List<_i8.Equipment> get equipment =>
+ (super.noSuchMethod(Invocation.getter(#equipment), returnValue: <_i8.Equipment>[])
+ as List<_i8.Equipment>);
@override
- bool get newVariation => (super.noSuchMethod(
- Invocation.getter(#newVariation),
- returnValue: false,
- ) as bool);
+ bool get newVariation =>
+ (super.noSuchMethod(Invocation.getter(#newVariation), returnValue: false) as bool);
@override
- _i3.Variation get variation => (super.noSuchMethod(
- Invocation.getter(#variation),
- returnValue: _FakeVariation_1(
- this,
- Invocation.getter(#variation),
- ),
- ) as _i3.Variation);
+ _i3.Variation get variation =>
+ (super.noSuchMethod(
+ Invocation.getter(#variation),
+ returnValue: _FakeVariation_1(this, Invocation.getter(#variation)),
+ )
+ as _i3.Variation);
@override
- List<_i9.Muscle> get primaryMuscles => (super.noSuchMethod(
- Invocation.getter(#primaryMuscles),
- returnValue: <_i9.Muscle>[],
- ) as List<_i9.Muscle>);
+ List<_i9.Muscle> get primaryMuscles =>
+ (super.noSuchMethod(Invocation.getter(#primaryMuscles), returnValue: <_i9.Muscle>[])
+ as List<_i9.Muscle>);
@override
- List<_i9.Muscle> get secondaryMuscles => (super.noSuchMethod(
- Invocation.getter(#secondaryMuscles),
- returnValue: <_i9.Muscle>[],
- ) as List<_i9.Muscle>);
+ List<_i9.Muscle> get secondaryMuscles =>
+ (super.noSuchMethod(Invocation.getter(#secondaryMuscles), returnValue: <_i9.Muscle>[])
+ as List<_i9.Muscle>);
@override
- _i13.ExerciseSubmissionApi get exerciseApiObject => (super.noSuchMethod(
- Invocation.getter(#exerciseApiObject),
- returnValue: _i14.dummyValue<_i13.ExerciseSubmissionApi>(
- this,
- Invocation.getter(#exerciseApiObject),
- ),
- ) as _i13.ExerciseSubmissionApi);
+ _i13.ExerciseSubmissionApi get exerciseApiObject =>
+ (super.noSuchMethod(
+ Invocation.getter(#exerciseApiObject),
+ returnValue: _i14.dummyValue<_i13.ExerciseSubmissionApi>(
+ this,
+ Invocation.getter(#exerciseApiObject),
+ ),
+ )
+ as _i13.ExerciseSubmissionApi);
@override
set exerciseNameEn(String? value) => super.noSuchMethod(
- Invocation.setter(
- #exerciseNameEn,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.setter(#exerciseNameEn, value),
+ returnValueForMissingStub: null,
+ );
@override
set exerciseNameTrans(String? value) => super.noSuchMethod(
- Invocation.setter(
- #exerciseNameTrans,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.setter(#exerciseNameTrans, value),
+ returnValueForMissingStub: null,
+ );
@override
- set descriptionEn(String? value) => super.noSuchMethod(
- Invocation.setter(
- #descriptionEn,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set descriptionEn(String? value) =>
+ super.noSuchMethod(Invocation.setter(#descriptionEn, value), returnValueForMissingStub: null);
@override
set descriptionTrans(String? value) => super.noSuchMethod(
- Invocation.setter(
- #descriptionTrans,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.setter(#descriptionTrans, value),
+ returnValueForMissingStub: null,
+ );
@override
- set languageEn(_i10.Language? value) => super.noSuchMethod(
- Invocation.setter(
- #languageEn,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set languageEn(_i10.Language? value) =>
+ super.noSuchMethod(Invocation.setter(#languageEn, value), returnValueForMissingStub: null);
@override
set languageTranslation(_i10.Language? value) => super.noSuchMethod(
- Invocation.setter(
- #languageTranslation,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.setter(#languageTranslation, value),
+ returnValueForMissingStub: null,
+ );
@override
set alternateNamesEn(List? value) => super.noSuchMethod(
- Invocation.setter(
- #alternateNamesEn,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.setter(#alternateNamesEn, value),
+ returnValueForMissingStub: null,
+ );
@override
set alternateNamesTrans(List? value) => super.noSuchMethod(
- Invocation.setter(
- #alternateNamesTrans,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.setter(#alternateNamesTrans, value),
+ returnValueForMissingStub: null,
+ );
@override
- set category(_i7.ExerciseCategory? value) => super.noSuchMethod(
- Invocation.setter(
- #category,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set category(_i7.ExerciseCategory? value) =>
+ super.noSuchMethod(Invocation.setter(#category, value), returnValueForMissingStub: null);
@override
- set equipment(List<_i8.Equipment>? equipment) => super.noSuchMethod(
- Invocation.setter(
- #equipment,
- equipment,
- ),
- returnValueForMissingStub: null,
- );
+ set equipment(List<_i8.Equipment>? equipment) =>
+ super.noSuchMethod(Invocation.setter(#equipment, equipment), returnValueForMissingStub: null);
@override
- set newVariationForExercise(int? value) => super.noSuchMethod(
- Invocation.setter(
- #newVariationForExercise,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set variationConnectToExercise(int? value) => super.noSuchMethod(
+ Invocation.setter(#variationConnectToExercise, value),
+ returnValueForMissingStub: null,
+ );
@override
set variationId(int? variation) => super.noSuchMethod(
- Invocation.setter(
- #variationId,
- variation,
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.setter(#variationId, variation),
+ returnValueForMissingStub: null,
+ );
@override
set primaryMuscles(List<_i9.Muscle>? muscles) => super.noSuchMethod(
- Invocation.setter(
- #primaryMuscles,
- muscles,
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.setter(#primaryMuscles, muscles),
+ returnValueForMissingStub: null,
+ );
@override
set secondaryMuscles(List<_i9.Muscle>? muscles) => super.noSuchMethod(
- Invocation.setter(
- #secondaryMuscles,
- muscles,
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.setter(#secondaryMuscles, muscles),
+ returnValueForMissingStub: null,
+ );
@override
- bool get hasListeners => (super.noSuchMethod(
- Invocation.getter(#hasListeners),
- returnValue: false,
- ) as bool);
+ bool get hasListeners =>
+ (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool);
@override
- void clear() => super.noSuchMethod(
- Invocation.method(
- #clear,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void clear() =>
+ super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null);
@override
void addExerciseImages(List<_i12.File>? exercises) => super.noSuchMethod(
- Invocation.method(
- #addExerciseImages,
- [exercises],
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.method(#addExerciseImages, [exercises]),
+ returnValueForMissingStub: null,
+ );
@override
void removeExercise(String? path) => super.noSuchMethod(
- Invocation.method(
- #removeExercise,
- [path],
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.method(#removeExercise, [path]),
+ returnValueForMissingStub: null,
+ );
@override
- void printValues() => super.noSuchMethod(
- Invocation.method(
- #printValues,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void printValues() =>
+ super.noSuchMethod(Invocation.method(#printValues, []), returnValueForMissingStub: null);
@override
- _i15.Future addExercise() => (super.noSuchMethod(
- Invocation.method(
- #addExercise,
- [],
- ),
- returnValue: _i15.Future.value(0),
- ) as _i15.Future);
-
- @override
- _i15.Future addExerciseSubmission() => (super.noSuchMethod(
- Invocation.method(
- #addExerciseSubmission,
- [],
- ),
- returnValue: _i15.Future.value(0),
- ) as _i15.Future);
-
- @override
- _i15.Future addImages(int? exerciseId) => (super.noSuchMethod(
- Invocation.method(
- #addImages,
- [exerciseId],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
-
- @override
- _i15.Future validateLanguage(
- String? input,
- String? languageCode,
- ) =>
+ _i15.Future addExercise() =>
(super.noSuchMethod(
- Invocation.method(
- #validateLanguage,
- [
- input,
- languageCode,
- ],
- ),
- returnValue: _i15.Future.value(false),
- ) as _i15.Future);
+ Invocation.method(#addExercise, []),
+ returnValue: _i15.Future.value(0),
+ )
+ as _i15.Future);
+
+ @override
+ _i15.Future addExerciseSubmission() =>
+ (super.noSuchMethod(
+ Invocation.method(#addExerciseSubmission, []),
+ returnValue: _i15.Future.value(0),
+ )
+ as _i15.Future);
+
+ @override
+ _i15.Future addImages(int? exerciseId) =>
+ (super.noSuchMethod(
+ Invocation.method(#addImages, [exerciseId]),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
+
+ @override
+ _i15.Future validateLanguage(String? input, String? languageCode) =>
+ (super.noSuchMethod(
+ Invocation.method(#validateLanguage, [input, languageCode]),
+ returnValue: _i15.Future.value(false),
+ )
+ as _i15.Future);
@override
void addListener(_i16.VoidCallback? listener) => super.noSuchMethod(
- Invocation.method(
- #addListener,
- [listener],
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.method(#addListener, [listener]),
+ returnValueForMissingStub: null,
+ );
@override
void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod(
- Invocation.method(
- #removeListener,
- [listener],
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.method(#removeListener, [listener]),
+ returnValueForMissingStub: null,
+ );
@override
- void dispose() => super.noSuchMethod(
- Invocation.method(
- #dispose,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void dispose() =>
+ super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null);
@override
- void notifyListeners() => super.noSuchMethod(
- Invocation.method(
- #notifyListeners,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void notifyListeners() =>
+ super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null);
}
/// A class which mocks [UserProvider].
@@ -465,145 +312,96 @@ class MockUserProvider extends _i1.Mock implements _i17.UserProvider {
}
@override
- _i18.ThemeMode get themeMode => (super.noSuchMethod(
- Invocation.getter(#themeMode),
- returnValue: _i18.ThemeMode.system,
- ) as _i18.ThemeMode);
+ _i18.ThemeMode get themeMode =>
+ (super.noSuchMethod(Invocation.getter(#themeMode), returnValue: _i18.ThemeMode.system)
+ as _i18.ThemeMode);
@override
- _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
- Invocation.getter(#baseProvider),
- returnValue: _FakeWgerBaseProvider_0(
- this,
- Invocation.getter(#baseProvider),
- ),
- ) as _i2.WgerBaseProvider);
+ _i2.WgerBaseProvider get baseProvider =>
+ (super.noSuchMethod(
+ Invocation.getter(#baseProvider),
+ returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)),
+ )
+ as _i2.WgerBaseProvider);
@override
- _i4.SharedPreferencesAsync get prefs => (super.noSuchMethod(
- Invocation.getter(#prefs),
- returnValue: _FakeSharedPreferencesAsync_2(
- this,
- Invocation.getter(#prefs),
- ),
- ) as _i4.SharedPreferencesAsync);
+ _i4.SharedPreferencesAsync get prefs =>
+ (super.noSuchMethod(
+ Invocation.getter(#prefs),
+ returnValue: _FakeSharedPreferencesAsync_2(this, Invocation.getter(#prefs)),
+ )
+ as _i4.SharedPreferencesAsync);
@override
- set themeMode(_i18.ThemeMode? value) => super.noSuchMethod(
- Invocation.setter(
- #themeMode,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set themeMode(_i18.ThemeMode? value) =>
+ super.noSuchMethod(Invocation.setter(#themeMode, value), returnValueForMissingStub: null);
@override
- set prefs(_i4.SharedPreferencesAsync? value) => super.noSuchMethod(
- Invocation.setter(
- #prefs,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set prefs(_i4.SharedPreferencesAsync? value) =>
+ super.noSuchMethod(Invocation.setter(#prefs, value), returnValueForMissingStub: null);
@override
- set profile(_i19.Profile? value) => super.noSuchMethod(
- Invocation.setter(
- #profile,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set profile(_i19.Profile? value) =>
+ super.noSuchMethod(Invocation.setter(#profile, value), returnValueForMissingStub: null);
@override
- bool get hasListeners => (super.noSuchMethod(
- Invocation.getter(#hasListeners),
- returnValue: false,
- ) as bool);
+ bool get hasListeners =>
+ (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool);
@override
- void clear() => super.noSuchMethod(
- Invocation.method(
- #clear,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void clear() =>
+ super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null);
@override
- void setThemeMode(_i18.ThemeMode? mode) => super.noSuchMethod(
- Invocation.method(
- #setThemeMode,
- [mode],
- ),
- returnValueForMissingStub: null,
- );
+ void setThemeMode(_i18.ThemeMode? mode) =>
+ super.noSuchMethod(Invocation.method(#setThemeMode, [mode]), returnValueForMissingStub: null);
@override
- _i15.Future fetchAndSetProfile() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetProfile,
- [],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i15.Future fetchAndSetProfile() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetProfile, []),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
- _i15.Future saveProfile() => (super.noSuchMethod(
- Invocation.method(
- #saveProfile,
- [],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i15.Future saveProfile() =>
+ (super.noSuchMethod(
+ Invocation.method(#saveProfile, []),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
- _i15.Future verifyEmail() => (super.noSuchMethod(
- Invocation.method(
- #verifyEmail,
- [],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i15.Future verifyEmail() =>
+ (super.noSuchMethod(
+ Invocation.method(#verifyEmail, []),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
void addListener(_i16.VoidCallback? listener) => super.noSuchMethod(
- Invocation.method(
- #addListener,
- [listener],
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.method(#addListener, [listener]),
+ returnValueForMissingStub: null,
+ );
@override
void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod(
- Invocation.method(
- #removeListener,
- [listener],
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.method(#removeListener, [listener]),
+ returnValueForMissingStub: null,
+ );
@override
- void dispose() => super.noSuchMethod(
- Invocation.method(
- #dispose,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void dispose() =>
+ super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null);
@override
- void notifyListeners() => super.noSuchMethod(
- Invocation.method(
- #notifyListeners,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void notifyListeners() =>
+ super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null);
}
/// A class which mocks [ExercisesProvider].
@@ -615,292 +413,211 @@ class MockExercisesProvider extends _i1.Mock implements _i20.ExercisesProvider {
}
@override
- _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
- Invocation.getter(#baseProvider),
- returnValue: _FakeWgerBaseProvider_0(
- this,
- Invocation.getter(#baseProvider),
- ),
- ) as _i2.WgerBaseProvider);
+ _i2.WgerBaseProvider get baseProvider =>
+ (super.noSuchMethod(
+ Invocation.getter(#baseProvider),
+ returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)),
+ )
+ as _i2.WgerBaseProvider);
@override
- _i5.ExerciseDatabase get database => (super.noSuchMethod(
- Invocation.getter(#database),
- returnValue: _FakeExerciseDatabase_3(
- this,
- Invocation.getter(#database),
- ),
- ) as _i5.ExerciseDatabase);
+ _i5.ExerciseDatabase get database =>
+ (super.noSuchMethod(
+ Invocation.getter(#database),
+ returnValue: _FakeExerciseDatabase_3(this, Invocation.getter(#database)),
+ )
+ as _i5.ExerciseDatabase);
@override
- List<_i6.Exercise> get exercises => (super.noSuchMethod(
- Invocation.getter(#exercises),
- returnValue: <_i6.Exercise>[],
- ) as List<_i6.Exercise>);
+ List<_i6.Exercise> get exercises =>
+ (super.noSuchMethod(Invocation.getter(#exercises), returnValue: <_i6.Exercise>[])
+ as List<_i6.Exercise>);
@override
- List<_i6.Exercise> get filteredExercises => (super.noSuchMethod(
- Invocation.getter(#filteredExercises),
- returnValue: <_i6.Exercise>[],
- ) as List<_i6.Exercise>);
+ List<_i6.Exercise> get filteredExercises =>
+ (super.noSuchMethod(Invocation.getter(#filteredExercises), returnValue: <_i6.Exercise>[])
+ as List<_i6.Exercise>);
@override
- Map> get exerciseByVariation => (super.noSuchMethod(
- Invocation.getter(#exerciseByVariation),
- returnValue: >{},
- ) as Map>);
+ Map> get exerciseByVariation =>
+ (super.noSuchMethod(
+ Invocation.getter(#exerciseByVariation),
+ returnValue: >{},
+ )
+ as Map>);
@override
- List<_i7.ExerciseCategory> get categories => (super.noSuchMethod(
- Invocation.getter(#categories),
- returnValue: <_i7.ExerciseCategory>[],
- ) as List<_i7.ExerciseCategory>);
+ List<_i7.ExerciseCategory> get categories =>
+ (super.noSuchMethod(Invocation.getter(#categories), returnValue: <_i7.ExerciseCategory>[])
+ as List<_i7.ExerciseCategory>);
@override
- List<_i9.Muscle> get muscles => (super.noSuchMethod(
- Invocation.getter(#muscles),
- returnValue: <_i9.Muscle>[],
- ) as List<_i9.Muscle>);
+ List<_i9.Muscle> get muscles =>
+ (super.noSuchMethod(Invocation.getter(#muscles), returnValue: <_i9.Muscle>[])
+ as List<_i9.Muscle>);
@override
- List<_i8.Equipment> get equipment => (super.noSuchMethod(
- Invocation.getter(#equipment),
- returnValue: <_i8.Equipment>[],
- ) as List<_i8.Equipment>);
+ List<_i8.Equipment> get equipment =>
+ (super.noSuchMethod(Invocation.getter(#equipment), returnValue: <_i8.Equipment>[])
+ as List<_i8.Equipment>);
@override
- List<_i10.Language> get languages => (super.noSuchMethod(
- Invocation.getter(#languages),
- returnValue: <_i10.Language>[],
- ) as List<_i10.Language>);
+ List<_i10.Language> get languages =>
+ (super.noSuchMethod(Invocation.getter(#languages), returnValue: <_i10.Language>[])
+ as List<_i10.Language>);
@override
- set database(_i5.ExerciseDatabase? value) => super.noSuchMethod(
- Invocation.setter(
- #database,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set database(_i5.ExerciseDatabase? value) =>
+ super.noSuchMethod(Invocation.setter(#database, value), returnValueForMissingStub: null);
@override
- set exercises(List<_i6.Exercise>? value) => super.noSuchMethod(
- Invocation.setter(
- #exercises,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set exercises(List<_i6.Exercise>? value) =>
+ super.noSuchMethod(Invocation.setter(#exercises, value), returnValueForMissingStub: null);
@override
set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => super.noSuchMethod(
- Invocation.setter(
- #filteredExercises,
- newFilteredExercises,
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.setter(#filteredExercises, newFilteredExercises),
+ returnValueForMissingStub: null,
+ );
@override
- set languages(List<_i10.Language>? languages) => super.noSuchMethod(
- Invocation.setter(
- #languages,
- languages,
- ),
- returnValueForMissingStub: null,
- );
+ set languages(List<_i10.Language>? languages) =>
+ super.noSuchMethod(Invocation.setter(#languages, languages), returnValueForMissingStub: null);
@override
- bool get hasListeners => (super.noSuchMethod(
- Invocation.getter(#hasListeners),
- returnValue: false,
- ) as bool);
+ bool get hasListeners =>
+ (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool);
@override
- _i15.Future setFilters(_i20.Filters? newFilters) => (super.noSuchMethod(
- Invocation.method(
- #setFilters,
- [newFilters],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
-
- @override
- void initFilters() => super.noSuchMethod(
- Invocation.method(
- #initFilters,
- [],
- ),
- returnValueForMissingStub: null,
- );
-
- @override
- _i15.Future findByFilters() => (super.noSuchMethod(
- Invocation.method(
- #findByFilters,
- [],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
-
- @override
- void clear() => super.noSuchMethod(
- Invocation.method(
- #clear,
- [],
- ),
- returnValueForMissingStub: null,
- );
-
- @override
- _i6.Exercise findExerciseById(int? id) => (super.noSuchMethod(
- Invocation.method(
- #findExerciseById,
- [id],
- ),
- returnValue: _FakeExercise_4(
- this,
- Invocation.method(
- #findExerciseById,
- [id],
- ),
- ),
- ) as _i6.Exercise);
-
- @override
- List<_i6.Exercise> findExercisesByVariationId(
- int? variationId, {
- int? exerciseIdToExclude,
- }) =>
+ _i15.Future setFilters(_i20.Filters? newFilters) =>
(super.noSuchMethod(
- Invocation.method(
- #findExercisesByVariationId,
- [variationId],
- {#exerciseIdToExclude: exerciseIdToExclude},
- ),
- returnValue: <_i6.Exercise>[],
- ) as List<_i6.Exercise>);
+ Invocation.method(#setFilters, [newFilters]),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
- _i7.ExerciseCategory findCategoryById(int? id) => (super.noSuchMethod(
- Invocation.method(
- #findCategoryById,
- [id],
- ),
- returnValue: _FakeExerciseCategory_5(
- this,
- Invocation.method(
- #findCategoryById,
- [id],
- ),
- ),
- ) as _i7.ExerciseCategory);
+ void initFilters() =>
+ super.noSuchMethod(Invocation.method(#initFilters, []), returnValueForMissingStub: null);
@override
- _i8.Equipment findEquipmentById(int? id) => (super.noSuchMethod(
- Invocation.method(
- #findEquipmentById,
- [id],
- ),
- returnValue: _FakeEquipment_6(
- this,
- Invocation.method(
- #findEquipmentById,
- [id],
- ),
- ),
- ) as _i8.Equipment);
+ _i15.Future findByFilters() =>
+ (super.noSuchMethod(
+ Invocation.method(#findByFilters, []),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
- _i9.Muscle findMuscleById(int? id) => (super.noSuchMethod(
- Invocation.method(
- #findMuscleById,
- [id],
- ),
- returnValue: _FakeMuscle_7(
- this,
- Invocation.method(
- #findMuscleById,
- [id],
- ),
- ),
- ) as _i9.Muscle);
+ void clear() =>
+ super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null);
@override
- _i10.Language findLanguageById(int? id) => (super.noSuchMethod(
- Invocation.method(
- #findLanguageById,
- [id],
- ),
- returnValue: _FakeLanguage_8(
- this,
- Invocation.method(
- #findLanguageById,
- [id],
- ),
- ),
- ) as _i10.Language);
+ _i6.Exercise findExerciseById(int? id) =>
+ (super.noSuchMethod(
+ Invocation.method(#findExerciseById, [id]),
+ returnValue: _FakeExercise_4(this, Invocation.method(#findExerciseById, [id])),
+ )
+ as _i6.Exercise);
@override
- _i15.Future fetchAndSetCategoriesFromApi() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetCategoriesFromApi,
- [],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ List<_i6.Exercise> findExercisesByVariationId(int? variationId, {int? exerciseIdToExclude}) =>
+ (super.noSuchMethod(
+ Invocation.method(
+ #findExercisesByVariationId,
+ [variationId],
+ {#exerciseIdToExclude: exerciseIdToExclude},
+ ),
+ returnValue: <_i6.Exercise>[],
+ )
+ as List<_i6.Exercise>);
@override
- _i15.Future fetchAndSetMusclesFromApi() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetMusclesFromApi,
- [],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i7.ExerciseCategory findCategoryById(int? id) =>
+ (super.noSuchMethod(
+ Invocation.method(#findCategoryById, [id]),
+ returnValue: _FakeExerciseCategory_5(this, Invocation.method(#findCategoryById, [id])),
+ )
+ as _i7.ExerciseCategory);
@override
- _i15.Future fetchAndSetEquipmentsFromApi() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetEquipmentsFromApi,
- [],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i8.Equipment findEquipmentById(int? id) =>
+ (super.noSuchMethod(
+ Invocation.method(#findEquipmentById, [id]),
+ returnValue: _FakeEquipment_6(this, Invocation.method(#findEquipmentById, [id])),
+ )
+ as _i8.Equipment);
@override
- _i15.Future fetchAndSetLanguagesFromApi() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetLanguagesFromApi,
- [],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i9.Muscle findMuscleById(int? id) =>
+ (super.noSuchMethod(
+ Invocation.method(#findMuscleById, [id]),
+ returnValue: _FakeMuscle_7(this, Invocation.method(#findMuscleById, [id])),
+ )
+ as _i9.Muscle);
@override
- _i15.Future fetchAndSetAllExercises() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetAllExercises,
- [],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i10.Language findLanguageById(int? id) =>
+ (super.noSuchMethod(
+ Invocation.method(#findLanguageById, [id]),
+ returnValue: _FakeLanguage_8(this, Invocation.method(#findLanguageById, [id])),
+ )
+ as _i10.Language);
@override
- _i15.Future<_i6.Exercise?> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetExercise,
- [exerciseId],
- ),
- returnValue: _i15.Future<_i6.Exercise?>.value(),
- ) as _i15.Future<_i6.Exercise?>);
+ _i15.Future fetchAndSetCategoriesFromApi() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetCategoriesFromApi, []),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
+
+ @override
+ _i15.Future fetchAndSetMusclesFromApi() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetMusclesFromApi, []),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
+
+ @override
+ _i15.Future fetchAndSetEquipmentsFromApi() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetEquipmentsFromApi, []),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
+
+ @override
+ _i15.Future fetchAndSetLanguagesFromApi() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetLanguagesFromApi, []),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
+
+ @override
+ _i15.Future fetchAndSetAllExercises() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetAllExercises, []),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
+
+ @override
+ _i15.Future<_i6.Exercise?> fetchAndSetExercise(int? exerciseId) =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetExercise, [exerciseId]),
+ returnValue: _i15.Future<_i6.Exercise?>.value(),
+ )
+ as _i15.Future<_i6.Exercise?>);
@override
_i15.Future<_i6.Exercise> handleUpdateExerciseFromApi(
@@ -908,55 +625,42 @@ class MockExercisesProvider extends _i1.Mock implements _i20.ExercisesProvider {
int? exerciseId,
) =>
(super.noSuchMethod(
- Invocation.method(
- #handleUpdateExerciseFromApi,
- [
- database,
- exerciseId,
- ],
- ),
- returnValue: _i15.Future<_i6.Exercise>.value(_FakeExercise_4(
- this,
- Invocation.method(
- #handleUpdateExerciseFromApi,
- [
- database,
- exerciseId,
- ],
- ),
- )),
- ) as _i15.Future<_i6.Exercise>);
+ Invocation.method(#handleUpdateExerciseFromApi, [database, exerciseId]),
+ returnValue: _i15.Future<_i6.Exercise>.value(
+ _FakeExercise_4(
+ this,
+ Invocation.method(#handleUpdateExerciseFromApi, [database, exerciseId]),
+ ),
+ ),
+ )
+ as _i15.Future<_i6.Exercise>);
@override
- _i15.Future initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod(
- Invocation.method(
- #initCacheTimesLocalPrefs,
- [],
- {#forceInit: forceInit},
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i15.Future initCacheTimesLocalPrefs({dynamic forceInit = false}) =>
+ (super.noSuchMethod(
+ Invocation.method(#initCacheTimesLocalPrefs, [], {#forceInit: forceInit}),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
- _i15.Future clearAllCachesAndPrefs() => (super.noSuchMethod(
- Invocation.method(
- #clearAllCachesAndPrefs,
- [],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i15.Future clearAllCachesAndPrefs() =>
+ (super.noSuchMethod(
+ Invocation.method(#clearAllCachesAndPrefs, []),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
- _i15.Future fetchAndSetInitialData() => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetInitialData,
- [],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i15.Future fetchAndSetInitialData() =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetInitialData, []),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
_i15.Future setExercisesFromDatabase(
@@ -964,64 +668,60 @@ class MockExercisesProvider extends _i1.Mock implements _i20.ExercisesProvider {
bool? forceDeleteCache = false,
}) =>
(super.noSuchMethod(
- Invocation.method(
- #setExercisesFromDatabase,
- [database],
- {#forceDeleteCache: forceDeleteCache},
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ Invocation.method(
+ #setExercisesFromDatabase,
+ [database],
+ {#forceDeleteCache: forceDeleteCache},
+ ),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
- _i15.Future updateExerciseCache(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
- Invocation.method(
- #updateExerciseCache,
- [database],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i15.Future updateExerciseCache(_i5.ExerciseDatabase? database) =>
+ (super.noSuchMethod(
+ Invocation.method(#updateExerciseCache, [database]),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
- _i15.Future fetchAndSetMuscles(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetMuscles,
- [database],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i15.Future fetchAndSetMuscles(_i5.ExerciseDatabase? database) =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetMuscles, [database]),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
- _i15.Future fetchAndSetCategories(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetCategories,
- [database],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i15.Future fetchAndSetCategories(_i5.ExerciseDatabase? database) =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetCategories, [database]),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
- _i15.Future fetchAndSetLanguages(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetLanguages,
- [database],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i15.Future fetchAndSetLanguages(_i5.ExerciseDatabase? database) =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetLanguages, [database]),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
- _i15.Future fetchAndSetEquipments(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
- Invocation.method(
- #fetchAndSetEquipments,
- [database],
- ),
- returnValue: _i15.Future.value(),
- returnValueForMissingStub: _i15.Future.value(),
- ) as _i15.Future);
+ _i15.Future fetchAndSetEquipments(_i5.ExerciseDatabase? database) =>
+ (super.noSuchMethod(
+ Invocation.method(#fetchAndSetEquipments, [database]),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ )
+ as _i15.Future);
@override
_i15.Future> searchExercise(
@@ -1030,50 +730,32 @@ class MockExercisesProvider extends _i1.Mock implements _i20.ExercisesProvider {
bool? searchEnglish = false,
}) =>
(super.noSuchMethod(
- Invocation.method(
- #searchExercise,
- [name],
- {
- #languageCode: languageCode,
- #searchEnglish: searchEnglish,
- },
- ),
- returnValue: _i15.Future>.value(<_i6.Exercise>[]),
- ) as _i15.Future>);
+ Invocation.method(
+ #searchExercise,
+ [name],
+ {#languageCode: languageCode, #searchEnglish: searchEnglish},
+ ),
+ returnValue: _i15.Future>.value(<_i6.Exercise>[]),
+ )
+ as _i15.Future>);
@override
void addListener(_i16.VoidCallback? listener) => super.noSuchMethod(
- Invocation.method(
- #addListener,
- [listener],
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.method(#addListener, [listener]),
+ returnValueForMissingStub: null,
+ );
@override
void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod(
- Invocation.method(
- #removeListener,
- [listener],
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.method(#removeListener, [listener]),
+ returnValueForMissingStub: null,
+ );
@override
- void dispose() => super.noSuchMethod(
- Invocation.method(
- #dispose,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void dispose() =>
+ super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null);
@override
- void notifyListeners() => super.noSuchMethod(
- Invocation.method(
- #notifyListeners,
- [],
- ),
- returnValueForMissingStub: null,
- );
+ void notifyListeners() =>
+ super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null);
}
diff --git a/test/exercises/exercises_detail_widget_test.mocks.dart b/test/exercises/exercises_detail_widget_test.mocks.dart
index 425264a3..5c39de2b 100644
--- a/test/exercises/exercises_detail_widget_test.mocks.dart
+++ b/test/exercises/exercises_detail_widget_test.mocks.dart
@@ -32,73 +32,34 @@ import 'package:wger/providers/exercises.dart' as _i9;
// ignore_for_file: invalid_use_of_internal_member
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
- _FakeWgerBaseProvider_0(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
class _FakeExerciseDatabase_1 extends _i1.SmartFake implements _i3.ExerciseDatabase {
- _FakeExerciseDatabase_1(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeExerciseDatabase_1(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
class _FakeExercise_2 extends _i1.SmartFake implements _i4.Exercise {
- _FakeExercise_2(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeExercise_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeExerciseCategory_3 extends _i1.SmartFake implements _i5.ExerciseCategory {
- _FakeExerciseCategory_3(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeExerciseCategory_3(Object parent, Invocation parentInvocation)
+ : super(parent, parentInvocation);
}
class _FakeEquipment_4 extends _i1.SmartFake implements _i6.Equipment {
- _FakeEquipment_4(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeEquipment_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeMuscle_5 extends _i1.SmartFake implements _i7.Muscle {
- _FakeMuscle_5(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeMuscle_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeLanguage_6 extends _i1.SmartFake implements _i8.Language {
- _FakeLanguage_6(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
+ _FakeLanguage_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
/// A class which mocks [ExercisesProvider].
@@ -110,292 +71,211 @@ class MockExercisesProvider extends _i1.Mock implements _i9.ExercisesProvider {
}
@override
- _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
- Invocation.getter(#baseProvider),
- returnValue: _FakeWgerBaseProvider_0(
- this,
- Invocation.getter(#baseProvider),
- ),
- ) as _i2.WgerBaseProvider);
+ _i2.WgerBaseProvider get baseProvider =>
+ (super.noSuchMethod(
+ Invocation.getter(#baseProvider),
+ returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)),
+ )
+ as _i2.WgerBaseProvider);
@override
- _i3.ExerciseDatabase get database => (super.noSuchMethod(
- Invocation.getter(#database),
- returnValue: _FakeExerciseDatabase_1(
- this,
- Invocation.getter(#database),
- ),
- ) as _i3.ExerciseDatabase);
+ _i3.ExerciseDatabase get database =>
+ (super.noSuchMethod(
+ Invocation.getter(#database),
+ returnValue: _FakeExerciseDatabase_1(this, Invocation.getter(#database)),
+ )
+ as _i3.ExerciseDatabase);
@override
- List<_i4.Exercise> get exercises => (super.noSuchMethod(
- Invocation.getter(#exercises),
- returnValue: <_i4.Exercise>[],
- ) as List<_i4.Exercise>);
+ List<_i4.Exercise> get exercises =>
+ (super.noSuchMethod(Invocation.getter(#exercises), returnValue: <_i4.Exercise>[])
+ as List<_i4.Exercise>);
@override
- List<_i4.Exercise> get filteredExercises => (super.noSuchMethod(
- Invocation.getter(#filteredExercises),
- returnValue: <_i4.Exercise>[],
- ) as List<_i4.Exercise>);
+ List<_i4.Exercise> get filteredExercises =>
+ (super.noSuchMethod(Invocation.getter(#filteredExercises), returnValue: <_i4.Exercise>[])
+ as List<_i4.Exercise>);
@override
- Map> get exerciseByVariation => (super.noSuchMethod(
- Invocation.getter(#exerciseByVariation),
- returnValue: >{},
- ) as Map>);
+ Map> get exerciseByVariation =>
+ (super.noSuchMethod(
+ Invocation.getter(#exerciseByVariation),
+ returnValue: >{},
+ )
+ as Map>);
@override
- List<_i5.ExerciseCategory> get categories => (super.noSuchMethod(
- Invocation.getter(#categories),
- returnValue: <_i5.ExerciseCategory>[],
- ) as List<_i5.ExerciseCategory>);
+ List<_i5.ExerciseCategory> get categories =>
+ (super.noSuchMethod(Invocation.getter(#categories), returnValue: <_i5.ExerciseCategory>[])
+ as List<_i5.ExerciseCategory>);
@override
- List<_i7.Muscle> get muscles => (super.noSuchMethod(
- Invocation.getter(#muscles),
- returnValue: <_i7.Muscle>[],
- ) as List<_i7.Muscle>);
+ List<_i7.Muscle> get muscles =>
+ (super.noSuchMethod(Invocation.getter(#muscles), returnValue: <_i7.Muscle>[])
+ as List<_i7.Muscle>);
@override
- List<_i6.Equipment> get equipment => (super.noSuchMethod(
- Invocation.getter(#equipment),
- returnValue: <_i6.Equipment>[],
- ) as List<_i6.Equipment>);
+ List<_i6.Equipment> get equipment =>
+ (super.noSuchMethod(Invocation.getter(#equipment), returnValue: <_i6.Equipment>[])
+ as List<_i6.Equipment>);
@override
- List<_i8.Language> get languages => (super.noSuchMethod(
- Invocation.getter(#languages),
- returnValue: <_i8.Language>[],
- ) as List<_i8.Language>);
+ List<_i8.Language> get languages =>
+ (super.noSuchMethod(Invocation.getter(#languages), returnValue: <_i8.Language>[])
+ as List<_i8.Language>);
@override
- set database(_i3.ExerciseDatabase? value) => super.noSuchMethod(
- Invocation.setter(
- #database,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set database(_i3.ExerciseDatabase? value) =>
+ super.noSuchMethod(Invocation.setter(#database, value), returnValueForMissingStub: null);
@override
- set exercises(List<_i4.Exercise>? value) => super.noSuchMethod(
- Invocation.setter(
- #exercises,
- value,
- ),
- returnValueForMissingStub: null,
- );
+ set exercises(List<_i4.Exercise>? value) =>
+ super.noSuchMethod(Invocation.setter(#exercises, value), returnValueForMissingStub: null);
@override
set filteredExercises(List<_i4.Exercise>? newFilteredExercises) => super.noSuchMethod(
- Invocation.setter(
- #filteredExercises,
- newFilteredExercises,
- ),
- returnValueForMissingStub: null,
- );
+ Invocation.setter(#filteredExercises, newFilteredExercises),
+ returnValueForMissingStub: null,
+ );
@override
- set languages(List<_i8.Language>? languages) => super.noSuchMethod(
- Invocation.setter(
- #languages,
- languages,
- ),
- returnValueForMissingStub: null,
- );
+ set languages(List<_i8.Language>? languages) =>
+ super.noSuchMethod(Invocation.setter(#languages, languages), returnValueForMissingStub: null);
@override
- bool get hasListeners => (super.noSuchMethod(
- Invocation.getter(#hasListeners),
- returnValue: false,
- ) as bool);
+ bool get hasListeners =>
+ (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool);
@override
- _i10.Future setFilters(_i9.Filters? newFilters) => (super.noSuchMethod(
- Invocation.method(
- #setFilters,
- [newFilters],
- ),
- returnValue: _i10.Future.value(),
- returnValueForMissingStub: _i10.Future.value(),
- ) as _i10.Future);
-
- @override
- void initFilters() => super.noSuchMethod(
- Invocation.method(
- #initFilters,
- [],
- ),
- returnValueForMissingStub: null,
- );
-
- @override
- _i10.Future findByFilters() => (super.noSuchMethod(
- Invocation.method(
- #findByFilters,
- [],
- ),
- returnValue: _i10.Future.value(),
- returnValueForMissingStub: _i10.Future.value(),
- ) as _i10.Future);
-
- @override
- void clear() => super.noSuchMethod(
- Invocation.method(
- #clear,
- [],
- ),
- returnValueForMissingStub: null,
- );
-
- @override
- _i4.Exercise findExerciseById(int? id) => (super.noSuchMethod(
- Invocation.method(
- #findExerciseById,
- [id],
- ),
- returnValue: _FakeExercise_2(
- this,
- Invocation.method(
- #findExerciseById,
- [id],
- ),
- ),
- ) as _i4.Exercise);
-
- @override
- List<_i4.Exercise> findExercisesByVariationId(
- int? variationId, {
- int? exerciseIdToExclude,
- }) =>
+ _i10.Future setFilters(_i9.Filters? newFilters) =>
(super.noSuchMethod(
- Invocation.method(
- #findExercisesByVariationId,
- [variationId],
- {#exerciseIdToExclude: exerciseIdToExclude},
- ),
- returnValue: <_i4.Exercise>[],
- ) as List<_i4.Exercise>);
+ Invocation.method(#setFilters, [newFilters]),
+ returnValue: _i10.Future.value(),
+ returnValueForMissingStub: _i10.Future.value(),
+ )
+ as _i10.Future