mirror of
https://github.com/wger-project/flutter.git
synced 2026-11-30 01:41:05 +01:00
Fix merge errors
This commit is contained in:
@@ -11,12 +11,12 @@ import 'package:wger/providers/nutrition.dart';
|
||||
import 'package:wger/screens/nutritional_plan_screen.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
|
||||
import '../test/other/base_provider_test.mocks.dart';
|
||||
import '../test/utils.dart';
|
||||
import '../test/user/provider_test.mocks.dart';
|
||||
|
||||
Widget createNutritionalPlanScreen({locale = 'en'}) {
|
||||
var mockBaseProvider = MockWgerBaseProvider();
|
||||
|
||||
final key = GlobalKey<NavigatorState>();
|
||||
final client = MockClient();
|
||||
|
||||
final muesli = Ingredient(
|
||||
id: 1,
|
||||
@@ -96,7 +96,7 @@ Widget createNutritionalPlanScreen({locale = 'en'}) {
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider<NutritionPlansProvider>(
|
||||
create: (context) => NutritionPlansProvider(testAuthProvider, [], client),
|
||||
create: (context) => NutritionPlansProvider(mockBaseProvider, []),
|
||||
),
|
||||
ChangeNotifierProvider<BodyWeightProvider>(
|
||||
create: (context) => BodyWeightProvider(mockBaseProvider),
|
||||
|
||||
@@ -84,9 +84,12 @@ class MyApp extends StatelessWidget {
|
||||
previous ?? WorkoutPlansProvider(WgerBaseProvider(auth), exercises, []),
|
||||
),
|
||||
ChangeNotifierProxyProvider<AuthProvider, NutritionPlansProvider>(
|
||||
create: (context) =>
|
||||
NutritionPlansProvider(Provider.of<AuthProvider>(context, listen: false), []),
|
||||
update: (context, auth, previous) => previous ?? NutritionPlansProvider(auth, []),
|
||||
create: (context) => NutritionPlansProvider(
|
||||
WgerBaseProvider(Provider.of<AuthProvider>(context, listen: false)),
|
||||
[],
|
||||
),
|
||||
update: (context, auth, previous) =>
|
||||
previous ?? NutritionPlansProvider(WgerBaseProvider(auth), []),
|
||||
),
|
||||
ChangeNotifierProxyProvider<AuthProvider, MeasurementProvider>(
|
||||
create: (context) => MeasurementProvider(
|
||||
|
||||
@@ -90,9 +90,10 @@ class NutritionPlansProvider with ChangeNotifier {
|
||||
/// Fetches and sets all plans sparsely, i.e. only with the data on the plan
|
||||
/// object itself and no child attributes
|
||||
Future<void> fetchAndSetAllPlansSparse() async {
|
||||
final data = await fetch(makeUrl(_nutritionalPlansPath, query: {'limit': '1000'}));
|
||||
final data = await baseProvider
|
||||
.fetchPaginated(baseProvider.makeUrl(_nutritionalPlansPath, query: {'limit': '1000'}));
|
||||
_plans = [];
|
||||
for (final planData in data['results']) {
|
||||
for (final planData in data) {
|
||||
final plan = NutritionalPlan.fromJson(planData);
|
||||
_plans.add(plan);
|
||||
_plans.sort((a, b) => b.creationDate.compareTo(a.creationDate));
|
||||
@@ -128,7 +129,7 @@ class NutritionPlansProvider with ChangeNotifier {
|
||||
NutritionalPlan plan;
|
||||
try {
|
||||
plan = findById(planId);
|
||||
} on NoSuchEntryException catch (e) {
|
||||
} on NoSuchEntryException {
|
||||
plan = await fetchAndSetPlanSparse(planId);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,17 +3,16 @@
|
||||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i9;
|
||||
import 'dart:ui' as _i10;
|
||||
import 'dart:async' as _i8;
|
||||
import 'dart:ui' as _i9;
|
||||
|
||||
import 'package:http/http.dart' as _i3;
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:wger/models/nutrition/ingredient.dart' as _i7;
|
||||
import 'package:wger/models/nutrition/meal.dart' as _i5;
|
||||
import 'package:wger/models/nutrition/meal_item.dart' as _i6;
|
||||
import 'package:wger/models/nutrition/nutritional_plan.dart' as _i4;
|
||||
import 'package:wger/providers/auth.dart' as _i2;
|
||||
import 'package:wger/providers/nutrition.dart' as _i8;
|
||||
import 'package:wger/models/nutrition/ingredient.dart' as _i6;
|
||||
import 'package:wger/models/nutrition/meal.dart' as _i4;
|
||||
import 'package:wger/models/nutrition/meal_item.dart' as _i5;
|
||||
import 'package:wger/models/nutrition/nutritional_plan.dart' as _i3;
|
||||
import 'package:wger/providers/base_provider.dart' as _i2;
|
||||
import 'package:wger/providers/nutrition.dart' as _i7;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
@@ -26,8 +25,8 @@ import 'package:wger/providers/nutrition.dart' as _i8;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider {
|
||||
_FakeAuthProvider_0(
|
||||
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
|
||||
_FakeWgerBaseProvider_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -36,8 +35,8 @@ class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeClient_1 extends _i1.SmartFake implements _i3.Client {
|
||||
_FakeClient_1(
|
||||
class _FakeNutritionalPlan_1 extends _i1.SmartFake implements _i3.NutritionalPlan {
|
||||
_FakeNutritionalPlan_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -46,8 +45,8 @@ class _FakeClient_1 extends _i1.SmartFake implements _i3.Client {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeNutritionalPlan_2 extends _i1.SmartFake implements _i4.NutritionalPlan {
|
||||
_FakeNutritionalPlan_2(
|
||||
class _FakeMeal_2 extends _i1.SmartFake implements _i4.Meal {
|
||||
_FakeMeal_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -56,8 +55,8 @@ class _FakeNutritionalPlan_2 extends _i1.SmartFake implements _i4.NutritionalPla
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMeal_3 extends _i1.SmartFake implements _i5.Meal {
|
||||
_FakeMeal_3(
|
||||
class _FakeMealItem_3 extends _i1.SmartFake implements _i5.MealItem {
|
||||
_FakeMealItem_3(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -66,38 +65,8 @@ class _FakeMeal_3 extends _i1.SmartFake implements _i5.Meal {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMealItem_4 extends _i1.SmartFake implements _i6.MealItem {
|
||||
_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,
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeUri_6 extends _i1.SmartFake implements Uri {
|
||||
_FakeUri_6(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeResponse_7 extends _i1.SmartFake implements _i3.Response {
|
||||
_FakeResponse_7(
|
||||
class _FakeIngredient_4 extends _i1.SmartFake implements _i6.Ingredient {
|
||||
_FakeIngredient_4(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -109,45 +78,29 @@ class _FakeResponse_7 extends _i1.SmartFake implements _i3.Response {
|
||||
/// A class which mocks [NutritionPlansProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansProvider {
|
||||
class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansProvider {
|
||||
MockNutritionPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
List<_i4.NutritionalPlan> get items => (super.noSuchMethod(
|
||||
_i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
|
||||
Invocation.getter(#baseProvider),
|
||||
returnValue: _FakeWgerBaseProvider_0(
|
||||
this,
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
@override
|
||||
List<_i3.NutritionalPlan> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i4.NutritionalPlan>[],
|
||||
) as List<_i4.NutritionalPlan>);
|
||||
returnValue: <_i3.NutritionalPlan>[],
|
||||
) as List<_i3.NutritionalPlan>);
|
||||
@override
|
||||
_i2.AuthProvider get auth => (super.noSuchMethod(
|
||||
Invocation.getter(#auth),
|
||||
returnValue: _FakeAuthProvider_0(
|
||||
this,
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
@override
|
||||
set auth(_i2.AuthProvider? _auth) => super.noSuchMethod(
|
||||
set ingredients(dynamic items) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#auth,
|
||||
_auth,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
returnValue: _FakeClient_1(
|
||||
this,
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
@override
|
||||
set client(_i3.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#client,
|
||||
_client,
|
||||
#ingredients,
|
||||
items,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@@ -165,105 +118,105 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i4.NutritionalPlan findById(int? id) => (super.noSuchMethod(
|
||||
_i3.NutritionalPlan findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _FakeNutritionalPlan_2(
|
||||
returnValue: _FakeNutritionalPlan_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
),
|
||||
) as _i4.NutritionalPlan);
|
||||
) as _i3.NutritionalPlan);
|
||||
@override
|
||||
_i5.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(
|
||||
_i4.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(
|
||||
#findMealById,
|
||||
[id],
|
||||
)) as _i5.Meal?);
|
||||
)) as _i4.Meal?);
|
||||
@override
|
||||
_i9.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
|
||||
_i8.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetAllPlansSparse,
|
||||
[],
|
||||
),
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
@override
|
||||
_i9.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
|
||||
_i8.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetAllPlansFull,
|
||||
[],
|
||||
),
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
@override
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
)),
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
@override
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
[planId],
|
||||
),
|
||||
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
[planId],
|
||||
),
|
||||
)),
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
@override
|
||||
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) => (super.noSuchMethod(
|
||||
_i8.Future<_i3.NutritionalPlan> addPlan(_i3.NutritionalPlan? planData) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
[planData],
|
||||
),
|
||||
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
[planData],
|
||||
),
|
||||
)),
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
@override
|
||||
_i9.Future<void> editPlan(_i4.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
_i8.Future<void> editPlan(_i3.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#editPlan,
|
||||
[plan],
|
||||
),
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
@override
|
||||
_i9.Future<void> deletePlan(int? id) => (super.noSuchMethod(
|
||||
_i8.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>);
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
@override
|
||||
_i9.Future<_i5.Meal> addMeal(
|
||||
_i5.Meal? meal,
|
||||
_i8.Future<_i4.Meal> addMeal(
|
||||
_i4.Meal? meal,
|
||||
int? planId,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
@@ -274,7 +227,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
|
||||
planId,
|
||||
],
|
||||
),
|
||||
returnValue: _i9.Future<_i5.Meal>.value(_FakeMeal_3(
|
||||
returnValue: _i8.Future<_i4.Meal>.value(_FakeMeal_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addMeal,
|
||||
@@ -284,34 +237,34 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i9.Future<_i5.Meal>);
|
||||
) as _i8.Future<_i4.Meal>);
|
||||
@override
|
||||
_i9.Future<_i5.Meal> editMeal(_i5.Meal? meal) => (super.noSuchMethod(
|
||||
_i8.Future<_i4.Meal> editMeal(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#editMeal,
|
||||
[meal],
|
||||
),
|
||||
returnValue: _i9.Future<_i5.Meal>.value(_FakeMeal_3(
|
||||
returnValue: _i8.Future<_i4.Meal>.value(_FakeMeal_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#editMeal,
|
||||
[meal],
|
||||
),
|
||||
)),
|
||||
) as _i9.Future<_i5.Meal>);
|
||||
) as _i8.Future<_i4.Meal>);
|
||||
@override
|
||||
_i9.Future<void> deleteMeal(_i5.Meal? meal) => (super.noSuchMethod(
|
||||
_i8.Future<void> deleteMeal(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteMeal,
|
||||
[meal],
|
||||
),
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
@override
|
||||
_i9.Future<_i6.MealItem> addMealItem(
|
||||
_i6.MealItem? mealItem,
|
||||
_i5.Meal? meal,
|
||||
_i8.Future<_i5.MealItem> addMealItem(
|
||||
_i5.MealItem? mealItem,
|
||||
_i4.Meal? meal,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -321,7 +274,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
|
||||
meal,
|
||||
],
|
||||
),
|
||||
returnValue: _i9.Future<_i6.MealItem>.value(_FakeMealItem_4(
|
||||
returnValue: _i8.Future<_i5.MealItem>.value(_FakeMealItem_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addMealItem,
|
||||
@@ -331,41 +284,41 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i9.Future<_i6.MealItem>);
|
||||
) as _i8.Future<_i5.MealItem>);
|
||||
@override
|
||||
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) => (super.noSuchMethod(
|
||||
_i8.Future<void> deleteMealItem(_i5.MealItem? mealItem) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteMealItem,
|
||||
[mealItem],
|
||||
),
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
@override
|
||||
_i9.Future<_i7.Ingredient> fetchIngredient(int? ingredientId) => (super.noSuchMethod(
|
||||
_i8.Future<_i6.Ingredient> fetchIngredient(int? ingredientId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchIngredient,
|
||||
[ingredientId],
|
||||
),
|
||||
returnValue: _i9.Future<_i7.Ingredient>.value(_FakeIngredient_5(
|
||||
returnValue: _i8.Future<_i6.Ingredient>.value(_FakeIngredient_4(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchIngredient,
|
||||
[ingredientId],
|
||||
),
|
||||
)),
|
||||
) as _i9.Future<_i7.Ingredient>);
|
||||
) as _i8.Future<_i6.Ingredient>);
|
||||
@override
|
||||
_i9.Future<void> fetchIngredientsFromCache() => (super.noSuchMethod(
|
||||
_i8.Future<void> fetchIngredientsFromCache() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchIngredientsFromCache,
|
||||
[],
|
||||
),
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
@override
|
||||
_i9.Future<List<dynamic>> searchIngredient(
|
||||
_i8.Future<List<dynamic>> searchIngredient(
|
||||
String? name, [
|
||||
String? languageCode = r'en',
|
||||
]) =>
|
||||
@@ -377,28 +330,28 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
|
||||
languageCode,
|
||||
],
|
||||
),
|
||||
returnValue: _i9.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i9.Future<List<dynamic>>);
|
||||
returnValue: _i8.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i8.Future<List<dynamic>>);
|
||||
@override
|
||||
_i9.Future<_i7.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod(
|
||||
_i8.Future<_i6.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchIngredientWithCode,
|
||||
[code],
|
||||
),
|
||||
returnValue: _i9.Future<_i7.Ingredient?>.value(),
|
||||
) as _i9.Future<_i7.Ingredient?>);
|
||||
returnValue: _i8.Future<_i6.Ingredient?>.value(),
|
||||
) as _i8.Future<_i6.Ingredient?>);
|
||||
@override
|
||||
_i9.Future<void> logMealToDiary(_i5.Meal? meal) => (super.noSuchMethod(
|
||||
_i8.Future<void> logMealToDiary(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#logMealToDiary,
|
||||
[meal],
|
||||
),
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
@override
|
||||
_i9.Future<void> logIngredentToDiary(
|
||||
_i6.MealItem? mealItem,
|
||||
_i8.Future<void> logIngredentToDiary(
|
||||
_i5.MealItem? mealItem,
|
||||
int? planId, [
|
||||
DateTime? dateTime,
|
||||
]) =>
|
||||
@@ -411,11 +364,11 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
|
||||
dateTime,
|
||||
],
|
||||
),
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
@override
|
||||
_i9.Future<void> deleteLog(
|
||||
_i8.Future<void> deleteLog(
|
||||
int? logId,
|
||||
int? planId,
|
||||
) =>
|
||||
@@ -427,129 +380,20 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
|
||||
planId,
|
||||
],
|
||||
),
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
@override
|
||||
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
_i8.Future<void> fetchAndSetLogs(_i3.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLogs,
|
||||
[plan],
|
||||
),
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic 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_6(
|
||||
this,
|
||||
Invocation.method(
|
||||
#makeUrl,
|
||||
[path],
|
||||
{
|
||||
#id: id,
|
||||
#objectMethod: objectMethod,
|
||||
#query: query,
|
||||
},
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
@override
|
||||
_i9.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i9.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i9.Future<Map<String, dynamic>>);
|
||||
@override
|
||||
_i9.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchPaginated,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i9.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i9.Future<List<dynamic>>);
|
||||
@override
|
||||
_i9.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
Uri? uri,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#post,
|
||||
[
|
||||
data,
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue: _i9.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i9.Future<Map<String, dynamic>>);
|
||||
@override
|
||||
_i9.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
Uri? uri,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#patch,
|
||||
[
|
||||
data,
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue: _i9.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i9.Future<Map<String, dynamic>>);
|
||||
@override
|
||||
_i9.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
int? id,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteRequest,
|
||||
[
|
||||
url,
|
||||
id,
|
||||
],
|
||||
),
|
||||
returnValue: _i9.Future<_i3.Response>.value(_FakeResponse_7(
|
||||
this,
|
||||
Invocation.method(
|
||||
#deleteRequest,
|
||||
[
|
||||
url,
|
||||
id,
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i9.Future<_i3.Response>);
|
||||
@override
|
||||
void addListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
void addListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addListener,
|
||||
[listener],
|
||||
@@ -557,7 +401,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#removeListener,
|
||||
[listener],
|
||||
|
||||
@@ -31,22 +31,19 @@ import 'package:wger/widgets/nutrition/charts.dart';
|
||||
|
||||
import '../../test_data/nutritional_plans.dart';
|
||||
import 'nutritional_plan_screen_test.mocks.dart';
|
||||
import '../utils.dart';
|
||||
|
||||
@GenerateMocks([WgerBaseProvider, AuthProvider, http.Client])
|
||||
void main() {
|
||||
Widget createNutritionalPlan({locale = 'en'}) {
|
||||
final key = GlobalKey<NavigatorState>();
|
||||
final client = MockClient();
|
||||
final mockBaseProvider = MockWgerBaseProvider();
|
||||
final mockAuthProvider = MockAuthProvider();
|
||||
|
||||
final plan = getNutritionalPlan();
|
||||
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider<NutritionPlansProvider>(
|
||||
create: (context) => NutritionPlansProvider(mockAuthProvider, [], client),
|
||||
create: (context) => NutritionPlansProvider(mockBaseProvider, []),
|
||||
),
|
||||
ChangeNotifierProvider<BodyWeightProvider>(
|
||||
create: (context) => BodyWeightProvider(mockBaseProvider),
|
||||
|
||||
@@ -25,6 +25,7 @@ import 'package:mockito/mockito.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:wger/models/nutrition/nutritional_plan.dart';
|
||||
import 'package:wger/providers/auth.dart';
|
||||
import 'package:wger/providers/base_provider.dart';
|
||||
import 'package:wger/providers/nutrition.dart';
|
||||
import 'package:wger/screens/form_screen.dart';
|
||||
import 'package:wger/screens/nutritional_plans_screen.dart';
|
||||
@@ -32,9 +33,10 @@ import 'package:wger/widgets/nutrition/forms.dart';
|
||||
|
||||
import 'nutritional_plan_screen_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([AuthProvider, http.Client])
|
||||
@GenerateMocks([AuthProvider, WgerBaseProvider, http.Client])
|
||||
void main() {
|
||||
final mockAuthProvider = MockAuthProvider();
|
||||
final mockBaseProvider = MockWgerBaseProvider();
|
||||
final client = MockClient();
|
||||
|
||||
Widget createHomeScreen({locale = 'en'}) {
|
||||
@@ -43,8 +45,8 @@ void main() {
|
||||
headers: anyNamed('headers'),
|
||||
)).thenAnswer((_) async => http.Response('', 200));
|
||||
|
||||
when(mockWgerBaseProvider.deleteRequest(any, any)).thenAnswer(
|
||||
(_) async => http.Response('', 200),
|
||||
when(mockBaseProvider.deleteRequest(any, any)).thenAnswer(
|
||||
(_) async => http.Response('', 200),
|
||||
);
|
||||
|
||||
when(mockAuthProvider.token).thenReturn('1234');
|
||||
@@ -53,7 +55,7 @@ void main() {
|
||||
|
||||
return ChangeNotifierProvider<NutritionPlansProvider>(
|
||||
create: (context) => NutritionPlansProvider(
|
||||
mockAuthProvider,
|
||||
mockBaseProvider,
|
||||
[
|
||||
NutritionalPlan(
|
||||
id: 1,
|
||||
@@ -66,7 +68,6 @@ void main() {
|
||||
creationDate: DateTime(2021, 01, 10),
|
||||
),
|
||||
],
|
||||
client,
|
||||
),
|
||||
child: MaterialApp(
|
||||
locale: Locale(locale),
|
||||
|
||||
@@ -4,14 +4,15 @@
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i5;
|
||||
import 'dart:convert' as _i7;
|
||||
import 'dart:typed_data' as _i8;
|
||||
import 'dart:convert' as _i8;
|
||||
import 'dart:typed_data' as _i9;
|
||||
import 'dart:ui' as _i6;
|
||||
|
||||
import 'package:http/http.dart' as _i2;
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:package_info/package_info.dart' as _i4;
|
||||
import 'package:wger/providers/auth.dart' as _i3;
|
||||
import 'package:wger/providers/base_provider.dart' as _i7;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
@@ -34,8 +35,8 @@ class _FakeClient_0 extends _i1.SmartFake implements _i2.Client {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeResponse_1 extends _i1.SmartFake implements _i2.Response {
|
||||
_FakeResponse_1(
|
||||
class _FakeAuthProvider_1 extends _i1.SmartFake implements _i3.AuthProvider {
|
||||
_FakeAuthProvider_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -44,8 +45,28 @@ class _FakeResponse_1 extends _i1.SmartFake implements _i2.Response {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeStreamedResponse_2 extends _i1.SmartFake implements _i2.StreamedResponse {
|
||||
_FakeStreamedResponse_2(
|
||||
class _FakeUri_2 extends _i1.SmartFake implements Uri {
|
||||
_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,
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeStreamedResponse_4 extends _i1.SmartFake implements _i2.StreamedResponse {
|
||||
_FakeStreamedResponse_4(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -293,6 +314,157 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [WgerBaseProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockWgerBaseProvider extends _i1.Mock implements _i7.WgerBaseProvider {
|
||||
MockWgerBaseProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i3.AuthProvider get auth => (super.noSuchMethod(
|
||||
Invocation.getter(#auth),
|
||||
returnValue: _FakeAuthProvider_1(
|
||||
this,
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i3.AuthProvider);
|
||||
@override
|
||||
set auth(_i3.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#auth,
|
||||
_auth,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i2.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
returnValue: _FakeClient_0(
|
||||
this,
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i2.Client);
|
||||
@override
|
||||
set client(_i2.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#client,
|
||||
_client,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic 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
|
||||
_i5.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, 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].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
@@ -312,7 +484,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_1(
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#head,
|
||||
@@ -332,7 +504,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_1(
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#get,
|
||||
@@ -346,7 +518,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
Object? body,
|
||||
_i7.Encoding? encoding,
|
||||
_i8.Encoding? encoding,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -358,7 +530,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_1(
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#post,
|
||||
@@ -376,7 +548,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
Object? body,
|
||||
_i7.Encoding? encoding,
|
||||
_i8.Encoding? encoding,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -388,7 +560,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_1(
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#put,
|
||||
@@ -406,7 +578,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
Object? body,
|
||||
_i7.Encoding? encoding,
|
||||
_i8.Encoding? encoding,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -418,7 +590,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_1(
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#patch,
|
||||
@@ -436,7 +608,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
Object? body,
|
||||
_i7.Encoding? encoding,
|
||||
_i8.Encoding? encoding,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -448,7 +620,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_1(
|
||||
returnValue: _i5.Future<_i2.Response>.value(_FakeResponse_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#delete,
|
||||
@@ -475,7 +647,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
returnValue: _i5.Future<String>.value(''),
|
||||
) as _i5.Future<String>);
|
||||
@override
|
||||
_i5.Future<_i8.Uint8List> readBytes(
|
||||
_i5.Future<_i9.Uint8List> readBytes(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
}) =>
|
||||
@@ -485,15 +657,15 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
returnValue: _i5.Future<_i8.Uint8List>.value(_i8.Uint8List(0)),
|
||||
) as _i5.Future<_i8.Uint8List>);
|
||||
returnValue: _i5.Future<_i9.Uint8List>.value(_i9.Uint8List(0)),
|
||||
) as _i5.Future<_i9.Uint8List>);
|
||||
@override
|
||||
_i5.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#send,
|
||||
[request],
|
||||
),
|
||||
returnValue: _i5.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_2(
|
||||
returnValue: _i5.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_4(
|
||||
this,
|
||||
Invocation.method(
|
||||
#send,
|
||||
|
||||
Reference in New Issue
Block a user