mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Improve the models
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<!-- Health Permissions, see https://pub.dev/packages/health -->
|
||||
<uses-permission android:name="android.permission.health.READ_STEPS" />
|
||||
<uses-permission android:name="android.permission.health.READ_HEART_RATE" />
|
||||
<uses-permission android:name="android.permission.health.READ_STEPS" />
|
||||
<uses-permission android:name="android.permission.health.READ_ACTIVE_ENERGY_BURNED" />
|
||||
<uses-permission android:name="android.permission.health.READ_WEIGHT" />
|
||||
<uses-permission android:name="android.permission.health.READ_WATER" />
|
||||
|
||||
@@ -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<MeasurementEntry> 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<MeasurementEntry>? 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<String, dynamic> json) =>
|
||||
_$MeasurementCategoryFromJson(json);
|
||||
|
||||
@@ -7,7 +7,10 @@ part of 'measurement_category.dart';
|
||||
// **************************************************************************
|
||||
|
||||
MeasurementCategory _$MeasurementCategoryFromJson(Map<String, dynamic> 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<String, dynamic> json) {
|
||||
(json['entries'] as List<dynamic>?)
|
||||
?.map((e) => MeasurementEntry.fromJson(e as Map<String, dynamic>))
|
||||
.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<String, dynamic> _$MeasurementCategoryToJson(MeasurementCategory instance) => <String, dynamic>{
|
||||
'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),
|
||||
};
|
||||
|
||||
@@ -146,7 +146,7 @@ class MeasurementProvider with ChangeNotifier {
|
||||
final Uri postUri = baseProvider.makeUrl(_entryUrl);
|
||||
|
||||
final Map<String, dynamic> newEntryMap = await baseProvider.post(entry.toJson(), postUri);
|
||||
final MeasurementEntry newEntry = MeasurementEntry.fromJson(newEntryMap);
|
||||
final newEntry = MeasurementEntry.fromJson(newEntryMap);
|
||||
|
||||
final MeasurementCategory category = findCategoryById(newEntry.category);
|
||||
|
||||
|
||||
@@ -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<void> _ensureCategoriesExist(List<HealthDataType> 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<void> _syncHistoricalData() async {
|
||||
Future<void> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,19 +32,47 @@ class _HealthSettingsScreenState extends State<HealthSettingsScreen> {
|
||||
final measurementProvider = Provider.of<MeasurementProvider>(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<Color>(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<HealthSettingsScreen> {
|
||||
valueColor: AlwaysStoppedAnimation<Color>(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),
|
||||
|
||||
@@ -114,7 +114,7 @@ class MeasurementEntriesScreen extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
floatingActionButton: category.isInternal
|
||||
floatingActionButton: category.externallySynced
|
||||
? FloatingActionButton(
|
||||
child: const Icon(Icons.add, color: Colors.white),
|
||||
onPressed: () {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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<String, String>? headers,
|
||||
}) =>
|
||||
_i3.Future<_i2.Response> head(Uri? url, {Map<String, String>? 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<String, String>? headers,
|
||||
}) =>
|
||||
_i3.Future<_i2.Response> get(Uri? url, {Map<String, String>? 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<String> read(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
}) =>
|
||||
_i3.Future<String> read(Uri? url, {Map<String, String>? headers}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#read,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
returnValue: _i3.Future<String>.value(_i5.dummyValue<String>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#read,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<String>);
|
||||
Invocation.method(#read, [url], {#headers: headers}),
|
||||
returnValue: _i3.Future<String>.value(
|
||||
_i5.dummyValue<String>(this, Invocation.method(#read, [url], {#headers: headers})),
|
||||
),
|
||||
)
|
||||
as _i3.Future<String>);
|
||||
|
||||
@override
|
||||
_i3.Future<_i6.Uint8List> readBytes(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
}) =>
|
||||
_i3.Future<_i6.Uint8List> readBytes(Uri? url, {Map<String, String>? 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);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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<int, List<_i4.Exercise>> get exerciseByVariation => (super.noSuchMethod(
|
||||
Invocation.getter(#exerciseByVariation),
|
||||
returnValue: <int, List<_i4.Exercise>>{},
|
||||
) as Map<int, List<_i4.Exercise>>);
|
||||
Map<int, List<_i4.Exercise>> get exerciseByVariation =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.getter(#exerciseByVariation),
|
||||
returnValue: <int, List<_i4.Exercise>>{},
|
||||
)
|
||||
as Map<int, List<_i4.Exercise>>);
|
||||
|
||||
@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<void> setFilters(_i9.Filters? newFilters) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#setFilters,
|
||||
[newFilters],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
void initFilters() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#initFilters,
|
||||
[],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i10.Future<void> findByFilters() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findByFilters,
|
||||
[],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
|
||||
@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<void> 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<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.ExerciseCategory findCategoryById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findCategoryById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _FakeExerciseCategory_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#findCategoryById,
|
||||
[id],
|
||||
),
|
||||
),
|
||||
) as _i5.ExerciseCategory);
|
||||
void initFilters() =>
|
||||
super.noSuchMethod(Invocation.method(#initFilters, []), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
_i6.Equipment findEquipmentById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findEquipmentById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _FakeEquipment_4(
|
||||
this,
|
||||
Invocation.method(
|
||||
#findEquipmentById,
|
||||
[id],
|
||||
),
|
||||
),
|
||||
) as _i6.Equipment);
|
||||
_i10.Future<void> findByFilters() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#findByFilters, []),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i7.Muscle findMuscleById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findMuscleById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _FakeMuscle_5(
|
||||
this,
|
||||
Invocation.method(
|
||||
#findMuscleById,
|
||||
[id],
|
||||
),
|
||||
),
|
||||
) as _i7.Muscle);
|
||||
void clear() =>
|
||||
super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
_i8.Language findLanguageById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findLanguageById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _FakeLanguage_6(
|
||||
this,
|
||||
Invocation.method(
|
||||
#findLanguageById,
|
||||
[id],
|
||||
),
|
||||
),
|
||||
) as _i8.Language);
|
||||
_i4.Exercise findExerciseById(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#findExerciseById, [id]),
|
||||
returnValue: _FakeExercise_2(this, Invocation.method(#findExerciseById, [id])),
|
||||
)
|
||||
as _i4.Exercise);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetCategoriesFromApi() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetCategoriesFromApi,
|
||||
[],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
List<_i4.Exercise> findExercisesByVariationId(int? variationId, {int? exerciseIdToExclude}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findExercisesByVariationId,
|
||||
[variationId],
|
||||
{#exerciseIdToExclude: exerciseIdToExclude},
|
||||
),
|
||||
returnValue: <_i4.Exercise>[],
|
||||
)
|
||||
as List<_i4.Exercise>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetMusclesFromApi() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetMusclesFromApi,
|
||||
[],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
_i5.ExerciseCategory findCategoryById(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#findCategoryById, [id]),
|
||||
returnValue: _FakeExerciseCategory_3(this, Invocation.method(#findCategoryById, [id])),
|
||||
)
|
||||
as _i5.ExerciseCategory);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetEquipmentsFromApi() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetEquipmentsFromApi,
|
||||
[],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
_i6.Equipment findEquipmentById(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#findEquipmentById, [id]),
|
||||
returnValue: _FakeEquipment_4(this, Invocation.method(#findEquipmentById, [id])),
|
||||
)
|
||||
as _i6.Equipment);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetLanguagesFromApi() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLanguagesFromApi,
|
||||
[],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
_i7.Muscle findMuscleById(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#findMuscleById, [id]),
|
||||
returnValue: _FakeMuscle_5(this, Invocation.method(#findMuscleById, [id])),
|
||||
)
|
||||
as _i7.Muscle);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetAllExercises() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetAllExercises,
|
||||
[],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
_i8.Language findLanguageById(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#findLanguageById, [id]),
|
||||
returnValue: _FakeLanguage_6(this, Invocation.method(#findLanguageById, [id])),
|
||||
)
|
||||
as _i8.Language);
|
||||
|
||||
@override
|
||||
_i10.Future<_i4.Exercise?> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetExercise,
|
||||
[exerciseId],
|
||||
),
|
||||
returnValue: _i10.Future<_i4.Exercise?>.value(),
|
||||
) as _i10.Future<_i4.Exercise?>);
|
||||
_i10.Future<void> fetchAndSetCategoriesFromApi() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchAndSetCategoriesFromApi, []),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetMusclesFromApi() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchAndSetMusclesFromApi, []),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetEquipmentsFromApi() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchAndSetEquipmentsFromApi, []),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetLanguagesFromApi() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchAndSetLanguagesFromApi, []),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetAllExercises() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchAndSetAllExercises, []),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<_i4.Exercise?> fetchAndSetExercise(int? exerciseId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchAndSetExercise, [exerciseId]),
|
||||
returnValue: _i10.Future<_i4.Exercise?>.value(),
|
||||
)
|
||||
as _i10.Future<_i4.Exercise?>);
|
||||
|
||||
@override
|
||||
_i10.Future<_i4.Exercise> handleUpdateExerciseFromApi(
|
||||
@@ -403,55 +283,42 @@ class MockExercisesProvider extends _i1.Mock implements _i9.ExercisesProvider {
|
||||
int? exerciseId,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#handleUpdateExerciseFromApi,
|
||||
[
|
||||
database,
|
||||
exerciseId,
|
||||
],
|
||||
),
|
||||
returnValue: _i10.Future<_i4.Exercise>.value(_FakeExercise_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#handleUpdateExerciseFromApi,
|
||||
[
|
||||
database,
|
||||
exerciseId,
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i10.Future<_i4.Exercise>);
|
||||
Invocation.method(#handleUpdateExerciseFromApi, [database, exerciseId]),
|
||||
returnValue: _i10.Future<_i4.Exercise>.value(
|
||||
_FakeExercise_2(
|
||||
this,
|
||||
Invocation.method(#handleUpdateExerciseFromApi, [database, exerciseId]),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i10.Future<_i4.Exercise>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#initCacheTimesLocalPrefs,
|
||||
[],
|
||||
{#forceInit: forceInit},
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
_i10.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#initCacheTimesLocalPrefs, [], {#forceInit: forceInit}),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> clearAllCachesAndPrefs() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#clearAllCachesAndPrefs,
|
||||
[],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
_i10.Future<void> clearAllCachesAndPrefs() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#clearAllCachesAndPrefs, []),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetInitialData() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetInitialData,
|
||||
[],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
_i10.Future<void> fetchAndSetInitialData() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchAndSetInitialData, []),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> setExercisesFromDatabase(
|
||||
@@ -459,64 +326,60 @@ class MockExercisesProvider extends _i1.Mock implements _i9.ExercisesProvider {
|
||||
bool? forceDeleteCache = false,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#setExercisesFromDatabase,
|
||||
[database],
|
||||
{#forceDeleteCache: forceDeleteCache},
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
Invocation.method(
|
||||
#setExercisesFromDatabase,
|
||||
[database],
|
||||
{#forceDeleteCache: forceDeleteCache},
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> updateExerciseCache(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateExerciseCache,
|
||||
[database],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
_i10.Future<void> updateExerciseCache(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#updateExerciseCache, [database]),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetMuscles(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetMuscles,
|
||||
[database],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
_i10.Future<void> fetchAndSetMuscles(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchAndSetMuscles, [database]),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetCategories(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetCategories,
|
||||
[database],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
_i10.Future<void> fetchAndSetCategories(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchAndSetCategories, [database]),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetLanguages(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLanguages,
|
||||
[database],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
_i10.Future<void> fetchAndSetLanguages(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchAndSetLanguages, [database]),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetEquipments(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetEquipments,
|
||||
[database],
|
||||
),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
_i10.Future<void> fetchAndSetEquipments(_i3.ExerciseDatabase? database) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchAndSetEquipments, [database]),
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
)
|
||||
as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<List<_i4.Exercise>> searchExercise(
|
||||
@@ -525,50 +388,32 @@ class MockExercisesProvider extends _i1.Mock implements _i9.ExercisesProvider {
|
||||
bool? searchEnglish = false,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchExercise,
|
||||
[name],
|
||||
{
|
||||
#languageCode: languageCode,
|
||||
#searchEnglish: searchEnglish,
|
||||
},
|
||||
),
|
||||
returnValue: _i10.Future<List<_i4.Exercise>>.value(<_i4.Exercise>[]),
|
||||
) as _i10.Future<List<_i4.Exercise>>);
|
||||
Invocation.method(
|
||||
#searchExercise,
|
||||
[name],
|
||||
{#languageCode: languageCode, #searchEnglish: searchEnglish},
|
||||
),
|
||||
returnValue: _i10.Future<List<_i4.Exercise>>.value(<_i4.Exercise>[]),
|
||||
)
|
||||
as _i10.Future<List<_i4.Exercise>>);
|
||||
|
||||
@override
|
||||
void addListener(_i11.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addListener,
|
||||
[listener],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
Invocation.method(#addListener, [listener]),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i11.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);
|
||||
}
|
||||
|
||||
@@ -31,53 +31,24 @@ import 'package:wger/providers/base_provider.dart' as _i8;
|
||||
// ignore_for_file: invalid_use_of_internal_member
|
||||
|
||||
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 {
|
||||
_FakeStreamedResponse_4(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
_FakeStreamedResponse_4(Object parent, Invocation parentInvocation)
|
||||
: super(parent, parentInvocation);
|
||||
}
|
||||
|
||||
/// A class which mocks [AuthProvider].
|
||||
@@ -89,154 +60,102 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, String> get metadata => (super.noSuchMethod(
|
||||
Invocation.getter(#metadata),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
Map<String, String> get metadata =>
|
||||
(super.noSuchMethod(Invocation.getter(#metadata), returnValue: <String, String>{})
|
||||
as Map<String, String>);
|
||||
|
||||
@override
|
||||
_i3.AuthState get state => (super.noSuchMethod(
|
||||
Invocation.getter(#state),
|
||||
returnValue: _i3.AuthState.updateRequired,
|
||||
) as _i3.AuthState);
|
||||
_i3.AuthState get state =>
|
||||
(super.noSuchMethod(Invocation.getter(#state), returnValue: _i3.AuthState.updateRequired)
|
||||
as _i3.AuthState);
|
||||
|
||||
@override
|
||||
_i2.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
returnValue: _FakeClient_0(
|
||||
this,
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i2.Client);
|
||||
_i2.Client get client =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
returnValue: _FakeClient_0(this, Invocation.getter(#client)),
|
||||
)
|
||||
as _i2.Client);
|
||||
|
||||
@override
|
||||
bool get dataInit => (super.noSuchMethod(
|
||||
Invocation.getter(#dataInit),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
bool get dataInit =>
|
||||
(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? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#token,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
set token(String? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#token, value), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
set serverUrl(String? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#serverUrl,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
set serverUrl(String? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#serverUrl, value), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
set serverVersion(String? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#serverVersion,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
set serverVersion(String? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#serverVersion, value), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
set applicationVersion(_i4.PackageInfo? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#applicationVersion,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
Invocation.setter(#applicationVersion, value),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set metadata(Map<String, String>? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#metadata,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
set metadata(Map<String, String>? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#metadata, value), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
set state(_i3.AuthState? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#state,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
set state(_i3.AuthState? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#state, value), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
set client(_i2.Client? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#client,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
set client(_i2.Client? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#client, value), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
set dataInit(bool? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#dataInit,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
set dataInit(bool? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#dataInit, 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
|
||||
_i5.Future<void> setServerVersion() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#setServerVersion,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
_i5.Future<void> setServerVersion() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#setServerVersion, []),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
)
|
||||
as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> setApplicationVersion() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#setApplicationVersion,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
_i5.Future<void> setApplicationVersion() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#setApplicationVersion, []),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
)
|
||||
as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> initVersions(String? serverUrl) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#initVersions,
|
||||
[serverUrl],
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
_i5.Future<void> initVersions(String? serverUrl) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#initVersions, [serverUrl]),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
)
|
||||
as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<bool> applicationUpdateRequired([String? version]) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#applicationUpdateRequired,
|
||||
[version],
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
_i5.Future<bool> applicationUpdateRequired([String? version]) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#applicationUpdateRequired, [version]),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
)
|
||||
as _i5.Future<bool>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.LoginActions> register({
|
||||
@@ -247,19 +166,16 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
String? locale = 'en',
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#register,
|
||||
[],
|
||||
{
|
||||
#username: username,
|
||||
#password: password,
|
||||
#email: email,
|
||||
#serverUrl: serverUrl,
|
||||
#locale: locale,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i3.LoginActions>.value(_i3.LoginActions.update),
|
||||
) as _i5.Future<_i3.LoginActions>);
|
||||
Invocation.method(#register, [], {
|
||||
#username: username,
|
||||
#password: password,
|
||||
#email: email,
|
||||
#serverUrl: serverUrl,
|
||||
#locale: locale,
|
||||
}),
|
||||
returnValue: _i5.Future<_i3.LoginActions>.value(_i3.LoginActions.update),
|
||||
)
|
||||
as _i5.Future<_i3.LoginActions>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.LoginActions> login(
|
||||
@@ -269,104 +185,66 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
String? apiToken,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#login,
|
||||
[
|
||||
username,
|
||||
password,
|
||||
serverUrl,
|
||||
apiToken,
|
||||
],
|
||||
),
|
||||
returnValue: _i5.Future<_i3.LoginActions>.value(_i3.LoginActions.update),
|
||||
) as _i5.Future<_i3.LoginActions>);
|
||||
Invocation.method(#login, [username, password, serverUrl, apiToken]),
|
||||
returnValue: _i5.Future<_i3.LoginActions>.value(_i3.LoginActions.update),
|
||||
)
|
||||
as _i5.Future<_i3.LoginActions>);
|
||||
|
||||
@override
|
||||
_i5.Future<String> getServerUrlFromPrefs() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getServerUrlFromPrefs,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<String>.value(_i6.dummyValue<String>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getServerUrlFromPrefs,
|
||||
[],
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<String>);
|
||||
_i5.Future<String> getServerUrlFromPrefs() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getServerUrlFromPrefs, []),
|
||||
returnValue: _i5.Future<String>.value(
|
||||
_i6.dummyValue<String>(this, Invocation.method(#getServerUrlFromPrefs, [])),
|
||||
),
|
||||
)
|
||||
as _i5.Future<String>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> tryAutoLogin() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#tryAutoLogin,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
_i5.Future<void> tryAutoLogin() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#tryAutoLogin, []),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
)
|
||||
as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> logout({bool? shouldNotify = true}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#logout,
|
||||
[],
|
||||
{#shouldNotify: shouldNotify},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
_i5.Future<void> logout({bool? shouldNotify = true}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#logout, [], {#shouldNotify: shouldNotify}),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
)
|
||||
as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
String getAppNameHeader() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getAppNameHeader,
|
||||
[],
|
||||
),
|
||||
returnValue: _i6.dummyValue<String>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getAppNameHeader,
|
||||
[],
|
||||
),
|
||||
),
|
||||
) as String);
|
||||
String getAppNameHeader() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getAppNameHeader, []),
|
||||
returnValue: _i6.dummyValue<String>(this, Invocation.method(#getAppNameHeader, [])),
|
||||
)
|
||||
as String);
|
||||
|
||||
@override
|
||||
void addListener(_i7.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addListener,
|
||||
[listener],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
Invocation.method(#addListener, [listener]),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i7.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 [WgerBaseProvider].
|
||||
@@ -378,156 +256,97 @@ class MockWgerBaseProvider extends _i1.Mock implements _i8.WgerBaseProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
_i3.AuthProvider get auth => (super.noSuchMethod(
|
||||
Invocation.getter(#auth),
|
||||
returnValue: _FakeAuthProvider_1(
|
||||
this,
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i3.AuthProvider);
|
||||
|
||||
@override
|
||||
_i2.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
returnValue: _FakeClient_0(
|
||||
this,
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i2.Client);
|
||||
|
||||
@override
|
||||
set auth(_i3.AuthProvider? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#auth,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set client(_i2.Client? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#client,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
{#includeAuth: includeAuth},
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
int? id,
|
||||
String? objectMethod,
|
||||
Map<String, dynamic>? query,
|
||||
}) =>
|
||||
_i3.AuthProvider get auth =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{
|
||||
#id: id,
|
||||
#objectMethod: objectMethod,
|
||||
#query: query,
|
||||
},
|
||||
),
|
||||
returnValue: _FakeUri_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{
|
||||
#id: id,
|
||||
#objectMethod: objectMethod,
|
||||
#query: query,
|
||||
},
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
Invocation.getter(#auth),
|
||||
returnValue: _FakeAuthProvider_1(this, Invocation.getter(#auth)),
|
||||
)
|
||||
as _i3.AuthProvider);
|
||||
|
||||
@override
|
||||
_i5.Future<dynamic> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<dynamic>.value(),
|
||||
) as _i5.Future<dynamic>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchPaginated,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
Uri? uri,
|
||||
) =>
|
||||
_i2.Client get client =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#post,
|
||||
[
|
||||
data,
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
Invocation.getter(#client),
|
||||
returnValue: _FakeClient_0(this, Invocation.getter(#client)),
|
||||
)
|
||||
as _i2.Client);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
Uri? uri,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#patch,
|
||||
[
|
||||
data,
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
set auth(_i3.AuthProvider? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#auth, value), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> deleteRequest(
|
||||
String? url,
|
||||
int? id,
|
||||
) =>
|
||||
set client(_i2.Client? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#client, value), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteRequest,
|
||||
[
|
||||
url,
|
||||
id,
|
||||
],
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#deleteRequest,
|
||||
[
|
||||
url,
|
||||
id,
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
Invocation.method(#getDefaultHeaders, [], {#includeAuth: includeAuth}),
|
||||
returnValue: <String, String>{},
|
||||
)
|
||||
as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(String? path, {int? id, String? objectMethod, Map<String, dynamic>? query}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{#id: id, #objectMethod: objectMethod, #query: query},
|
||||
),
|
||||
returnValue: _FakeUri_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{#id: id, #objectMethod: objectMethod, #query: query},
|
||||
),
|
||||
),
|
||||
)
|
||||
as Uri);
|
||||
|
||||
@override
|
||||
_i5.Future<dynamic> fetch(Uri? uri) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetch, [uri]),
|
||||
returnValue: _i5.Future<dynamic>.value(),
|
||||
)
|
||||
as _i5.Future<dynamic>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchPaginated, [uri]),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
)
|
||||
as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(Map<String, dynamic>? data, Uri? uri) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#post, [data, uri]),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
)
|
||||
as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> patch(Map<String, dynamic>? data, Uri? uri) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#patch, [data, uri]),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
)
|
||||
as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> deleteRequest(String? url, int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#deleteRequest, [url, id]),
|
||||
returnValue: _i5.Future<_i2.Response>.value(
|
||||
_FakeResponse_3(this, Invocation.method(#deleteRequest, [url, id])),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i2.Response>);
|
||||
}
|
||||
|
||||
/// A class which mocks [Client].
|
||||
@@ -539,46 +358,24 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
}
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> head(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
}) =>
|
||||
_i5.Future<_i2.Response> head(Uri? url, {Map<String, String>? headers}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#head,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#head,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
Invocation.method(#head, [url], {#headers: headers}),
|
||||
returnValue: _i5.Future<_i2.Response>.value(
|
||||
_FakeResponse_3(this, Invocation.method(#head, [url], {#headers: headers})),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> get(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
}) =>
|
||||
_i5.Future<_i2.Response> get(Uri? url, {Map<String, String>? headers}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#get,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#get,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
Invocation.method(#get, [url], {#headers: headers}),
|
||||
returnValue: _i5.Future<_i2.Response>.value(
|
||||
_FakeResponse_3(this, Invocation.method(#get, [url], {#headers: headers})),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> post(
|
||||
@@ -588,28 +385,19 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
_i9.Encoding? encoding,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#post,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#post,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
Invocation.method(#post, [url], {#headers: headers, #body: body, #encoding: encoding}),
|
||||
returnValue: _i5.Future<_i2.Response>.value(
|
||||
_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#post,
|
||||
[url],
|
||||
{#headers: headers, #body: body, #encoding: encoding},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> put(
|
||||
@@ -619,28 +407,19 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
_i9.Encoding? encoding,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#put,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#put,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
Invocation.method(#put, [url], {#headers: headers, #body: body, #encoding: encoding}),
|
||||
returnValue: _i5.Future<_i2.Response>.value(
|
||||
_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#put,
|
||||
[url],
|
||||
{#headers: headers, #body: body, #encoding: encoding},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> patch(
|
||||
@@ -650,28 +429,19 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
_i9.Encoding? encoding,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#patch,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#patch,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
Invocation.method(#patch, [url], {#headers: headers, #body: body, #encoding: encoding}),
|
||||
returnValue: _i5.Future<_i2.Response>.value(
|
||||
_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#patch,
|
||||
[url],
|
||||
{#headers: headers, #body: body, #encoding: encoding},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> delete(
|
||||
@@ -681,85 +451,53 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
_i9.Encoding? encoding,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#delete,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#delete,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
Invocation.method(
|
||||
#delete,
|
||||
[url],
|
||||
{#headers: headers, #body: body, #encoding: encoding},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(
|
||||
_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#delete,
|
||||
[url],
|
||||
{#headers: headers, #body: body, #encoding: encoding},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<String> read(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
}) =>
|
||||
_i5.Future<String> read(Uri? url, {Map<String, String>? headers}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#read,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
returnValue: _i5.Future<String>.value(_i6.dummyValue<String>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#read,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<String>);
|
||||
Invocation.method(#read, [url], {#headers: headers}),
|
||||
returnValue: _i5.Future<String>.value(
|
||||
_i6.dummyValue<String>(this, Invocation.method(#read, [url], {#headers: headers})),
|
||||
),
|
||||
)
|
||||
as _i5.Future<String>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i10.Uint8List> readBytes(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
}) =>
|
||||
_i5.Future<_i10.Uint8List> readBytes(Uri? url, {Map<String, String>? headers}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#readBytes,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
returnValue: _i5.Future<_i10.Uint8List>.value(_i10.Uint8List(0)),
|
||||
) as _i5.Future<_i10.Uint8List>);
|
||||
Invocation.method(#readBytes, [url], {#headers: headers}),
|
||||
returnValue: _i5.Future<_i10.Uint8List>.value(_i10.Uint8List(0)),
|
||||
)
|
||||
as _i5.Future<_i10.Uint8List>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#send,
|
||||
[request],
|
||||
),
|
||||
returnValue: _i5.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_4(
|
||||
this,
|
||||
Invocation.method(
|
||||
#send,
|
||||
[request],
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.StreamedResponse>);
|
||||
_i5.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#send, [request]),
|
||||
returnValue: _i5.Future<_i2.StreamedResponse>.value(
|
||||
_FakeStreamedResponse_4(this, Invocation.method(#send, [request])),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i2.StreamedResponse>);
|
||||
|
||||
@override
|
||||
void close() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#close,
|
||||
[],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
void close() =>
|
||||
super.noSuchMethod(Invocation.method(#close, []), returnValueForMissingStub: null);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -26,43 +26,19 @@ import 'package:wger/providers/base_provider.dart' as _i4;
|
||||
// ignore_for_file: invalid_use_of_internal_member
|
||||
|
||||
class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider {
|
||||
_FakeAuthProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
_FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
|
||||
}
|
||||
|
||||
class _FakeClient_1 extends _i1.SmartFake implements _i3.Client {
|
||||
_FakeClient_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
_FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
|
||||
}
|
||||
|
||||
class _FakeUri_2 extends _i1.SmartFake implements Uri {
|
||||
_FakeUri_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
_FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
|
||||
}
|
||||
|
||||
class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response {
|
||||
_FakeResponse_3(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
_FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
|
||||
}
|
||||
|
||||
/// A class which mocks [WgerBaseProvider].
|
||||
@@ -74,154 +50,95 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
_i2.AuthProvider get auth => (super.noSuchMethod(
|
||||
Invocation.getter(#auth),
|
||||
returnValue: _FakeAuthProvider_0(
|
||||
this,
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
returnValue: _FakeClient_1(
|
||||
this,
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set auth(_i2.AuthProvider? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#auth,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#client,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
{#includeAuth: includeAuth},
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
int? id,
|
||||
String? objectMethod,
|
||||
Map<String, dynamic>? query,
|
||||
}) =>
|
||||
_i2.AuthProvider get auth =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{
|
||||
#id: id,
|
||||
#objectMethod: objectMethod,
|
||||
#query: query,
|
||||
},
|
||||
),
|
||||
returnValue: _FakeUri_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{
|
||||
#id: id,
|
||||
#objectMethod: objectMethod,
|
||||
#query: query,
|
||||
},
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
Invocation.getter(#auth),
|
||||
returnValue: _FakeAuthProvider_0(this, Invocation.getter(#auth)),
|
||||
)
|
||||
as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
_i5.Future<dynamic> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<dynamic>.value(),
|
||||
) as _i5.Future<dynamic>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchPaginated,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
Uri? uri,
|
||||
) =>
|
||||
_i3.Client get client =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#post,
|
||||
[
|
||||
data,
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
Invocation.getter(#client),
|
||||
returnValue: _FakeClient_1(this, Invocation.getter(#client)),
|
||||
)
|
||||
as _i3.Client);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
Uri? uri,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#patch,
|
||||
[
|
||||
data,
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
set auth(_i2.AuthProvider? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#auth, value), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
int? id,
|
||||
) =>
|
||||
set client(_i3.Client? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#client, value), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteRequest,
|
||||
[
|
||||
url,
|
||||
id,
|
||||
],
|
||||
),
|
||||
returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#deleteRequest,
|
||||
[
|
||||
url,
|
||||
id,
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.Response>);
|
||||
Invocation.method(#getDefaultHeaders, [], {#includeAuth: includeAuth}),
|
||||
returnValue: <String, String>{},
|
||||
)
|
||||
as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(String? path, {int? id, String? objectMethod, Map<String, dynamic>? query}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{#id: id, #objectMethod: objectMethod, #query: query},
|
||||
),
|
||||
returnValue: _FakeUri_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{#id: id, #objectMethod: objectMethod, #query: query},
|
||||
),
|
||||
),
|
||||
)
|
||||
as Uri);
|
||||
|
||||
@override
|
||||
_i5.Future<dynamic> fetch(Uri? uri) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetch, [uri]),
|
||||
returnValue: _i5.Future<dynamic>.value(),
|
||||
)
|
||||
as _i5.Future<dynamic>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchPaginated, [uri]),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
)
|
||||
as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(Map<String, dynamic>? data, Uri? uri) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#post, [data, uri]),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
)
|
||||
as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> patch(Map<String, dynamic>? data, Uri? uri) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#patch, [data, uri]),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
)
|
||||
as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.Response> deleteRequest(String? url, int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#deleteRequest, [url, id]),
|
||||
returnValue: _i5.Future<_i3.Response>.value(
|
||||
_FakeResponse_3(this, Invocation.method(#deleteRequest, [url, id])),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i3.Response>);
|
||||
}
|
||||
|
||||
@@ -26,43 +26,19 @@ import 'package:wger/providers/base_provider.dart' as _i4;
|
||||
// ignore_for_file: invalid_use_of_internal_member
|
||||
|
||||
class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider {
|
||||
_FakeAuthProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
_FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
|
||||
}
|
||||
|
||||
class _FakeClient_1 extends _i1.SmartFake implements _i3.Client {
|
||||
_FakeClient_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
_FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
|
||||
}
|
||||
|
||||
class _FakeUri_2 extends _i1.SmartFake implements Uri {
|
||||
_FakeUri_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
_FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
|
||||
}
|
||||
|
||||
class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response {
|
||||
_FakeResponse_3(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
_FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
|
||||
}
|
||||
|
||||
/// A class which mocks [WgerBaseProvider].
|
||||
@@ -74,154 +50,95 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
_i2.AuthProvider get auth => (super.noSuchMethod(
|
||||
Invocation.getter(#auth),
|
||||
returnValue: _FakeAuthProvider_0(
|
||||
this,
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
returnValue: _FakeClient_1(
|
||||
this,
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set auth(_i2.AuthProvider? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#auth,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#client,
|
||||
value,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
{#includeAuth: includeAuth},
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
int? id,
|
||||
String? objectMethod,
|
||||
Map<String, dynamic>? query,
|
||||
}) =>
|
||||
_i2.AuthProvider get auth =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{
|
||||
#id: id,
|
||||
#objectMethod: objectMethod,
|
||||
#query: query,
|
||||
},
|
||||
),
|
||||
returnValue: _FakeUri_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{
|
||||
#id: id,
|
||||
#objectMethod: objectMethod,
|
||||
#query: query,
|
||||
},
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
Invocation.getter(#auth),
|
||||
returnValue: _FakeAuthProvider_0(this, Invocation.getter(#auth)),
|
||||
)
|
||||
as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
_i5.Future<dynamic> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<dynamic>.value(),
|
||||
) as _i5.Future<dynamic>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchPaginated,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
Uri? uri,
|
||||
) =>
|
||||
_i3.Client get client =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#post,
|
||||
[
|
||||
data,
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
Invocation.getter(#client),
|
||||
returnValue: _FakeClient_1(this, Invocation.getter(#client)),
|
||||
)
|
||||
as _i3.Client);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
Uri? uri,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#patch,
|
||||
[
|
||||
data,
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
set auth(_i2.AuthProvider? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#auth, value), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
int? id,
|
||||
) =>
|
||||
set client(_i3.Client? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#client, value), returnValueForMissingStub: null);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteRequest,
|
||||
[
|
||||
url,
|
||||
id,
|
||||
],
|
||||
),
|
||||
returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#deleteRequest,
|
||||
[
|
||||
url,
|
||||
id,
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.Response>);
|
||||
Invocation.method(#getDefaultHeaders, [], {#includeAuth: includeAuth}),
|
||||
returnValue: <String, String>{},
|
||||
)
|
||||
as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(String? path, {int? id, String? objectMethod, Map<String, dynamic>? query}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{#id: id, #objectMethod: objectMethod, #query: query},
|
||||
),
|
||||
returnValue: _FakeUri_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{#id: id, #objectMethod: objectMethod, #query: query},
|
||||
),
|
||||
),
|
||||
)
|
||||
as Uri);
|
||||
|
||||
@override
|
||||
_i5.Future<dynamic> fetch(Uri? uri) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetch, [uri]),
|
||||
returnValue: _i5.Future<dynamic>.value(),
|
||||
)
|
||||
as _i5.Future<dynamic>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#fetchPaginated, [uri]),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
)
|
||||
as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(Map<String, dynamic>? data, Uri? uri) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#post, [data, uri]),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
)
|
||||
as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> patch(Map<String, dynamic>? data, Uri? uri) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#patch, [data, uri]),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
)
|
||||
as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.Response> deleteRequest(String? url, int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#deleteRequest, [url, id]),
|
||||
returnValue: _i5.Future<_i3.Response>.value(
|
||||
_FakeResponse_3(this, Invocation.method(#deleteRequest, [url, id])),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i3.Response>);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user