Files
flutter/test/weight/weight_screen_test.mocks.dart
Roland Geider b81331609a Also allow changing the order of the dashboard widgets
This makes the behaviour more consistent and allows users to remove widgets
they won't be using, like the trophies
2026-01-17 13:43:28 +01:00

721 lines
22 KiB
Dart

// Mocks generated by Mockito 5.4.6 from annotations
// in wger/test/weight/weight_screen_test.dart.
// Do not manually edit this file.
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i11;
import 'dart:ui' as _i12;
import 'package:flutter/material.dart' as _i14;
import 'package:mockito/mockito.dart' as _i1;
import 'package:shared_preferences/shared_preferences.dart' as _i4;
import 'package:wger/database/ingredients/ingredients_database.dart' as _i5;
import 'package:wger/models/body_weight/weight_entry.dart' as _i3;
import 'package:wger/models/nutrition/ingredient.dart' as _i9;
import 'package:wger/models/nutrition/meal.dart' as _i7;
import 'package:wger/models/nutrition/meal_item.dart' as _i8;
import 'package:wger/models/nutrition/nutritional_plan.dart' as _i6;
import 'package:wger/models/user/profile.dart' as _i15;
import 'package:wger/providers/base_provider.dart' as _i2;
import 'package:wger/providers/body_weight.dart' as _i10;
import 'package:wger/providers/nutrition.dart' as _i16;
import 'package:wger/providers/user.dart' as _i13;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: must_be_immutable
// ignore_for_file: prefer_const_constructors
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
// 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);
}
class _FakeWeightEntry_1 extends _i1.SmartFake implements _i3.WeightEntry {
_FakeWeightEntry_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeSharedPreferencesAsync_2 extends _i1.SmartFake implements _i4.SharedPreferencesAsync {
_FakeSharedPreferencesAsync_2(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
class _FakeIngredientDatabase_3 extends _i1.SmartFake implements _i5.IngredientDatabase {
_FakeIngredientDatabase_3(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
class _FakeNutritionalPlan_4 extends _i1.SmartFake implements _i6.NutritionalPlan {
_FakeNutritionalPlan_4(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
class _FakeMeal_5 extends _i1.SmartFake implements _i7.Meal {
_FakeMeal_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeMealItem_6 extends _i1.SmartFake implements _i8.MealItem {
_FakeMealItem_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
class _FakeIngredient_7 extends _i1.SmartFake implements _i9.Ingredient {
_FakeIngredient_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation);
}
/// A class which mocks [BodyWeightProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockBodyWeightProvider extends _i1.Mock implements _i10.BodyWeightProvider {
MockBodyWeightProvider() {
_i1.throwOnMissingStub(this);
}
@override
_i2.WgerBaseProvider get baseProvider =>
(super.noSuchMethod(
Invocation.getter(#baseProvider),
returnValue: _FakeWgerBaseProvider_0(
this,
Invocation.getter(#baseProvider),
),
)
as _i2.WgerBaseProvider);
@override
List<_i3.WeightEntry> get items =>
(super.noSuchMethod(
Invocation.getter(#items),
returnValue: <_i3.WeightEntry>[],
)
as List<_i3.WeightEntry>);
@override
set items(List<_i3.WeightEntry>? entries) => super.noSuchMethod(
Invocation.setter(#items, entries),
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
_i3.WeightEntry findById(int? id) =>
(super.noSuchMethod(
Invocation.method(#findById, [id]),
returnValue: _FakeWeightEntry_1(
this,
Invocation.method(#findById, [id]),
),
)
as _i3.WeightEntry);
@override
_i3.WeightEntry? findByDate(DateTime? date) =>
(super.noSuchMethod(Invocation.method(#findByDate, [date])) as _i3.WeightEntry?);
@override
_i11.Future<List<_i3.WeightEntry>> fetchAndSetEntries() =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetEntries, []),
returnValue: _i11.Future<List<_i3.WeightEntry>>.value(
<_i3.WeightEntry>[],
),
)
as _i11.Future<List<_i3.WeightEntry>>);
@override
_i11.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) =>
(super.noSuchMethod(
Invocation.method(#addEntry, [entry]),
returnValue: _i11.Future<_i3.WeightEntry>.value(
_FakeWeightEntry_1(this, Invocation.method(#addEntry, [entry])),
),
)
as _i11.Future<_i3.WeightEntry>);
@override
_i11.Future<void> editEntry(_i3.WeightEntry? entry) =>
(super.noSuchMethod(
Invocation.method(#editEntry, [entry]),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<void> deleteEntry(int? id) =>
(super.noSuchMethod(
Invocation.method(#deleteEntry, [id]),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
void addListener(_i12.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(#addListener, [listener]),
returnValueForMissingStub: null,
);
@override
void removeListener(_i12.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(#removeListener, [listener]),
returnValueForMissingStub: null,
);
@override
void dispose() => super.noSuchMethod(
Invocation.method(#dispose, []),
returnValueForMissingStub: null,
);
@override
void notifyListeners() => super.noSuchMethod(
Invocation.method(#notifyListeners, []),
returnValueForMissingStub: null,
);
}
/// A class which mocks [UserProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockUserProvider extends _i1.Mock implements _i13.UserProvider {
MockUserProvider() {
_i1.throwOnMissingStub(this);
}
@override
_i14.ThemeMode get themeMode =>
(super.noSuchMethod(
Invocation.getter(#themeMode),
returnValue: _i14.ThemeMode.system,
)
as _i14.ThemeMode);
@override
_i2.WgerBaseProvider get baseProvider =>
(super.noSuchMethod(
Invocation.getter(#baseProvider),
returnValue: _FakeWgerBaseProvider_0(
this,
Invocation.getter(#baseProvider),
),
)
as _i2.WgerBaseProvider);
@override
_i4.SharedPreferencesAsync get prefs =>
(super.noSuchMethod(
Invocation.getter(#prefs),
returnValue: _FakeSharedPreferencesAsync_2(
this,
Invocation.getter(#prefs),
),
)
as _i4.SharedPreferencesAsync);
@override
List<_i13.DashboardWidget> get dashboardOrder =>
(super.noSuchMethod(
Invocation.getter(#dashboardOrder),
returnValue: <_i13.DashboardWidget>[],
)
as List<_i13.DashboardWidget>);
@override
set themeMode(_i14.ThemeMode? value) => super.noSuchMethod(
Invocation.setter(#themeMode, value),
returnValueForMissingStub: null,
);
@override
set prefs(_i4.SharedPreferencesAsync? value) => super.noSuchMethod(
Invocation.setter(#prefs, value),
returnValueForMissingStub: null,
);
@override
set profile(_i15.Profile? value) => super.noSuchMethod(
Invocation.setter(#profile, 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
bool isDashboardWidgetVisible(_i13.DashboardWidget? key) =>
(super.noSuchMethod(
Invocation.method(#isDashboardWidgetVisible, [key]),
returnValue: false,
)
as bool);
@override
_i11.Future<void> setDashboardWidgetVisible(
_i13.DashboardWidget? key,
bool? visible,
) =>
(super.noSuchMethod(
Invocation.method(#setDashboardWidgetVisible, [key, visible]),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<void> setDashboardOrder(int? oldIndex, int? newIndex) =>
(super.noSuchMethod(
Invocation.method(#setDashboardOrder, [oldIndex, newIndex]),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
void setThemeMode(_i14.ThemeMode? mode) => super.noSuchMethod(
Invocation.method(#setThemeMode, [mode]),
returnValueForMissingStub: null,
);
@override
_i11.Future<void> fetchAndSetProfile() =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetProfile, []),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<void> saveProfile() =>
(super.noSuchMethod(
Invocation.method(#saveProfile, []),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<void> verifyEmail() =>
(super.noSuchMethod(
Invocation.method(#verifyEmail, []),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
void addListener(_i12.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(#addListener, [listener]),
returnValueForMissingStub: null,
);
@override
void removeListener(_i12.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(#removeListener, [listener]),
returnValueForMissingStub: null,
);
@override
void dispose() => super.noSuchMethod(
Invocation.method(#dispose, []),
returnValueForMissingStub: null,
);
@override
void notifyListeners() => super.noSuchMethod(
Invocation.method(#notifyListeners, []),
returnValueForMissingStub: null,
);
}
/// A class which mocks [NutritionPlansProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockNutritionPlansProvider extends _i1.Mock implements _i16.NutritionPlansProvider {
MockNutritionPlansProvider() {
_i1.throwOnMissingStub(this);
}
@override
_i2.WgerBaseProvider get baseProvider =>
(super.noSuchMethod(
Invocation.getter(#baseProvider),
returnValue: _FakeWgerBaseProvider_0(
this,
Invocation.getter(#baseProvider),
),
)
as _i2.WgerBaseProvider);
@override
_i5.IngredientDatabase get database =>
(super.noSuchMethod(
Invocation.getter(#database),
returnValue: _FakeIngredientDatabase_3(
this,
Invocation.getter(#database),
),
)
as _i5.IngredientDatabase);
@override
List<_i9.Ingredient> get ingredients =>
(super.noSuchMethod(
Invocation.getter(#ingredients),
returnValue: <_i9.Ingredient>[],
)
as List<_i9.Ingredient>);
@override
List<_i6.NutritionalPlan> get items =>
(super.noSuchMethod(
Invocation.getter(#items),
returnValue: <_i6.NutritionalPlan>[],
)
as List<_i6.NutritionalPlan>);
@override
set database(_i5.IngredientDatabase? value) => super.noSuchMethod(
Invocation.setter(#database, value),
returnValueForMissingStub: null,
);
@override
set ingredients(List<_i9.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
_i6.NutritionalPlan findById(int? id) =>
(super.noSuchMethod(
Invocation.method(#findById, [id]),
returnValue: _FakeNutritionalPlan_4(
this,
Invocation.method(#findById, [id]),
),
)
as _i6.NutritionalPlan);
@override
_i7.Meal? findMealById(int? id) =>
(super.noSuchMethod(Invocation.method(#findMealById, [id])) as _i7.Meal?);
@override
_i11.Future<void> fetchAndSetAllPlansSparse() =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetAllPlansSparse, []),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<void> fetchAndSetAllPlansFull() =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetAllPlansFull, []),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<_i6.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetPlanSparse, [planId]),
returnValue: _i11.Future<_i6.NutritionalPlan>.value(
_FakeNutritionalPlan_4(
this,
Invocation.method(#fetchAndSetPlanSparse, [planId]),
),
),
)
as _i11.Future<_i6.NutritionalPlan>);
@override
_i11.Future<_i6.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetPlanFull, [planId]),
returnValue: _i11.Future<_i6.NutritionalPlan>.value(
_FakeNutritionalPlan_4(
this,
Invocation.method(#fetchAndSetPlanFull, [planId]),
),
),
)
as _i11.Future<_i6.NutritionalPlan>);
@override
_i11.Future<_i6.NutritionalPlan> addPlan(_i6.NutritionalPlan? planData) =>
(super.noSuchMethod(
Invocation.method(#addPlan, [planData]),
returnValue: _i11.Future<_i6.NutritionalPlan>.value(
_FakeNutritionalPlan_4(
this,
Invocation.method(#addPlan, [planData]),
),
),
)
as _i11.Future<_i6.NutritionalPlan>);
@override
_i11.Future<void> editPlan(_i6.NutritionalPlan? plan) =>
(super.noSuchMethod(
Invocation.method(#editPlan, [plan]),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<void> deletePlan(int? id) =>
(super.noSuchMethod(
Invocation.method(#deletePlan, [id]),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<_i7.Meal> addMeal(_i7.Meal? meal, int? planId) =>
(super.noSuchMethod(
Invocation.method(#addMeal, [meal, planId]),
returnValue: _i11.Future<_i7.Meal>.value(
_FakeMeal_5(this, Invocation.method(#addMeal, [meal, planId])),
),
)
as _i11.Future<_i7.Meal>);
@override
_i11.Future<_i7.Meal> editMeal(_i7.Meal? meal) =>
(super.noSuchMethod(
Invocation.method(#editMeal, [meal]),
returnValue: _i11.Future<_i7.Meal>.value(
_FakeMeal_5(this, Invocation.method(#editMeal, [meal])),
),
)
as _i11.Future<_i7.Meal>);
@override
_i11.Future<void> deleteMeal(_i7.Meal? meal) =>
(super.noSuchMethod(
Invocation.method(#deleteMeal, [meal]),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<_i8.MealItem> addMealItem(
_i8.MealItem? mealItem,
_i7.Meal? meal,
) =>
(super.noSuchMethod(
Invocation.method(#addMealItem, [mealItem, meal]),
returnValue: _i11.Future<_i8.MealItem>.value(
_FakeMealItem_6(
this,
Invocation.method(#addMealItem, [mealItem, meal]),
),
),
)
as _i11.Future<_i8.MealItem>);
@override
_i11.Future<void> deleteMealItem(_i8.MealItem? mealItem) =>
(super.noSuchMethod(
Invocation.method(#deleteMealItem, [mealItem]),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<void> clearIngredientCache() =>
(super.noSuchMethod(
Invocation.method(#clearIngredientCache, []),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<void> cacheIngredient(
_i9.Ingredient? ingredient, {
_i5.IngredientDatabase? database,
}) =>
(super.noSuchMethod(
Invocation.method(
#cacheIngredient,
[ingredient],
{#database: database},
),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<_i9.Ingredient> fetchIngredient(
int? ingredientId, {
_i5.IngredientDatabase? database,
}) =>
(super.noSuchMethod(
Invocation.method(
#fetchIngredient,
[ingredientId],
{#database: database},
),
returnValue: _i11.Future<_i9.Ingredient>.value(
_FakeIngredient_7(
this,
Invocation.method(
#fetchIngredient,
[ingredientId],
{#database: database},
),
),
),
)
as _i11.Future<_i9.Ingredient>);
@override
_i11.Future<void> fetchIngredientsFromCache() =>
(super.noSuchMethod(
Invocation.method(#fetchIngredientsFromCache, []),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<List<_i9.Ingredient>> searchIngredient(
String? name, {
String? languageCode = 'en',
bool? searchEnglish = false,
}) =>
(super.noSuchMethod(
Invocation.method(
#searchIngredient,
[name],
{#languageCode: languageCode, #searchEnglish: searchEnglish},
),
returnValue: _i11.Future<List<_i9.Ingredient>>.value(
<_i9.Ingredient>[],
),
)
as _i11.Future<List<_i9.Ingredient>>);
@override
_i11.Future<_i9.Ingredient?> searchIngredientWithBarcode(String? barcode) =>
(super.noSuchMethod(
Invocation.method(#searchIngredientWithBarcode, [barcode]),
returnValue: _i11.Future<_i9.Ingredient?>.value(),
)
as _i11.Future<_i9.Ingredient?>);
@override
_i11.Future<void> logMealToDiary(_i7.Meal? meal, DateTime? mealDateTime) =>
(super.noSuchMethod(
Invocation.method(#logMealToDiary, [meal, mealDateTime]),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<void> logIngredientToDiary(
_i8.MealItem? mealItem,
int? planId, [
DateTime? dateTime,
]) =>
(super.noSuchMethod(
Invocation.method(#logIngredientToDiary, [
mealItem,
planId,
dateTime,
]),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<void> deleteLog(int? logId, int? planId) =>
(super.noSuchMethod(
Invocation.method(#deleteLog, [logId, planId]),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<void> fetchAndSetLogs(_i6.NutritionalPlan? plan) =>
(super.noSuchMethod(
Invocation.method(#fetchAndSetLogs, [plan]),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
void addListener(_i12.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(#addListener, [listener]),
returnValueForMissingStub: null,
);
@override
void removeListener(_i12.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(#removeListener, [listener]),
returnValueForMissingStub: null,
);
@override
void dispose() => super.noSuchMethod(
Invocation.method(#dispose, []),
returnValueForMissingStub: null,
);
@override
void notifyListeners() => super.noSuchMethod(
Invocation.method(#notifyListeners, []),
returnValueForMissingStub: null,
);
}