Allow setting the day type in the edit form

This commit is contained in:
Roland Geider
2025-10-06 11:36:27 +02:00
parent 5e96667afb
commit 39be6a3edf
46 changed files with 8649 additions and 15614 deletions

View File

@@ -9,7 +9,7 @@ runs:
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.35.2
flutter-version: 3.35.5
cache: true
- name: Install Flutter dependencies

View File

@@ -155,8 +155,18 @@
"@category": {
"description": "Category for an exercise, ingredient, etc."
},
"endDate": "End date",
"startDate": "Start date",
"@startDate": {
"description": "The start date of a nutritional plan or routine"
},
"dayTypeCustom": "Custom",
"dayTypeEnom": "Every minute on the minute",
"dayTypeAmrap": "As many rounds as possible",
"dayTypeHiit": "High intensity interval training",
"dayTypeTabata": "Tabata",
"dayTypeEdt": "Escalating density training",
"dayTypeRft": "Rounds for time",
"dayTypeAfap": "As fast as possible",
"routines": "Routines",
"newRoutine": "New routine",
"noRoutines": "You have no routines",
@@ -387,13 +397,9 @@
"@date": {
"description": "The date of a workout log or body weight entry"
},
"creationDate": "Start date",
"@creationDate": {
"description": "The Start date of a nutritional plan"
},
"endDate": "End date",
"@endDate": {
"description": "The End date of a nutritional plan"
"description": "The End date of a nutritional plan or routine"
},
"openEnded": "Open ended",
"@openEnded": {

View File

@@ -16,11 +16,40 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'package:flutter/widgets.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:wger/l10n/generated/app_localizations.dart';
import 'package:wger/models/workouts/slot.dart';
part 'day.g.dart';
enum DayType { custom, enom, amrap, hiit, tabata, edt, rft, afap }
extension DayTypeExtension on DayType {
String i18Label(BuildContext context) {
final i18n = AppLocalizations.of(context);
switch (this) {
case DayType.custom:
return i18n.dayTypeCustom;
case DayType.enom:
return i18n.dayTypeEnom;
case DayType.amrap:
return i18n.dayTypeAmrap;
case DayType.hiit:
return i18n.dayTypeHiit;
case DayType.tabata:
return i18n.dayTypeTabata;
case DayType.edt:
return i18n.dayTypeEdt;
case DayType.rft:
return i18n.dayTypeRft;
case DayType.afap:
return i18n.dayTypeAfap;
}
}
}
@JsonSerializable()
class Day {
static const MIN_LENGTH_NAME = 3;
@@ -39,48 +68,65 @@ class Day {
@JsonKey(required: true)
late String description;
@JsonKey(required: true)
late DayType type;
@JsonKey(required: true, name: 'is_rest')
late bool isRest;
@JsonKey(required: true, name: 'need_logs_to_advance')
late bool needLogsToAdvance;
@JsonKey(required: true)
late String type;
@JsonKey(required: true)
late num order;
@JsonKey(required: true)
late Object? config;
@JsonKey(required: false, defaultValue: [], includeFromJson: true, includeToJson: false)
@JsonKey(required: false, includeFromJson: true, includeToJson: false)
List<Slot> slots = [];
Day({
this.id,
required this.routineId,
required this.name,
required this.description,
this.description = '',
this.isRest = false,
this.needLogsToAdvance = false,
this.type = 'custom',
this.order = 0,
this.config = null,
this.type = DayType.custom,
this.order = 1,
this.config,
this.slots = const [],
});
Day.empty() {
name = 'new day';
description = '';
type = 'custom';
isRest = false;
needLogsToAdvance = false;
order = 0;
config = {};
slots = [];
Day copyWith({
int? id,
int? routineId,
String? name,
String? description,
DayType? type,
bool? isRest,
bool? needLogsToAdvance,
num? order,
Object? config,
List<Slot>? slots,
}) {
return Day(
id: id ?? this.id,
routineId: routineId ?? this.routineId,
name: name ?? this.name,
description: description ?? this.description,
type: type ?? this.type,
isRest: isRest ?? this.isRest,
needLogsToAdvance: needLogsToAdvance ?? this.needLogsToAdvance,
order: order ?? this.order,
config: config ?? this.config,
slots: slots ?? this.slots,
);
}
bool get isSpecialType => type != DayType.custom;
// Boilerplate
factory Day.fromJson(Map<String, dynamic> json) => _$DayFromJson(json);

View File

@@ -14,24 +14,25 @@ Day _$DayFromJson(Map<String, dynamic> json) {
'routine',
'name',
'description',
'type',
'is_rest',
'need_logs_to_advance',
'type',
'order',
'config'
'config',
],
);
return Day(
id: (json['id'] as num?)?.toInt(),
routineId: (json['routine'] as num).toInt(),
name: json['name'] as String,
description: json['description'] as String,
description: json['description'] as String? ?? '',
isRest: json['is_rest'] as bool? ?? false,
needLogsToAdvance: json['need_logs_to_advance'] as bool? ?? false,
type: json['type'] as String? ?? 'custom',
order: json['order'] as num? ?? 0,
config: json['config'] ?? null,
slots: (json['slots'] as List<dynamic>?)
type: $enumDecodeNullable(_$DayTypeEnumMap, json['type']) ?? DayType.custom,
order: json['order'] as num? ?? 1,
config: json['config'],
slots:
(json['slots'] as List<dynamic>?)
?.map((e) => Slot.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
@@ -39,12 +40,23 @@ Day _$DayFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$DayToJson(Day instance) => <String, dynamic>{
'routine': instance.routineId,
'name': instance.name,
'description': instance.description,
'is_rest': instance.isRest,
'need_logs_to_advance': instance.needLogsToAdvance,
'type': instance.type,
'order': instance.order,
'config': instance.config,
};
'routine': instance.routineId,
'name': instance.name,
'description': instance.description,
'type': _$DayTypeEnumMap[instance.type]!,
'is_rest': instance.isRest,
'need_logs_to_advance': instance.needLogsToAdvance,
'order': instance.order,
'config': instance.config,
};
const _$DayTypeEnumMap = {
DayType.custom: 'custom',
DayType.enom: 'enom',
DayType.amrap: 'amrap',
DayType.hiit: 'hiit',
DayType.tabata: 'tabata',
DayType.edt: 'edt',
DayType.rft: 'rft',
DayType.afap: 'afap',
};

View File

@@ -7,16 +7,14 @@ part of 'day_data.dart';
// **************************************************************************
DayData _$DayDataFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['iteration', 'date', 'label'],
);
$checkKeys(json, requiredKeys: const ['iteration', 'date', 'label']);
return DayData(
iteration: (json['iteration'] as num).toInt(),
date: DateTime.parse(json['date'] as String),
label: json['label'] as String? ?? '',
day: json['day'] == null ? null : Day.fromJson(json['day'] as Map<String, dynamic>),
slots: (json['slots'] as List<dynamic>?)
slots:
(json['slots'] as List<dynamic>?)
?.map((e) => SlotData.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
@@ -24,9 +22,9 @@ DayData _$DayDataFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$DayDataToJson(DayData instance) => <String, dynamic>{
'iteration': instance.iteration,
'date': instance.date.toIso8601String(),
'label': instance.label,
'day': instance.day,
'slots': instance.slots,
};
'iteration': instance.iteration,
'date': instance.date.toIso8601String(),
'label': instance.label,
'day': instance.day,
'slots': instance.slots,
};

View File

@@ -7,25 +7,24 @@ part of 'slot.dart';
// **************************************************************************
Slot _$SlotFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'order', 'comment', 'config'],
);
$checkKeys(json, requiredKeys: const ['id', 'order', 'comment', 'config']);
return Slot(
id: (json['id'] as num?)?.toInt(),
day: (json['day'] as num).toInt(),
comment: json['comment'] as String? ?? '',
order: (json['order'] as num).toInt(),
config: json['config'],
)..entries = (json['entries'] as List<dynamic>?)
?.map((e) => SlotEntry.fromJson(e as Map<String, dynamic>))
.toList() ??
[];
id: (json['id'] as num?)?.toInt(),
day: (json['day'] as num).toInt(),
comment: json['comment'] as String? ?? '',
order: (json['order'] as num).toInt(),
config: json['config'],
)
..entries =
(json['entries'] as List<dynamic>?)
?.map((e) => SlotEntry.fromJson(e as Map<String, dynamic>))
.toList() ??
[];
}
Map<String, dynamic> _$SlotToJson(Slot instance) => <String, dynamic>{
'day': instance.day,
'order': instance.order,
'comment': instance.comment,
'config': instance.config,
};
'day': instance.day,
'order': instance.order,
'comment': instance.comment,
'config': instance.config,
};

View File

@@ -7,16 +7,14 @@ part of 'slot_data.dart';
// **************************************************************************
SlotData _$SlotDataFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['comment', 'is_superset', 'exercises', 'sets'],
);
$checkKeys(json, requiredKeys: const ['comment', 'is_superset', 'exercises', 'sets']);
return SlotData(
comment: json['comment'] as String,
isSuperset: json['is_superset'] as bool,
exerciseIds:
(json['exercises'] as List<dynamic>?)?.map((e) => (e as num).toInt()).toList() ?? const [],
setConfigs: (json['sets'] as List<dynamic>?)
setConfigs:
(json['sets'] as List<dynamic>?)
?.map((e) => SetConfigData.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
@@ -24,8 +22,8 @@ SlotData _$SlotDataFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$SlotDataToJson(SlotData instance) => <String, dynamic>{
'comment': instance.comment,
'is_superset': instance.isSuperset,
'exercises': instance.exerciseIds,
'sets': instance.setConfigs,
};
'comment': instance.comment,
'is_superset': instance.isSuperset,
'exercises': instance.exerciseIds,
'sets': instance.setConfigs,
};

View File

@@ -26,6 +26,8 @@ import 'package:wger/models/workouts/weight_unit.dart';
part 'slot_entry.g.dart';
enum SlotEntryType { normal, dropset, myo, partial, forced, tut, iso, jump }
enum ConfigType {
weight,
maxWeight,
@@ -163,9 +165,9 @@ class SlotEntry {
String? type,
required Exercise exercise,
int? weightUnitId,
num? weightRounding,
this.weightRounding,
int? repetitionUnitId,
num? repetitionRounding,
this.repetitionRounding,
}) {
this.order = order ?? 1;
this.comment = comment ?? '';
@@ -174,13 +176,11 @@ class SlotEntry {
exerciseObj = exercise;
exerciseId = exercise.id!;
this.weightUnitId = weightUnitId ?? WEIGHT_UNIT_KG;
this.weightRounding = weightRounding;
this.repetitionUnitId = repetitionUnitId ?? REP_UNIT_REPETITIONS_ID;
this.repetitionRounding = repetitionRounding;
}
get rir {
String get rir {
return 'DELETE ME! RIR';
}

View File

@@ -20,7 +20,7 @@ SlotEntry _$SlotEntryFromJson(Map<String, dynamic> json) {
'repetition_rounding',
'weight_unit',
'weight_rounding',
'config'
'config',
],
);
return SlotEntry(
@@ -34,43 +34,53 @@ SlotEntry _$SlotEntryFromJson(Map<String, dynamic> json) {
weightUnitId: (json['weight_unit'] as num?)?.toInt(),
weightRounding: stringToNumNull(json['weight_rounding'] as String?),
comment: json['comment'] as String,
weightConfigs: (json['weight_configs'] as List<dynamic>?)
weightConfigs:
(json['weight_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
maxWeightConfigs: (json['max_weight_configs'] as List<dynamic>?)
maxWeightConfigs:
(json['max_weight_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
nrOfSetsConfigs: (json['set_nr_configs'] as List<dynamic>?)
nrOfSetsConfigs:
(json['set_nr_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
maxNrOfSetsConfigs: (json['max_set_nr_configs'] as List<dynamic>?)
maxNrOfSetsConfigs:
(json['max_set_nr_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
rirConfigs: (json['rir_configs'] as List<dynamic>?)
rirConfigs:
(json['rir_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
maxRirConfigs: (json['max_rir_configs'] as List<dynamic>?)
maxRirConfigs:
(json['max_rir_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
restTimeConfigs: (json['rest_configs'] as List<dynamic>?)
restTimeConfigs:
(json['rest_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
maxRestTimeConfigs: (json['max_rest_configs'] as List<dynamic>?)
maxRestTimeConfigs:
(json['max_rest_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
repetitionsConfigs: (json['repetitions_configs'] as List<dynamic>?)
repetitionsConfigs:
(json['repetitions_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
maxRepetitionsConfigs: (json['max_repetitions_configs'] as List<dynamic>?)
maxRepetitionsConfigs:
(json['max_repetitions_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
@@ -78,14 +88,14 @@ SlotEntry _$SlotEntryFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$SlotEntryToJson(SlotEntry instance) => <String, dynamic>{
'slot': instance.slotId,
'order': instance.order,
'comment': instance.comment,
'type': instance.type,
'exercise': instance.exerciseId,
'repetition_unit': instance.repetitionUnitId,
'repetition_rounding': instance.repetitionRounding,
'weight_unit': instance.weightUnitId,
'weight_rounding': instance.weightRounding,
'config': instance.config,
};
'slot': instance.slotId,
'order': instance.order,
'comment': instance.comment,
'type': instance.type,
'exercise': instance.exerciseId,
'repetition_unit': instance.repetitionUnitId,
'repetition_rounding': instance.repetitionRounding,
'weight_unit': instance.weightUnitId,
'weight_rounding': instance.weightRounding,
'config': instance.config,
};

View File

@@ -39,10 +39,7 @@ class SetConfigDataWidget extends StatelessWidget {
return ListTile(
leading: InkWell(
child: SizedBox(
width: 45,
child: ExerciseImageWidget(image: exercise.getMainImage),
),
child: SizedBox(width: 45, child: ExerciseImageWidget(image: exercise.getMainImage)),
onTap: () {
showDialog(
context: context,
@@ -52,9 +49,7 @@ class SetConfigDataWidget extends StatelessWidget {
content: ExerciseDetail(exercise),
actions: [
TextButton(
child: Text(
MaterialLocalizations.of(context).closeButtonLabel,
),
child: Text(MaterialLocalizations.of(context).closeButtonLabel),
onPressed: () {
Navigator.of(context).pop();
},
@@ -128,9 +123,9 @@ class DayHeader extends StatelessWidget {
final bool _viewMode;
const DayHeader({required DayData day, required int routineId, bool viewMode = false})
: _dayData = day,
_viewMode = viewMode,
_routineId = routineId;
: _dayData = day,
_viewMode = viewMode,
_routineId = routineId;
@override
Widget build(BuildContext context) {
@@ -151,11 +146,15 @@ class DayHeader extends StatelessWidget {
);
}
final dayTypeLabel = _dayData.day!.isSpecialType
? '\n(${_dayData.day!.type.name.toUpperCase()})'
: '';
return ListTile(
tileColor: Theme.of(context).focusColor,
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
title: Text(
_dayData.day!.name,
'${_dayData.day!.name}$dayTypeLabel',
style: Theme.of(context).textTheme.headlineSmall,
overflow: TextOverflow.ellipsis,
),

View File

@@ -102,10 +102,7 @@ class _ReorderableDaysListState extends State<ReorderableDaysList> {
),
IconButton(
icon: const Icon(Icons.delete),
onPressed: () => widget._showDeleteConfirmationDialog(
context,
day,
),
onPressed: () => widget._showDeleteConfirmationDialog(context, day),
),
],
),
@@ -149,7 +146,11 @@ class _ReorderableDaysListState extends State<ReorderableDaysList> {
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () async {
final day = Day.empty();
final day = Day(
routineId: widget.routineId,
name: '${i18n.newDay} ${widget.days.length + 1}',
order: widget.days.length + 1,
);
day.name = '${i18n.newDay} ${widget.days.length + 1}';
day.routineId = widget.routineId;
day.order = widget.days.length + 1;
@@ -165,11 +166,10 @@ class _ReorderableDaysListState extends State<ReorderableDaysList> {
}
class DayFormWidget extends StatefulWidget {
final int routineId;
late final Day day;
DayFormWidget({required this.routineId, required this.day, super.key}) {
day.routineId = routineId;
DayFormWidget({required Day day, super.key}) {
this.day = day.copyWith();
}
@override
@@ -181,8 +181,6 @@ class _DayFormWidgetState extends State<DayFormWidget> {
final descriptionController = TextEditingController();
final nameController = TextEditingController();
late bool isRestDay;
late bool needLogsToAdvance;
bool isSaving = false;
final _form = GlobalKey<FormState>();
@@ -190,8 +188,6 @@ class _DayFormWidgetState extends State<DayFormWidget> {
@override
void initState() {
super.initState();
isRestDay = widget.day.isRest;
needLogsToAdvance = widget.day.needLogsToAdvance;
descriptionController.text = widget.day.description;
nameController.text = widget.day.name;
}
@@ -221,11 +217,13 @@ class _DayFormWidgetState extends State<DayFormWidget> {
key: const Key('field-is-rest-day'),
title: Text(i18n.isRestDay),
subtitle: Text(i18n.isRestDayHelp),
value: isRestDay,
value: widget.day.isRest,
contentPadding: const EdgeInsets.all(4),
onChanged: (value) {
setState(() {
isRestDay = value;
widget.day.isRest = value;
widget.day.type = DayType.custom;
widget.day.needLogsToAdvance = false;
nameController.clear();
descriptionController.clear();
});
@@ -235,9 +233,7 @@ class _DayFormWidgetState extends State<DayFormWidget> {
TextFormField(
enabled: !widget.day.isRest,
key: const Key('field-name'),
decoration: InputDecoration(
labelText: i18n.name,
),
decoration: InputDecoration(labelText: i18n.name),
controller: nameController,
onSaved: (value) {
widget.day.name = value!;
@@ -259,6 +255,7 @@ class _DayFormWidgetState extends State<DayFormWidget> {
return null;
},
),
TextFormField(
key: const Key('field-description'),
enabled: !widget.day.isRest,
@@ -281,19 +278,36 @@ class _DayFormWidgetState extends State<DayFormWidget> {
return null;
},
),
DropdownButtonFormField<DayType>(
key: const Key('field-day-type'),
initialValue: widget.day.type,
decoration: const InputDecoration(labelText: 'Typ'),
items: DayType.values.map((type) {
return DropdownMenuItem(
value: type,
child: Text('${type.name.toUpperCase()} - ${type.i18Label(context)}'),
);
}).toList(),
onChanged: widget.day.isRest
? null
: (value) {
setState(() {
widget.day.type = value!;
});
},
),
SwitchListTile(
key: const Key('field-need-logs-to-advance'),
title: Text(i18n.needsLogsToAdvance),
subtitle: Text(i18n.needsLogsToAdvanceHelp),
value: needLogsToAdvance,
value: widget.day.needLogsToAdvance,
contentPadding: const EdgeInsets.all(4),
onChanged: widget.day.isRest
? null
: (value) {
setState(() {
needLogsToAdvance = value;
widget.day.needLogsToAdvance = value;
});
widget.day.needLogsToAdvance = value;
},
),
const SizedBox(height: 5),
@@ -309,8 +323,10 @@ class _DayFormWidgetState extends State<DayFormWidget> {
setState(() => isSaving = true);
try {
await Provider.of<RoutinesProvider>(context, listen: false)
.editDay(widget.day);
await Provider.of<RoutinesProvider>(
context,
listen: false,
).editDay(widget.day);
if (context.mounted) {
setState(() {
errorMessage = const SizedBox.shrink();
@@ -330,8 +346,9 @@ class _DayFormWidgetState extends State<DayFormWidget> {
}
}
},
child:
isSaving ? const FormProgressIndicator() : Text(AppLocalizations.of(context).save),
child: isSaving
? const FormProgressIndicator()
: Text(AppLocalizations.of(context).save),
),
const SizedBox(height: 5),
ReorderableSlotList(widget.day.slots, widget.day),

View File

@@ -30,11 +30,11 @@ class RiRInputWidget extends StatefulWidget {
static const SLIDER_START = -0.5;
RiRInputWidget(this._initialValue, {required this.onChanged}) {
dropdownValue = _initialValue != null ? _initialValue!.toString() : SlotEntry.DEFAULT_RIR;
dropdownValue = _initialValue != null ? _initialValue.toString() : SlotEntry.DEFAULT_RIR;
// Read string RiR into a double
if (_initialValue != null) {
_currentSetSliderValue = _initialValue!.toDouble();
_currentSetSliderValue = _initialValue.toDouble();
} else {
_currentSetSliderValue = SLIDER_START;
}

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:wger/l10n/generated/app_localizations.dart';
import 'package:wger/models/exercises/exercise.dart';
import 'package:wger/models/workouts/day.dart';
import 'package:wger/models/workouts/day_data.dart';
import 'package:wger/widgets/exercises/images.dart';
import 'package:wger/widgets/routines/gym_mode/navigation.dart';
@@ -24,6 +25,17 @@ class StartPage extends StatelessWidget {
Expanded(
child: ListView(
children: [
if (_dayData.day!.isSpecialType)
Center(
child: Padding(
padding: const EdgeInsets.all(15),
child: Text(
'${_dayData.day!.type.name.toUpperCase()}\n${_dayData.day!.type.i18Label(context)}',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headlineSmall,
),
),
),
..._dayData.slots.map((slotData) {
return Column(
children: [
@@ -42,9 +54,11 @@ class StartPage extends StatelessWidget {
width: 45,
child: ExerciseImageWidget(image: exercise.getMainImage),
),
title: Text(exercise
.getTranslation(Localizations.localeOf(context).languageCode)
.name),
title: Text(
exercise
.getTranslation(Localizations.localeOf(context).languageCode)
.name,
),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: entry.value.map((text) => Text(text)).toList(),

View File

@@ -53,10 +53,7 @@ class _RoutineEditState extends State<RoutineEdit> {
children: [
RoutineForm(widget._routine, useListView: false),
Container(height: 10),
Text(
i18n.routineDays,
style: Theme.of(context).textTheme.titleLarge,
),
Text(i18n.routineDays, style: Theme.of(context).textTheme.titleLarge),
ReorderableDaysList(
routineId: widget._routine.id!,
days: widget._routine.days.where((day) => day.id != null).toList(),
@@ -71,17 +68,9 @@ class _RoutineEditState extends State<RoutineEdit> {
});
},
),
if (selectedDay != null)
DayFormWidget(
key: ValueKey(selectedDayId),
day: selectedDay,
routineId: widget._routine.id!,
),
if (selectedDay != null) DayFormWidget(key: ValueKey(selectedDayId), day: selectedDay),
const SizedBox(height: 25),
Text(
i18n.resultingRoutine,
style: Theme.of(context).textTheme.titleLarge,
),
Text(i18n.resultingRoutine, style: Theme.of(context).textTheme.titleLarge),
const Divider(),
RoutineDetail(widget._routine, viewMode: true),
],

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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);
}

View File

@@ -29,43 +29,19 @@ import 'package:wger/providers/gallery.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 [GalleryProvider].
@@ -77,274 +53,168 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
}
@override
List<_i5.Image> get images => (super.noSuchMethod(
Invocation.getter(#images),
returnValue: <_i5.Image>[],
) as List<_i5.Image>);
List<_i5.Image> get images =>
(super.noSuchMethod(Invocation.getter(#images), returnValue: <_i5.Image>[])
as List<_i5.Image>);
@override
set images(List<_i5.Image>? value) => super.noSuchMethod(
Invocation.setter(
#images,
value,
),
returnValueForMissingStub: null,
);
set images(List<_i5.Image>? value) =>
super.noSuchMethod(Invocation.setter(#images, value), returnValueForMissingStub: null);
@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
bool get hasListeners => (super.noSuchMethod(
Invocation.getter(#hasListeners),
returnValue: false,
) as bool);
@override
void clear() => super.noSuchMethod(
Invocation.method(
#clear,
[],
),
returnValueForMissingStub: null,
);
@override
_i6.Future<void> fetchAndSetGallery() => (super.noSuchMethod(
Invocation.method(
#fetchAndSetGallery,
[],
),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
) as _i6.Future<void>);
@override
_i6.Future<void> addImage(
_i5.Image? image,
_i7.XFile? imageFile,
) =>
_i2.AuthProvider get auth =>
(super.noSuchMethod(
Invocation.method(
#addImage,
[
image,
imageFile,
],
),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
) as _i6.Future<void>);
Invocation.getter(#auth),
returnValue: _FakeAuthProvider_0(this, Invocation.getter(#auth)),
)
as _i2.AuthProvider);
@override
_i6.Future<void> editImage(
_i5.Image? image,
_i7.XFile? imageFile,
) =>
_i3.Client get client =>
(super.noSuchMethod(
Invocation.method(
#editImage,
[
image,
imageFile,
],
),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
) as _i6.Future<void>);
Invocation.getter(#client),
returnValue: _FakeClient_1(this, Invocation.getter(#client)),
)
as _i3.Client);
@override
_i6.Future<void> deleteImage(_i5.Image? image) => (super.noSuchMethod(
Invocation.method(
#deleteImage,
[image],
),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
) as _i6.Future<void>);
set auth(_i2.AuthProvider? value) =>
super.noSuchMethod(Invocation.setter(#auth, 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>);
set client(_i3.Client? value) =>
super.noSuchMethod(Invocation.setter(#client, value), returnValueForMissingStub: null);
@override
Uri makeUrl(
String? path, {
int? id,
String? objectMethod,
Map<String, dynamic>? query,
}) =>
bool get hasListeners =>
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool);
@override
void clear() =>
super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null);
@override
_i6.Future<void> fetchAndSetGallery() =>
(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.method(#fetchAndSetGallery, []),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
)
as _i6.Future<void>);
@override
_i6.Future<dynamic> fetch(Uri? uri) => (super.noSuchMethod(
Invocation.method(
#fetch,
[uri],
),
returnValue: _i6.Future<dynamic>.value(),
) as _i6.Future<dynamic>);
@override
_i6.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
Invocation.method(
#fetchPaginated,
[uri],
),
returnValue: _i6.Future<List<dynamic>>.value(<dynamic>[]),
) as _i6.Future<List<dynamic>>);
@override
_i6.Future<Map<String, dynamic>> post(
Map<String, dynamic>? data,
Uri? uri,
) =>
_i6.Future<void> addImage(_i5.Image? image, _i7.XFile? imageFile) =>
(super.noSuchMethod(
Invocation.method(
#post,
[
data,
uri,
],
),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
Invocation.method(#addImage, [image, imageFile]),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
)
as _i6.Future<void>);
@override
_i6.Future<Map<String, dynamic>> patch(
Map<String, dynamic>? data,
Uri? uri,
) =>
_i6.Future<void> editImage(_i5.Image? image, _i7.XFile? imageFile) =>
(super.noSuchMethod(
Invocation.method(
#patch,
[
data,
uri,
],
),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
Invocation.method(#editImage, [image, imageFile]),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
)
as _i6.Future<void>);
@override
_i6.Future<_i3.Response> deleteRequest(
String? url,
int? id,
) =>
_i6.Future<void> deleteImage(_i5.Image? image) =>
(super.noSuchMethod(
Invocation.method(
#deleteRequest,
[
url,
id,
],
),
returnValue: _i6.Future<_i3.Response>.value(_FakeResponse_3(
this,
Invocation.method(
#deleteRequest,
[
url,
id,
],
),
)),
) as _i6.Future<_i3.Response>);
Invocation.method(#deleteImage, [image]),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
)
as _i6.Future<void>);
@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}) =>
(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
_i6.Future<dynamic> fetch(Uri? uri) =>
(super.noSuchMethod(
Invocation.method(#fetch, [uri]),
returnValue: _i6.Future<dynamic>.value(),
)
as _i6.Future<dynamic>);
@override
_i6.Future<List<dynamic>> fetchPaginated(Uri? uri) =>
(super.noSuchMethod(
Invocation.method(#fetchPaginated, [uri]),
returnValue: _i6.Future<List<dynamic>>.value(<dynamic>[]),
)
as _i6.Future<List<dynamic>>);
@override
_i6.Future<Map<String, dynamic>> post(Map<String, dynamic>? data, Uri? uri) =>
(super.noSuchMethod(
Invocation.method(#post, [data, uri]),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
)
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<Map<String, dynamic>> patch(Map<String, dynamic>? data, Uri? uri) =>
(super.noSuchMethod(
Invocation.method(#patch, [data, uri]),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
)
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<_i3.Response> deleteRequest(String? url, int? id) =>
(super.noSuchMethod(
Invocation.method(#deleteRequest, [url, id]),
returnValue: _i6.Future<_i3.Response>.value(
_FakeResponse_3(this, Invocation.method(#deleteRequest, [url, id])),
),
)
as _i6.Future<_i3.Response>);
@override
void addListener(_i8.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,
[listener],
),
returnValueForMissingStub: null,
);
Invocation.method(#addListener, [listener]),
returnValueForMissingStub: null,
);
@override
void removeListener(_i8.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);
}

View File

@@ -29,43 +29,19 @@ import 'package:wger/providers/gallery.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 [GalleryProvider].
@@ -77,274 +53,168 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
}
@override
List<_i5.Image> get images => (super.noSuchMethod(
Invocation.getter(#images),
returnValue: <_i5.Image>[],
) as List<_i5.Image>);
List<_i5.Image> get images =>
(super.noSuchMethod(Invocation.getter(#images), returnValue: <_i5.Image>[])
as List<_i5.Image>);
@override
set images(List<_i5.Image>? value) => super.noSuchMethod(
Invocation.setter(
#images,
value,
),
returnValueForMissingStub: null,
);
set images(List<_i5.Image>? value) =>
super.noSuchMethod(Invocation.setter(#images, value), returnValueForMissingStub: null);
@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
bool get hasListeners => (super.noSuchMethod(
Invocation.getter(#hasListeners),
returnValue: false,
) as bool);
@override
void clear() => super.noSuchMethod(
Invocation.method(
#clear,
[],
),
returnValueForMissingStub: null,
);
@override
_i6.Future<void> fetchAndSetGallery() => (super.noSuchMethod(
Invocation.method(
#fetchAndSetGallery,
[],
),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
) as _i6.Future<void>);
@override
_i6.Future<void> addImage(
_i5.Image? image,
_i7.XFile? imageFile,
) =>
_i2.AuthProvider get auth =>
(super.noSuchMethod(
Invocation.method(
#addImage,
[
image,
imageFile,
],
),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
) as _i6.Future<void>);
Invocation.getter(#auth),
returnValue: _FakeAuthProvider_0(this, Invocation.getter(#auth)),
)
as _i2.AuthProvider);
@override
_i6.Future<void> editImage(
_i5.Image? image,
_i7.XFile? imageFile,
) =>
_i3.Client get client =>
(super.noSuchMethod(
Invocation.method(
#editImage,
[
image,
imageFile,
],
),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
) as _i6.Future<void>);
Invocation.getter(#client),
returnValue: _FakeClient_1(this, Invocation.getter(#client)),
)
as _i3.Client);
@override
_i6.Future<void> deleteImage(_i5.Image? image) => (super.noSuchMethod(
Invocation.method(
#deleteImage,
[image],
),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
) as _i6.Future<void>);
set auth(_i2.AuthProvider? value) =>
super.noSuchMethod(Invocation.setter(#auth, 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>);
set client(_i3.Client? value) =>
super.noSuchMethod(Invocation.setter(#client, value), returnValueForMissingStub: null);
@override
Uri makeUrl(
String? path, {
int? id,
String? objectMethod,
Map<String, dynamic>? query,
}) =>
bool get hasListeners =>
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool);
@override
void clear() =>
super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null);
@override
_i6.Future<void> fetchAndSetGallery() =>
(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.method(#fetchAndSetGallery, []),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
)
as _i6.Future<void>);
@override
_i6.Future<dynamic> fetch(Uri? uri) => (super.noSuchMethod(
Invocation.method(
#fetch,
[uri],
),
returnValue: _i6.Future<dynamic>.value(),
) as _i6.Future<dynamic>);
@override
_i6.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
Invocation.method(
#fetchPaginated,
[uri],
),
returnValue: _i6.Future<List<dynamic>>.value(<dynamic>[]),
) as _i6.Future<List<dynamic>>);
@override
_i6.Future<Map<String, dynamic>> post(
Map<String, dynamic>? data,
Uri? uri,
) =>
_i6.Future<void> addImage(_i5.Image? image, _i7.XFile? imageFile) =>
(super.noSuchMethod(
Invocation.method(
#post,
[
data,
uri,
],
),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
Invocation.method(#addImage, [image, imageFile]),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
)
as _i6.Future<void>);
@override
_i6.Future<Map<String, dynamic>> patch(
Map<String, dynamic>? data,
Uri? uri,
) =>
_i6.Future<void> editImage(_i5.Image? image, _i7.XFile? imageFile) =>
(super.noSuchMethod(
Invocation.method(
#patch,
[
data,
uri,
],
),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
Invocation.method(#editImage, [image, imageFile]),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
)
as _i6.Future<void>);
@override
_i6.Future<_i3.Response> deleteRequest(
String? url,
int? id,
) =>
_i6.Future<void> deleteImage(_i5.Image? image) =>
(super.noSuchMethod(
Invocation.method(
#deleteRequest,
[
url,
id,
],
),
returnValue: _i6.Future<_i3.Response>.value(_FakeResponse_3(
this,
Invocation.method(
#deleteRequest,
[
url,
id,
],
),
)),
) as _i6.Future<_i3.Response>);
Invocation.method(#deleteImage, [image]),
returnValue: _i6.Future<void>.value(),
returnValueForMissingStub: _i6.Future<void>.value(),
)
as _i6.Future<void>);
@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}) =>
(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
_i6.Future<dynamic> fetch(Uri? uri) =>
(super.noSuchMethod(
Invocation.method(#fetch, [uri]),
returnValue: _i6.Future<dynamic>.value(),
)
as _i6.Future<dynamic>);
@override
_i6.Future<List<dynamic>> fetchPaginated(Uri? uri) =>
(super.noSuchMethod(
Invocation.method(#fetchPaginated, [uri]),
returnValue: _i6.Future<List<dynamic>>.value(<dynamic>[]),
)
as _i6.Future<List<dynamic>>);
@override
_i6.Future<Map<String, dynamic>> post(Map<String, dynamic>? data, Uri? uri) =>
(super.noSuchMethod(
Invocation.method(#post, [data, uri]),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
)
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<Map<String, dynamic>> patch(Map<String, dynamic>? data, Uri? uri) =>
(super.noSuchMethod(
Invocation.method(#patch, [data, uri]),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
)
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<_i3.Response> deleteRequest(String? url, int? id) =>
(super.noSuchMethod(
Invocation.method(#deleteRequest, [url, id]),
returnValue: _i6.Future<_i3.Response>.value(
_FakeResponse_3(this, Invocation.method(#deleteRequest, [url, id])),
),
)
as _i6.Future<_i3.Response>);
@override
void addListener(_i8.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,
[listener],
),
returnValueForMissingStub: null,
);
Invocation.method(#addListener, [listener]),
returnValueForMissingStub: null,
);
@override
void removeListener(_i8.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);
}

View File

@@ -28,23 +28,13 @@ import 'package:wger/providers/measurement.dart' as _i4;
// 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 _FakeMeasurementCategory_1 extends _i1.SmartFake implements _i3.MeasurementCategory {
_FakeMeasurementCategory_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeMeasurementCategory_1(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
/// A class which mocks [MeasurementProvider].
@@ -56,145 +46,108 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
}
@override
_i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
Invocation.getter(#baseProvider),
returnValue: _FakeWgerBaseProvider_0(
this,
Invocation.getter(#baseProvider),
),
) as _i2.WgerBaseProvider);
@override
List<_i3.MeasurementCategory> get categories => (super.noSuchMethod(
Invocation.getter(#categories),
returnValue: <_i3.MeasurementCategory>[],
) as List<_i3.MeasurementCategory>);
@override
bool get hasListeners => (super.noSuchMethod(
Invocation.getter(#hasListeners),
returnValue: false,
) as bool);
@override
void clear() => super.noSuchMethod(
Invocation.method(
#clear,
[],
),
returnValueForMissingStub: null,
);
@override
_i3.MeasurementCategory findCategoryById(int? id) => (super.noSuchMethod(
Invocation.method(
#findCategoryById,
[id],
),
returnValue: _FakeMeasurementCategory_1(
this,
Invocation.method(
#findCategoryById,
[id],
),
),
) as _i3.MeasurementCategory);
@override
_i5.Future<void> fetchAndSetCategories() => (super.noSuchMethod(
Invocation.method(
#fetchAndSetCategories,
[],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> fetchAndSetCategoryEntries(int? id) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetCategoryEntries,
[id],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> fetchAndSetAllCategoriesAndEntries() => (super.noSuchMethod(
Invocation.method(
#fetchAndSetAllCategoriesAndEntries,
[],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> addCategory(_i3.MeasurementCategory? category) => (super.noSuchMethod(
Invocation.method(
#addCategory,
[category],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> deleteCategory(int? id) => (super.noSuchMethod(
Invocation.method(
#deleteCategory,
[id],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> editCategory(
int? id,
String? newName,
String? newUnit,
) =>
_i2.WgerBaseProvider get baseProvider =>
(super.noSuchMethod(
Invocation.method(
#editCategory,
[
id,
newName,
newUnit,
],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
Invocation.getter(#baseProvider),
returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)),
)
as _i2.WgerBaseProvider);
@override
_i5.Future<void> addEntry(_i6.MeasurementEntry? entry) => (super.noSuchMethod(
Invocation.method(
#addEntry,
[entry],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
List<_i3.MeasurementCategory> get categories =>
(super.noSuchMethod(Invocation.getter(#categories), returnValue: <_i3.MeasurementCategory>[])
as List<_i3.MeasurementCategory>);
@override
_i5.Future<void> deleteEntry(
int? id,
int? categoryId,
) =>
bool get hasListeners =>
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool);
@override
void clear() =>
super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null);
@override
_i3.MeasurementCategory findCategoryById(int? id) =>
(super.noSuchMethod(
Invocation.method(
#deleteEntry,
[
id,
categoryId,
],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
Invocation.method(#findCategoryById, [id]),
returnValue: _FakeMeasurementCategory_1(
this,
Invocation.method(#findCategoryById, [id]),
),
)
as _i3.MeasurementCategory);
@override
_i5.Future<void> fetchAndSetCategories() =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetCategories, []),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
)
as _i5.Future<void>);
@override
_i5.Future<void> fetchAndSetCategoryEntries(int? id) =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetCategoryEntries, [id]),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
)
as _i5.Future<void>);
@override
_i5.Future<void> fetchAndSetAllCategoriesAndEntries() =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetAllCategoriesAndEntries, []),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
)
as _i5.Future<void>);
@override
_i5.Future<void> addCategory(_i3.MeasurementCategory? category) =>
(super.noSuchMethod(
Invocation.method(#addCategory, [category]),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
)
as _i5.Future<void>);
@override
_i5.Future<void> deleteCategory(int? id) =>
(super.noSuchMethod(
Invocation.method(#deleteCategory, [id]),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
)
as _i5.Future<void>);
@override
_i5.Future<void> editCategory(int? id, String? newName, String? newUnit) =>
(super.noSuchMethod(
Invocation.method(#editCategory, [id, newName, newUnit]),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
)
as _i5.Future<void>);
@override
_i5.Future<void> addEntry(_i6.MeasurementEntry? entry) =>
(super.noSuchMethod(
Invocation.method(#addEntry, [entry]),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
)
as _i5.Future<void>);
@override
_i5.Future<void> deleteEntry(int? id, int? categoryId) =>
(super.noSuchMethod(
Invocation.method(#deleteEntry, [id, categoryId]),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
)
as _i5.Future<void>);
@override
_i5.Future<void> editEntry(
@@ -205,53 +158,29 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
DateTime? newDate,
) =>
(super.noSuchMethod(
Invocation.method(
#editEntry,
[
id,
categoryId,
newValue,
newNotes,
newDate,
],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
Invocation.method(#editEntry, [id, categoryId, newValue, newNotes, newDate]),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
)
as _i5.Future<void>);
@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);
}

View File

@@ -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>);
}

View File

@@ -31,63 +31,30 @@ import 'package:wger/providers/nutrition.dart' as _i8;
// 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 _FakeIngredientDatabase_1 extends _i1.SmartFake implements _i3.IngredientDatabase {
_FakeIngredientDatabase_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeIngredientDatabase_1(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
class _FakeNutritionalPlan_2 extends _i1.SmartFake implements _i4.NutritionalPlan {
_FakeNutritionalPlan_2(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeNutritionalPlan_2(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
class _FakeMeal_3 extends _i1.SmartFake implements _i5.Meal {
_FakeMeal_3(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeMeal_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeMealItem_4 extends _i1.SmartFake implements _i6.MealItem {
_FakeMealItem_4(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeMealItem_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeIngredient_5 extends _i1.SmartFake implements _i7.Ingredient {
_FakeIngredient_5(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeIngredient_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
/// A class which mocks [NutritionPlansProvider].
@@ -99,268 +66,181 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
}
@override
_i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
Invocation.getter(#baseProvider),
returnValue: _FakeWgerBaseProvider_0(
this,
Invocation.getter(#baseProvider),
),
) as _i2.WgerBaseProvider);
@override
_i3.IngredientDatabase get database => (super.noSuchMethod(
Invocation.getter(#database),
returnValue: _FakeIngredientDatabase_1(
this,
Invocation.getter(#database),
),
) as _i3.IngredientDatabase);
@override
List<_i7.Ingredient> get ingredients => (super.noSuchMethod(
Invocation.getter(#ingredients),
returnValue: <_i7.Ingredient>[],
) as List<_i7.Ingredient>);
@override
List<_i4.NutritionalPlan> get items => (super.noSuchMethod(
Invocation.getter(#items),
returnValue: <_i4.NutritionalPlan>[],
) as List<_i4.NutritionalPlan>);
@override
set database(_i3.IngredientDatabase? value) => super.noSuchMethod(
Invocation.setter(
#database,
value,
),
returnValueForMissingStub: null,
);
@override
set ingredients(List<_i7.Ingredient>? value) => super.noSuchMethod(
Invocation.setter(
#ingredients,
value,
),
returnValueForMissingStub: null,
);
@override
bool get hasListeners => (super.noSuchMethod(
Invocation.getter(#hasListeners),
returnValue: false,
) as bool);
@override
void clear() => super.noSuchMethod(
Invocation.method(
#clear,
[],
),
returnValueForMissingStub: null,
);
@override
_i4.NutritionalPlan findById(int? id) => (super.noSuchMethod(
Invocation.method(
#findById,
[id],
),
returnValue: _FakeNutritionalPlan_2(
this,
Invocation.method(
#findById,
[id],
),
),
) as _i4.NutritionalPlan);
@override
_i5.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(
#findMealById,
[id],
)) as _i5.Meal?);
@override
_i9.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
Invocation.method(
#fetchAndSetAllPlansSparse,
[],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
@override
_i9.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
Invocation.method(
#fetchAndSetAllPlansFull,
[],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
@override
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanSparse,
[planId],
),
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
this,
Invocation.method(
#fetchAndSetPlanSparse,
[planId],
),
)),
) as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanFull,
[planId],
),
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
this,
Invocation.method(
#fetchAndSetPlanFull,
[planId],
),
)),
) as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) => (super.noSuchMethod(
Invocation.method(
#addPlan,
[planData],
),
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
this,
Invocation.method(
#addPlan,
[planData],
),
)),
) as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<void> editPlan(_i4.NutritionalPlan? plan) => (super.noSuchMethod(
Invocation.method(
#editPlan,
[plan],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
@override
_i9.Future<void> deletePlan(int? id) => (super.noSuchMethod(
Invocation.method(
#deletePlan,
[id],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
@override
_i9.Future<_i5.Meal> addMeal(
_i5.Meal? meal,
int? planId,
) =>
_i2.WgerBaseProvider get baseProvider =>
(super.noSuchMethod(
Invocation.method(
#addMeal,
[
meal,
planId,
],
),
returnValue: _i9.Future<_i5.Meal>.value(_FakeMeal_3(
this,
Invocation.method(
#addMeal,
[
meal,
planId,
],
),
)),
) as _i9.Future<_i5.Meal>);
Invocation.getter(#baseProvider),
returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)),
)
as _i2.WgerBaseProvider);
@override
_i9.Future<_i5.Meal> editMeal(_i5.Meal? meal) => (super.noSuchMethod(
Invocation.method(
#editMeal,
[meal],
),
returnValue: _i9.Future<_i5.Meal>.value(_FakeMeal_3(
this,
Invocation.method(
#editMeal,
[meal],
),
)),
) as _i9.Future<_i5.Meal>);
@override
_i9.Future<void> deleteMeal(_i5.Meal? meal) => (super.noSuchMethod(
Invocation.method(
#deleteMeal,
[meal],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
@override
_i9.Future<_i6.MealItem> addMealItem(
_i6.MealItem? mealItem,
_i5.Meal? meal,
) =>
_i3.IngredientDatabase get database =>
(super.noSuchMethod(
Invocation.method(
#addMealItem,
[
mealItem,
meal,
],
),
returnValue: _i9.Future<_i6.MealItem>.value(_FakeMealItem_4(
this,
Invocation.method(
#addMealItem,
[
mealItem,
meal,
],
),
)),
) as _i9.Future<_i6.MealItem>);
Invocation.getter(#database),
returnValue: _FakeIngredientDatabase_1(this, Invocation.getter(#database)),
)
as _i3.IngredientDatabase);
@override
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) => (super.noSuchMethod(
Invocation.method(
#deleteMealItem,
[mealItem],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
List<_i7.Ingredient> get ingredients =>
(super.noSuchMethod(Invocation.getter(#ingredients), returnValue: <_i7.Ingredient>[])
as List<_i7.Ingredient>);
@override
_i9.Future<void> clearIngredientCache() => (super.noSuchMethod(
Invocation.method(
#clearIngredientCache,
[],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
List<_i4.NutritionalPlan> get items =>
(super.noSuchMethod(Invocation.getter(#items), returnValue: <_i4.NutritionalPlan>[])
as List<_i4.NutritionalPlan>);
@override
set database(_i3.IngredientDatabase? value) =>
super.noSuchMethod(Invocation.setter(#database, value), returnValueForMissingStub: null);
@override
set ingredients(List<_i7.Ingredient>? value) =>
super.noSuchMethod(Invocation.setter(#ingredients, value), returnValueForMissingStub: null);
@override
bool get hasListeners =>
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool);
@override
void clear() =>
super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null);
@override
_i4.NutritionalPlan findById(int? id) =>
(super.noSuchMethod(
Invocation.method(#findById, [id]),
returnValue: _FakeNutritionalPlan_2(this, Invocation.method(#findById, [id])),
)
as _i4.NutritionalPlan);
@override
_i5.Meal? findMealById(int? id) =>
(super.noSuchMethod(Invocation.method(#findMealById, [id])) as _i5.Meal?);
@override
_i9.Future<void> fetchAndSetAllPlansSparse() =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetAllPlansSparse, []),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<void> fetchAndSetAllPlansFull() =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetAllPlansFull, []),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetPlanSparse, [planId]),
returnValue: _i9.Future<_i4.NutritionalPlan>.value(
_FakeNutritionalPlan_2(this, Invocation.method(#fetchAndSetPlanSparse, [planId])),
),
)
as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetPlanFull, [planId]),
returnValue: _i9.Future<_i4.NutritionalPlan>.value(
_FakeNutritionalPlan_2(this, Invocation.method(#fetchAndSetPlanFull, [planId])),
),
)
as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) =>
(super.noSuchMethod(
Invocation.method(#addPlan, [planData]),
returnValue: _i9.Future<_i4.NutritionalPlan>.value(
_FakeNutritionalPlan_2(this, Invocation.method(#addPlan, [planData])),
),
)
as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<void> editPlan(_i4.NutritionalPlan? plan) =>
(super.noSuchMethod(
Invocation.method(#editPlan, [plan]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<void> deletePlan(int? id) =>
(super.noSuchMethod(
Invocation.method(#deletePlan, [id]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<_i5.Meal> addMeal(_i5.Meal? meal, int? planId) =>
(super.noSuchMethod(
Invocation.method(#addMeal, [meal, planId]),
returnValue: _i9.Future<_i5.Meal>.value(
_FakeMeal_3(this, Invocation.method(#addMeal, [meal, planId])),
),
)
as _i9.Future<_i5.Meal>);
@override
_i9.Future<_i5.Meal> editMeal(_i5.Meal? meal) =>
(super.noSuchMethod(
Invocation.method(#editMeal, [meal]),
returnValue: _i9.Future<_i5.Meal>.value(
_FakeMeal_3(this, Invocation.method(#editMeal, [meal])),
),
)
as _i9.Future<_i5.Meal>);
@override
_i9.Future<void> deleteMeal(_i5.Meal? meal) =>
(super.noSuchMethod(
Invocation.method(#deleteMeal, [meal]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<_i6.MealItem> addMealItem(_i6.MealItem? mealItem, _i5.Meal? meal) =>
(super.noSuchMethod(
Invocation.method(#addMealItem, [mealItem, meal]),
returnValue: _i9.Future<_i6.MealItem>.value(
_FakeMealItem_4(this, Invocation.method(#addMealItem, [mealItem, meal])),
),
)
as _i9.Future<_i6.MealItem>);
@override
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) =>
(super.noSuchMethod(
Invocation.method(#deleteMealItem, [mealItem]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<void> clearIngredientCache() =>
(super.noSuchMethod(
Invocation.method(#clearIngredientCache, []),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<_i7.Ingredient> fetchIngredient(
@@ -368,30 +248,24 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
_i3.IngredientDatabase? database,
}) =>
(super.noSuchMethod(
Invocation.method(
#fetchIngredient,
[ingredientId],
{#database: database},
),
returnValue: _i9.Future<_i7.Ingredient>.value(_FakeIngredient_5(
this,
Invocation.method(
#fetchIngredient,
[ingredientId],
{#database: database},
),
)),
) as _i9.Future<_i7.Ingredient>);
Invocation.method(#fetchIngredient, [ingredientId], {#database: database}),
returnValue: _i9.Future<_i7.Ingredient>.value(
_FakeIngredient_5(
this,
Invocation.method(#fetchIngredient, [ingredientId], {#database: database}),
),
),
)
as _i9.Future<_i7.Ingredient>);
@override
_i9.Future<void> fetchIngredientsFromCache() => (super.noSuchMethod(
Invocation.method(
#fetchIngredientsFromCache,
[],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
_i9.Future<void> fetchIngredientsFromCache() =>
(super.noSuchMethod(
Invocation.method(#fetchIngredientsFromCache, []),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<List<_i7.Ingredient>> searchIngredient(
@@ -400,42 +274,31 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
bool? searchEnglish = false,
}) =>
(super.noSuchMethod(
Invocation.method(
#searchIngredient,
[name],
{
#languageCode: languageCode,
#searchEnglish: searchEnglish,
},
),
returnValue: _i9.Future<List<_i7.Ingredient>>.value(<_i7.Ingredient>[]),
) as _i9.Future<List<_i7.Ingredient>>);
Invocation.method(
#searchIngredient,
[name],
{#languageCode: languageCode, #searchEnglish: searchEnglish},
),
returnValue: _i9.Future<List<_i7.Ingredient>>.value(<_i7.Ingredient>[]),
)
as _i9.Future<List<_i7.Ingredient>>);
@override
_i9.Future<_i7.Ingredient?> searchIngredientWithBarcode(String? barcode) => (super.noSuchMethod(
Invocation.method(
#searchIngredientWithBarcode,
[barcode],
),
returnValue: _i9.Future<_i7.Ingredient?>.value(),
) as _i9.Future<_i7.Ingredient?>);
@override
_i9.Future<void> logMealToDiary(
_i5.Meal? meal,
DateTime? mealDateTime,
) =>
_i9.Future<_i7.Ingredient?> searchIngredientWithBarcode(String? barcode) =>
(super.noSuchMethod(
Invocation.method(
#logMealToDiary,
[
meal,
mealDateTime,
],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
Invocation.method(#searchIngredientWithBarcode, [barcode]),
returnValue: _i9.Future<_i7.Ingredient?>.value(),
)
as _i9.Future<_i7.Ingredient?>);
@override
_i9.Future<void> logMealToDiary(_i5.Meal? meal, DateTime? mealDateTime) =>
(super.noSuchMethod(
Invocation.method(#logMealToDiary, [meal, mealDateTime]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<void> logIngredientToDiary(
@@ -444,78 +307,47 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
DateTime? dateTime,
]) =>
(super.noSuchMethod(
Invocation.method(
#logIngredientToDiary,
[
mealItem,
planId,
dateTime,
],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
Invocation.method(#logIngredientToDiary, [mealItem, planId, dateTime]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<void> deleteLog(
int? logId,
int? planId,
) =>
_i9.Future<void> deleteLog(int? logId, int? planId) =>
(super.noSuchMethod(
Invocation.method(
#deleteLog,
[
logId,
planId,
],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
Invocation.method(#deleteLog, [logId, planId]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetLogs,
[plan],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetLogs, [plan]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
void addListener(_i10.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,
[listener],
),
returnValueForMissingStub: null,
);
Invocation.method(#addListener, [listener]),
returnValueForMissingStub: null,
);
@override
void removeListener(_i10.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);
}

View File

@@ -31,63 +31,30 @@ import 'package:wger/providers/nutrition.dart' as _i8;
// 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 _FakeIngredientDatabase_1 extends _i1.SmartFake implements _i3.IngredientDatabase {
_FakeIngredientDatabase_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeIngredientDatabase_1(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
class _FakeNutritionalPlan_2 extends _i1.SmartFake implements _i4.NutritionalPlan {
_FakeNutritionalPlan_2(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeNutritionalPlan_2(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
class _FakeMeal_3 extends _i1.SmartFake implements _i5.Meal {
_FakeMeal_3(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeMeal_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeMealItem_4 extends _i1.SmartFake implements _i6.MealItem {
_FakeMealItem_4(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeMealItem_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeIngredient_5 extends _i1.SmartFake implements _i7.Ingredient {
_FakeIngredient_5(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeIngredient_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
/// A class which mocks [NutritionPlansProvider].
@@ -99,268 +66,181 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
}
@override
_i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
Invocation.getter(#baseProvider),
returnValue: _FakeWgerBaseProvider_0(
this,
Invocation.getter(#baseProvider),
),
) as _i2.WgerBaseProvider);
@override
_i3.IngredientDatabase get database => (super.noSuchMethod(
Invocation.getter(#database),
returnValue: _FakeIngredientDatabase_1(
this,
Invocation.getter(#database),
),
) as _i3.IngredientDatabase);
@override
List<_i7.Ingredient> get ingredients => (super.noSuchMethod(
Invocation.getter(#ingredients),
returnValue: <_i7.Ingredient>[],
) as List<_i7.Ingredient>);
@override
List<_i4.NutritionalPlan> get items => (super.noSuchMethod(
Invocation.getter(#items),
returnValue: <_i4.NutritionalPlan>[],
) as List<_i4.NutritionalPlan>);
@override
set database(_i3.IngredientDatabase? value) => super.noSuchMethod(
Invocation.setter(
#database,
value,
),
returnValueForMissingStub: null,
);
@override
set ingredients(List<_i7.Ingredient>? value) => super.noSuchMethod(
Invocation.setter(
#ingredients,
value,
),
returnValueForMissingStub: null,
);
@override
bool get hasListeners => (super.noSuchMethod(
Invocation.getter(#hasListeners),
returnValue: false,
) as bool);
@override
void clear() => super.noSuchMethod(
Invocation.method(
#clear,
[],
),
returnValueForMissingStub: null,
);
@override
_i4.NutritionalPlan findById(int? id) => (super.noSuchMethod(
Invocation.method(
#findById,
[id],
),
returnValue: _FakeNutritionalPlan_2(
this,
Invocation.method(
#findById,
[id],
),
),
) as _i4.NutritionalPlan);
@override
_i5.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(
#findMealById,
[id],
)) as _i5.Meal?);
@override
_i9.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
Invocation.method(
#fetchAndSetAllPlansSparse,
[],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
@override
_i9.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
Invocation.method(
#fetchAndSetAllPlansFull,
[],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
@override
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanSparse,
[planId],
),
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
this,
Invocation.method(
#fetchAndSetPlanSparse,
[planId],
),
)),
) as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanFull,
[planId],
),
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
this,
Invocation.method(
#fetchAndSetPlanFull,
[planId],
),
)),
) as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) => (super.noSuchMethod(
Invocation.method(
#addPlan,
[planData],
),
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
this,
Invocation.method(
#addPlan,
[planData],
),
)),
) as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<void> editPlan(_i4.NutritionalPlan? plan) => (super.noSuchMethod(
Invocation.method(
#editPlan,
[plan],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
@override
_i9.Future<void> deletePlan(int? id) => (super.noSuchMethod(
Invocation.method(
#deletePlan,
[id],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
@override
_i9.Future<_i5.Meal> addMeal(
_i5.Meal? meal,
int? planId,
) =>
_i2.WgerBaseProvider get baseProvider =>
(super.noSuchMethod(
Invocation.method(
#addMeal,
[
meal,
planId,
],
),
returnValue: _i9.Future<_i5.Meal>.value(_FakeMeal_3(
this,
Invocation.method(
#addMeal,
[
meal,
planId,
],
),
)),
) as _i9.Future<_i5.Meal>);
Invocation.getter(#baseProvider),
returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)),
)
as _i2.WgerBaseProvider);
@override
_i9.Future<_i5.Meal> editMeal(_i5.Meal? meal) => (super.noSuchMethod(
Invocation.method(
#editMeal,
[meal],
),
returnValue: _i9.Future<_i5.Meal>.value(_FakeMeal_3(
this,
Invocation.method(
#editMeal,
[meal],
),
)),
) as _i9.Future<_i5.Meal>);
@override
_i9.Future<void> deleteMeal(_i5.Meal? meal) => (super.noSuchMethod(
Invocation.method(
#deleteMeal,
[meal],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
@override
_i9.Future<_i6.MealItem> addMealItem(
_i6.MealItem? mealItem,
_i5.Meal? meal,
) =>
_i3.IngredientDatabase get database =>
(super.noSuchMethod(
Invocation.method(
#addMealItem,
[
mealItem,
meal,
],
),
returnValue: _i9.Future<_i6.MealItem>.value(_FakeMealItem_4(
this,
Invocation.method(
#addMealItem,
[
mealItem,
meal,
],
),
)),
) as _i9.Future<_i6.MealItem>);
Invocation.getter(#database),
returnValue: _FakeIngredientDatabase_1(this, Invocation.getter(#database)),
)
as _i3.IngredientDatabase);
@override
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) => (super.noSuchMethod(
Invocation.method(
#deleteMealItem,
[mealItem],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
List<_i7.Ingredient> get ingredients =>
(super.noSuchMethod(Invocation.getter(#ingredients), returnValue: <_i7.Ingredient>[])
as List<_i7.Ingredient>);
@override
_i9.Future<void> clearIngredientCache() => (super.noSuchMethod(
Invocation.method(
#clearIngredientCache,
[],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
List<_i4.NutritionalPlan> get items =>
(super.noSuchMethod(Invocation.getter(#items), returnValue: <_i4.NutritionalPlan>[])
as List<_i4.NutritionalPlan>);
@override
set database(_i3.IngredientDatabase? value) =>
super.noSuchMethod(Invocation.setter(#database, value), returnValueForMissingStub: null);
@override
set ingredients(List<_i7.Ingredient>? value) =>
super.noSuchMethod(Invocation.setter(#ingredients, value), returnValueForMissingStub: null);
@override
bool get hasListeners =>
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool);
@override
void clear() =>
super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null);
@override
_i4.NutritionalPlan findById(int? id) =>
(super.noSuchMethod(
Invocation.method(#findById, [id]),
returnValue: _FakeNutritionalPlan_2(this, Invocation.method(#findById, [id])),
)
as _i4.NutritionalPlan);
@override
_i5.Meal? findMealById(int? id) =>
(super.noSuchMethod(Invocation.method(#findMealById, [id])) as _i5.Meal?);
@override
_i9.Future<void> fetchAndSetAllPlansSparse() =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetAllPlansSparse, []),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<void> fetchAndSetAllPlansFull() =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetAllPlansFull, []),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetPlanSparse, [planId]),
returnValue: _i9.Future<_i4.NutritionalPlan>.value(
_FakeNutritionalPlan_2(this, Invocation.method(#fetchAndSetPlanSparse, [planId])),
),
)
as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetPlanFull, [planId]),
returnValue: _i9.Future<_i4.NutritionalPlan>.value(
_FakeNutritionalPlan_2(this, Invocation.method(#fetchAndSetPlanFull, [planId])),
),
)
as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) =>
(super.noSuchMethod(
Invocation.method(#addPlan, [planData]),
returnValue: _i9.Future<_i4.NutritionalPlan>.value(
_FakeNutritionalPlan_2(this, Invocation.method(#addPlan, [planData])),
),
)
as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<void> editPlan(_i4.NutritionalPlan? plan) =>
(super.noSuchMethod(
Invocation.method(#editPlan, [plan]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<void> deletePlan(int? id) =>
(super.noSuchMethod(
Invocation.method(#deletePlan, [id]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<_i5.Meal> addMeal(_i5.Meal? meal, int? planId) =>
(super.noSuchMethod(
Invocation.method(#addMeal, [meal, planId]),
returnValue: _i9.Future<_i5.Meal>.value(
_FakeMeal_3(this, Invocation.method(#addMeal, [meal, planId])),
),
)
as _i9.Future<_i5.Meal>);
@override
_i9.Future<_i5.Meal> editMeal(_i5.Meal? meal) =>
(super.noSuchMethod(
Invocation.method(#editMeal, [meal]),
returnValue: _i9.Future<_i5.Meal>.value(
_FakeMeal_3(this, Invocation.method(#editMeal, [meal])),
),
)
as _i9.Future<_i5.Meal>);
@override
_i9.Future<void> deleteMeal(_i5.Meal? meal) =>
(super.noSuchMethod(
Invocation.method(#deleteMeal, [meal]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<_i6.MealItem> addMealItem(_i6.MealItem? mealItem, _i5.Meal? meal) =>
(super.noSuchMethod(
Invocation.method(#addMealItem, [mealItem, meal]),
returnValue: _i9.Future<_i6.MealItem>.value(
_FakeMealItem_4(this, Invocation.method(#addMealItem, [mealItem, meal])),
),
)
as _i9.Future<_i6.MealItem>);
@override
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) =>
(super.noSuchMethod(
Invocation.method(#deleteMealItem, [mealItem]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<void> clearIngredientCache() =>
(super.noSuchMethod(
Invocation.method(#clearIngredientCache, []),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<_i7.Ingredient> fetchIngredient(
@@ -368,30 +248,24 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
_i3.IngredientDatabase? database,
}) =>
(super.noSuchMethod(
Invocation.method(
#fetchIngredient,
[ingredientId],
{#database: database},
),
returnValue: _i9.Future<_i7.Ingredient>.value(_FakeIngredient_5(
this,
Invocation.method(
#fetchIngredient,
[ingredientId],
{#database: database},
),
)),
) as _i9.Future<_i7.Ingredient>);
Invocation.method(#fetchIngredient, [ingredientId], {#database: database}),
returnValue: _i9.Future<_i7.Ingredient>.value(
_FakeIngredient_5(
this,
Invocation.method(#fetchIngredient, [ingredientId], {#database: database}),
),
),
)
as _i9.Future<_i7.Ingredient>);
@override
_i9.Future<void> fetchIngredientsFromCache() => (super.noSuchMethod(
Invocation.method(
#fetchIngredientsFromCache,
[],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
_i9.Future<void> fetchIngredientsFromCache() =>
(super.noSuchMethod(
Invocation.method(#fetchIngredientsFromCache, []),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<List<_i7.Ingredient>> searchIngredient(
@@ -400,42 +274,31 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
bool? searchEnglish = false,
}) =>
(super.noSuchMethod(
Invocation.method(
#searchIngredient,
[name],
{
#languageCode: languageCode,
#searchEnglish: searchEnglish,
},
),
returnValue: _i9.Future<List<_i7.Ingredient>>.value(<_i7.Ingredient>[]),
) as _i9.Future<List<_i7.Ingredient>>);
Invocation.method(
#searchIngredient,
[name],
{#languageCode: languageCode, #searchEnglish: searchEnglish},
),
returnValue: _i9.Future<List<_i7.Ingredient>>.value(<_i7.Ingredient>[]),
)
as _i9.Future<List<_i7.Ingredient>>);
@override
_i9.Future<_i7.Ingredient?> searchIngredientWithBarcode(String? barcode) => (super.noSuchMethod(
Invocation.method(
#searchIngredientWithBarcode,
[barcode],
),
returnValue: _i9.Future<_i7.Ingredient?>.value(),
) as _i9.Future<_i7.Ingredient?>);
@override
_i9.Future<void> logMealToDiary(
_i5.Meal? meal,
DateTime? mealDateTime,
) =>
_i9.Future<_i7.Ingredient?> searchIngredientWithBarcode(String? barcode) =>
(super.noSuchMethod(
Invocation.method(
#logMealToDiary,
[
meal,
mealDateTime,
],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
Invocation.method(#searchIngredientWithBarcode, [barcode]),
returnValue: _i9.Future<_i7.Ingredient?>.value(),
)
as _i9.Future<_i7.Ingredient?>);
@override
_i9.Future<void> logMealToDiary(_i5.Meal? meal, DateTime? mealDateTime) =>
(super.noSuchMethod(
Invocation.method(#logMealToDiary, [meal, mealDateTime]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<void> logIngredientToDiary(
@@ -444,78 +307,47 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
DateTime? dateTime,
]) =>
(super.noSuchMethod(
Invocation.method(
#logIngredientToDiary,
[
mealItem,
planId,
dateTime,
],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
Invocation.method(#logIngredientToDiary, [mealItem, planId, dateTime]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<void> deleteLog(
int? logId,
int? planId,
) =>
_i9.Future<void> deleteLog(int? logId, int? planId) =>
(super.noSuchMethod(
Invocation.method(
#deleteLog,
[
logId,
planId,
],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
Invocation.method(#deleteLog, [logId, planId]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetLogs,
[plan],
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
) as _i9.Future<void>);
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetLogs, [plan]),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
void addListener(_i10.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,
[listener],
),
returnValueForMissingStub: null,
);
Invocation.method(#addListener, [listener]),
returnValueForMissingStub: null,
);
@override
void removeListener(_i10.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);
}

View File

@@ -31,53 +31,24 @@ 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);
}
class _FakeStreamedResponse_4 extends _i1.SmartFake implements _i3.StreamedResponse {
_FakeStreamedResponse_4(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeStreamedResponse_4(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
/// A class which mocks [WgerBaseProvider].
@@ -89,156 +60,97 @@ 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>);
}
/// A class which mocks [AuthProvider].
@@ -250,154 +162,102 @@ class MockAuthProvider extends _i1.Mock implements _i2.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
_i2.AuthState get state => (super.noSuchMethod(
Invocation.getter(#state),
returnValue: _i2.AuthState.updateRequired,
) as _i2.AuthState);
_i2.AuthState get state =>
(super.noSuchMethod(Invocation.getter(#state), returnValue: _i2.AuthState.updateRequired)
as _i2.AuthState);
@override
_i3.Client get client => (super.noSuchMethod(
Invocation.getter(#client),
returnValue: _FakeClient_1(
this,
Invocation.getter(#client),
),
) as _i3.Client);
_i3.Client get client =>
(super.noSuchMethod(
Invocation.getter(#client),
returnValue: _FakeClient_1(this, Invocation.getter(#client)),
)
as _i3.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(_i6.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(_i2.AuthState? value) => super.noSuchMethod(
Invocation.setter(
#state,
value,
),
returnValueForMissingStub: null,
);
set state(_i2.AuthState? value) =>
super.noSuchMethod(Invocation.setter(#state, value), returnValueForMissingStub: null);
@override
set client(_i3.Client? value) => super.noSuchMethod(
Invocation.setter(
#client,
value,
),
returnValueForMissingStub: null,
);
set client(_i3.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<_i2.LoginActions> register({
@@ -408,19 +268,16 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
String? locale = 'en',
}) =>
(super.noSuchMethod(
Invocation.method(
#register,
[],
{
#username: username,
#password: password,
#email: email,
#serverUrl: serverUrl,
#locale: locale,
},
),
returnValue: _i5.Future<_i2.LoginActions>.value(_i2.LoginActions.update),
) as _i5.Future<_i2.LoginActions>);
Invocation.method(#register, [], {
#username: username,
#password: password,
#email: email,
#serverUrl: serverUrl,
#locale: locale,
}),
returnValue: _i5.Future<_i2.LoginActions>.value(_i2.LoginActions.update),
)
as _i5.Future<_i2.LoginActions>);
@override
_i5.Future<_i2.LoginActions> login(
@@ -430,104 +287,66 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
String? apiToken,
) =>
(super.noSuchMethod(
Invocation.method(
#login,
[
username,
password,
serverUrl,
apiToken,
],
),
returnValue: _i5.Future<_i2.LoginActions>.value(_i2.LoginActions.update),
) as _i5.Future<_i2.LoginActions>);
Invocation.method(#login, [username, password, serverUrl, apiToken]),
returnValue: _i5.Future<_i2.LoginActions>.value(_i2.LoginActions.update),
)
as _i5.Future<_i2.LoginActions>);
@override
_i5.Future<String> getServerUrlFromPrefs() => (super.noSuchMethod(
Invocation.method(
#getServerUrlFromPrefs,
[],
),
returnValue: _i5.Future<String>.value(_i7.dummyValue<String>(
this,
Invocation.method(
#getServerUrlFromPrefs,
[],
),
)),
) as _i5.Future<String>);
_i5.Future<String> getServerUrlFromPrefs() =>
(super.noSuchMethod(
Invocation.method(#getServerUrlFromPrefs, []),
returnValue: _i5.Future<String>.value(
_i7.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: _i7.dummyValue<String>(
this,
Invocation.method(
#getAppNameHeader,
[],
),
),
) as String);
String getAppNameHeader() =>
(super.noSuchMethod(
Invocation.method(#getAppNameHeader, []),
returnValue: _i7.dummyValue<String>(this, Invocation.method(#getAppNameHeader, [])),
)
as String);
@override
void addListener(_i8.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,
[listener],
),
returnValueForMissingStub: null,
);
Invocation.method(#addListener, [listener]),
returnValueForMissingStub: null,
);
@override
void removeListener(_i8.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 [Client].
@@ -539,46 +358,24 @@ class MockClient extends _i1.Mock implements _i3.Client {
}
@override
_i5.Future<_i3.Response> head(
Uri? url, {
Map<String, String>? headers,
}) =>
_i5.Future<_i3.Response> head(Uri? url, {Map<String, String>? headers}) =>
(super.noSuchMethod(
Invocation.method(
#head,
[url],
{#headers: headers},
),
returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_3(
this,
Invocation.method(
#head,
[url],
{#headers: headers},
),
)),
) as _i5.Future<_i3.Response>);
Invocation.method(#head, [url], {#headers: headers}),
returnValue: _i5.Future<_i3.Response>.value(
_FakeResponse_3(this, Invocation.method(#head, [url], {#headers: headers})),
),
)
as _i5.Future<_i3.Response>);
@override
_i5.Future<_i3.Response> get(
Uri? url, {
Map<String, String>? headers,
}) =>
_i5.Future<_i3.Response> get(Uri? url, {Map<String, String>? headers}) =>
(super.noSuchMethod(
Invocation.method(
#get,
[url],
{#headers: headers},
),
returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_3(
this,
Invocation.method(
#get,
[url],
{#headers: headers},
),
)),
) as _i5.Future<_i3.Response>);
Invocation.method(#get, [url], {#headers: headers}),
returnValue: _i5.Future<_i3.Response>.value(
_FakeResponse_3(this, Invocation.method(#get, [url], {#headers: headers})),
),
)
as _i5.Future<_i3.Response>);
@override
_i5.Future<_i3.Response> post(
@@ -588,28 +385,19 @@ class MockClient extends _i1.Mock implements _i3.Client {
_i9.Encoding? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
#post,
[url],
{
#headers: headers,
#body: body,
#encoding: encoding,
},
),
returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_3(
this,
Invocation.method(
#post,
[url],
{
#headers: headers,
#body: body,
#encoding: encoding,
},
),
)),
) as _i5.Future<_i3.Response>);
Invocation.method(#post, [url], {#headers: headers, #body: body, #encoding: encoding}),
returnValue: _i5.Future<_i3.Response>.value(
_FakeResponse_3(
this,
Invocation.method(
#post,
[url],
{#headers: headers, #body: body, #encoding: encoding},
),
),
),
)
as _i5.Future<_i3.Response>);
@override
_i5.Future<_i3.Response> put(
@@ -619,28 +407,19 @@ class MockClient extends _i1.Mock implements _i3.Client {
_i9.Encoding? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
#put,
[url],
{
#headers: headers,
#body: body,
#encoding: encoding,
},
),
returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_3(
this,
Invocation.method(
#put,
[url],
{
#headers: headers,
#body: body,
#encoding: encoding,
},
),
)),
) as _i5.Future<_i3.Response>);
Invocation.method(#put, [url], {#headers: headers, #body: body, #encoding: encoding}),
returnValue: _i5.Future<_i3.Response>.value(
_FakeResponse_3(
this,
Invocation.method(
#put,
[url],
{#headers: headers, #body: body, #encoding: encoding},
),
),
),
)
as _i5.Future<_i3.Response>);
@override
_i5.Future<_i3.Response> patch(
@@ -650,28 +429,19 @@ class MockClient extends _i1.Mock implements _i3.Client {
_i9.Encoding? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
#patch,
[url],
{
#headers: headers,
#body: body,
#encoding: encoding,
},
),
returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_3(
this,
Invocation.method(
#patch,
[url],
{
#headers: headers,
#body: body,
#encoding: encoding,
},
),
)),
) as _i5.Future<_i3.Response>);
Invocation.method(#patch, [url], {#headers: headers, #body: body, #encoding: encoding}),
returnValue: _i5.Future<_i3.Response>.value(
_FakeResponse_3(
this,
Invocation.method(
#patch,
[url],
{#headers: headers, #body: body, #encoding: encoding},
),
),
),
)
as _i5.Future<_i3.Response>);
@override
_i5.Future<_i3.Response> delete(
@@ -681,85 +451,53 @@ class MockClient extends _i1.Mock implements _i3.Client {
_i9.Encoding? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
#delete,
[url],
{
#headers: headers,
#body: body,
#encoding: encoding,
},
),
returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_3(
this,
Invocation.method(
#delete,
[url],
{
#headers: headers,
#body: body,
#encoding: encoding,
},
),
)),
) as _i5.Future<_i3.Response>);
Invocation.method(
#delete,
[url],
{#headers: headers, #body: body, #encoding: encoding},
),
returnValue: _i5.Future<_i3.Response>.value(
_FakeResponse_3(
this,
Invocation.method(
#delete,
[url],
{#headers: headers, #body: body, #encoding: encoding},
),
),
),
)
as _i5.Future<_i3.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(_i7.dummyValue<String>(
this,
Invocation.method(
#read,
[url],
{#headers: headers},
),
)),
) as _i5.Future<String>);
Invocation.method(#read, [url], {#headers: headers}),
returnValue: _i5.Future<String>.value(
_i7.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<_i3.StreamedResponse> send(_i3.BaseRequest? request) => (super.noSuchMethod(
Invocation.method(
#send,
[request],
),
returnValue: _i5.Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_4(
this,
Invocation.method(
#send,
[request],
),
)),
) as _i5.Future<_i3.StreamedResponse>);
_i5.Future<_i3.StreamedResponse> send(_i3.BaseRequest? request) =>
(super.noSuchMethod(
Invocation.method(#send, [request]),
returnValue: _i5.Future<_i3.StreamedResponse>.value(
_FakeStreamedResponse_4(this, Invocation.method(#send, [request])),
),
)
as _i5.Future<_i3.StreamedResponse>);
@override
void close() => super.noSuchMethod(
Invocation.method(
#close,
[],
),
returnValueForMissingStub: null,
);
void close() =>
super.noSuchMethod(Invocation.method(#close, []), returnValueForMissingStub: null);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -33,182 +33,126 @@ class MockSharedPreferencesAsync extends _i1.Mock implements _i2.SharedPreferenc
}
@override
_i3.Future<Set<String>> getKeys({Set<String>? allowList}) => (super.noSuchMethod(
Invocation.method(
#getKeys,
[],
{#allowList: allowList},
),
returnValue: _i3.Future<Set<String>>.value(<String>{}),
) as _i3.Future<Set<String>>);
@override
_i3.Future<Map<String, Object?>> getAll({Set<String>? allowList}) => (super.noSuchMethod(
Invocation.method(
#getAll,
[],
{#allowList: allowList},
),
returnValue: _i3.Future<Map<String, Object?>>.value(<String, Object?>{}),
) as _i3.Future<Map<String, Object?>>);
@override
_i3.Future<bool?> getBool(String? key) => (super.noSuchMethod(
Invocation.method(
#getBool,
[key],
),
returnValue: _i3.Future<bool?>.value(),
) as _i3.Future<bool?>);
@override
_i3.Future<int?> getInt(String? key) => (super.noSuchMethod(
Invocation.method(
#getInt,
[key],
),
returnValue: _i3.Future<int?>.value(),
) as _i3.Future<int?>);
@override
_i3.Future<double?> getDouble(String? key) => (super.noSuchMethod(
Invocation.method(
#getDouble,
[key],
),
returnValue: _i3.Future<double?>.value(),
) as _i3.Future<double?>);
@override
_i3.Future<String?> getString(String? key) => (super.noSuchMethod(
Invocation.method(
#getString,
[key],
),
returnValue: _i3.Future<String?>.value(),
) as _i3.Future<String?>);
@override
_i3.Future<List<String>?> getStringList(String? key) => (super.noSuchMethod(
Invocation.method(
#getStringList,
[key],
),
returnValue: _i3.Future<List<String>?>.value(),
) as _i3.Future<List<String>?>);
@override
_i3.Future<bool> containsKey(String? key) => (super.noSuchMethod(
Invocation.method(
#containsKey,
[key],
),
returnValue: _i3.Future<bool>.value(false),
) as _i3.Future<bool>);
@override
_i3.Future<void> setBool(
String? key,
bool? value,
) =>
_i3.Future<Set<String>> getKeys({Set<String>? allowList}) =>
(super.noSuchMethod(
Invocation.method(
#setBool,
[
key,
value,
],
),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
) as _i3.Future<void>);
Invocation.method(#getKeys, [], {#allowList: allowList}),
returnValue: _i3.Future<Set<String>>.value(<String>{}),
)
as _i3.Future<Set<String>>);
@override
_i3.Future<void> setInt(
String? key,
int? value,
) =>
_i3.Future<Map<String, Object?>> getAll({Set<String>? allowList}) =>
(super.noSuchMethod(
Invocation.method(
#setInt,
[
key,
value,
],
),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
) as _i3.Future<void>);
Invocation.method(#getAll, [], {#allowList: allowList}),
returnValue: _i3.Future<Map<String, Object?>>.value(<String, Object?>{}),
)
as _i3.Future<Map<String, Object?>>);
@override
_i3.Future<void> setDouble(
String? key,
double? value,
) =>
_i3.Future<bool?> getBool(String? key) =>
(super.noSuchMethod(
Invocation.method(
#setDouble,
[
key,
value,
],
),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
) as _i3.Future<void>);
Invocation.method(#getBool, [key]),
returnValue: _i3.Future<bool?>.value(),
)
as _i3.Future<bool?>);
@override
_i3.Future<void> setString(
String? key,
String? value,
) =>
_i3.Future<int?> getInt(String? key) =>
(super.noSuchMethod(Invocation.method(#getInt, [key]), returnValue: _i3.Future<int?>.value())
as _i3.Future<int?>);
@override
_i3.Future<double?> getDouble(String? key) =>
(super.noSuchMethod(
Invocation.method(
#setString,
[
key,
value,
],
),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
) as _i3.Future<void>);
Invocation.method(#getDouble, [key]),
returnValue: _i3.Future<double?>.value(),
)
as _i3.Future<double?>);
@override
_i3.Future<void> setStringList(
String? key,
List<String>? value,
) =>
_i3.Future<String?> getString(String? key) =>
(super.noSuchMethod(
Invocation.method(
#setStringList,
[
key,
value,
],
),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
) as _i3.Future<void>);
Invocation.method(#getString, [key]),
returnValue: _i3.Future<String?>.value(),
)
as _i3.Future<String?>);
@override
_i3.Future<void> remove(String? key) => (super.noSuchMethod(
Invocation.method(
#remove,
[key],
),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
) as _i3.Future<void>);
_i3.Future<List<String>?> getStringList(String? key) =>
(super.noSuchMethod(
Invocation.method(#getStringList, [key]),
returnValue: _i3.Future<List<String>?>.value(),
)
as _i3.Future<List<String>?>);
@override
_i3.Future<void> clear({Set<String>? allowList}) => (super.noSuchMethod(
Invocation.method(
#clear,
[],
{#allowList: allowList},
),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
) as _i3.Future<void>);
_i3.Future<bool> containsKey(String? key) =>
(super.noSuchMethod(
Invocation.method(#containsKey, [key]),
returnValue: _i3.Future<bool>.value(false),
)
as _i3.Future<bool>);
@override
_i3.Future<void> setBool(String? key, bool? value) =>
(super.noSuchMethod(
Invocation.method(#setBool, [key, value]),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
)
as _i3.Future<void>);
@override
_i3.Future<void> setInt(String? key, int? value) =>
(super.noSuchMethod(
Invocation.method(#setInt, [key, value]),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
)
as _i3.Future<void>);
@override
_i3.Future<void> setDouble(String? key, double? value) =>
(super.noSuchMethod(
Invocation.method(#setDouble, [key, value]),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
)
as _i3.Future<void>);
@override
_i3.Future<void> setString(String? key, String? value) =>
(super.noSuchMethod(
Invocation.method(#setString, [key, value]),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
)
as _i3.Future<void>);
@override
_i3.Future<void> setStringList(String? key, List<String>? value) =>
(super.noSuchMethod(
Invocation.method(#setStringList, [key, value]),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
)
as _i3.Future<void>);
@override
_i3.Future<void> remove(String? key) =>
(super.noSuchMethod(
Invocation.method(#remove, [key]),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
)
as _i3.Future<void>);
@override
_i3.Future<void> clear({Set<String>? allowList}) =>
(super.noSuchMethod(
Invocation.method(#clear, [], {#allowList: allowList}),
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
)
as _i3.Future<void>);
}

View File

@@ -47,9 +47,7 @@ void main() {
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: Scaffold(
body: SingleChildScrollView(
child: DayFormWidget(routineId: 125, day: getTestRoutine().days[0]),
),
body: SingleChildScrollView(child: DayFormWidget(day: getTestRoutine().days[0])),
),
),
);

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

View File

@@ -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

View File

@@ -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

View File

@@ -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>);
}

View File

@@ -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