mirror of
https://github.com/wger-project/flutter.git
synced 2026-11-30 09:42:50 +01:00
Rename field to "lastFetched" and add migration class
This commit is contained in:
@@ -15,6 +15,7 @@ part 'exercise_database.g.dart';
|
||||
@DataClassName('ExerciseTable')
|
||||
class Exercises extends Table {
|
||||
const Exercises();
|
||||
|
||||
IntColumn get id => integer()();
|
||||
|
||||
TextColumn get data => text()();
|
||||
@@ -32,6 +33,7 @@ class Exercises extends Table {
|
||||
@DataClassName('MuscleTable')
|
||||
class Muscles extends Table {
|
||||
const Muscles();
|
||||
|
||||
IntColumn get id => integer()();
|
||||
|
||||
TextColumn get data => text().map(const MuscleConverter())();
|
||||
@@ -40,6 +42,7 @@ class Muscles extends Table {
|
||||
@DataClassName('CategoryTable')
|
||||
class Categories extends Table {
|
||||
const Categories();
|
||||
|
||||
IntColumn get id => integer()();
|
||||
|
||||
TextColumn get data => text().map(const ExerciseCategoryConverter())();
|
||||
@@ -48,6 +51,7 @@ class Categories extends Table {
|
||||
@DataClassName('LanguagesTable')
|
||||
class Languages extends Table {
|
||||
const Languages();
|
||||
|
||||
IntColumn get id => integer()();
|
||||
|
||||
TextColumn get data => text().map(const LanguageConverter())();
|
||||
@@ -56,6 +60,7 @@ class Languages extends Table {
|
||||
@DataClassName('EquipmentTable')
|
||||
class Equipments extends Table {
|
||||
const Equipments();
|
||||
|
||||
IntColumn get id => integer()();
|
||||
|
||||
TextColumn get data => text().map(const EquipmentConverter())();
|
||||
@@ -69,9 +74,28 @@ class ExerciseDatabase extends _$ExerciseDatabase {
|
||||
ExerciseDatabase.inMemory(super.e);
|
||||
|
||||
@override
|
||||
// TODO: implement schemaVersion
|
||||
int get schemaVersion => 1;
|
||||
|
||||
/// There is not really a migration strategy. If we bump the version
|
||||
/// number, delete everything and recreate the new tables. The provider
|
||||
/// will fetch everything as needed from the server
|
||||
@override
|
||||
MigrationStrategy get migration => MigrationStrategy(
|
||||
onUpgrade: (m, from, to) async {
|
||||
// no-op, but needs to be defined
|
||||
return;
|
||||
},
|
||||
beforeOpen: (openingDetails) async {
|
||||
if (openingDetails.hadUpgrade) {
|
||||
final m = createMigrator();
|
||||
for (final table in allTables) {
|
||||
await m.deleteTable(table.actualTableName);
|
||||
await m.createTable(table);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Future<void> deleteEverything() {
|
||||
return transaction(() async {
|
||||
for (final table in allTables) {
|
||||
|
||||
@@ -15,7 +15,8 @@ class Ingredients extends Table {
|
||||
|
||||
TextColumn get data => text()();
|
||||
|
||||
DateTimeColumn get lastUpdate => dateTime()();
|
||||
/// The date when the ingredient was last fetched from the server
|
||||
DateTimeColumn get lastFetched => dateTime()();
|
||||
}
|
||||
|
||||
@DriftDatabase(tables: [Ingredients])
|
||||
@@ -26,8 +27,27 @@ class IngredientDatabase extends _$IngredientDatabase {
|
||||
IngredientDatabase.inMemory(super.e);
|
||||
|
||||
@override
|
||||
// TODO: implement schemaVersion
|
||||
int get schemaVersion => 1;
|
||||
int get schemaVersion => 2;
|
||||
|
||||
/// There is not really a migration strategy. If we bump the version
|
||||
/// number, delete everything and recreate the new tables. The nutrition provider
|
||||
/// will fetch everything as needed from the server
|
||||
@override
|
||||
MigrationStrategy get migration => MigrationStrategy(
|
||||
onUpgrade: (m, from, to) async {
|
||||
// no-op, but needs to be defined
|
||||
return;
|
||||
},
|
||||
beforeOpen: (openingDetails) async {
|
||||
if (openingDetails.hadUpgrade) {
|
||||
final m = createMigrator();
|
||||
for (final table in allTables) {
|
||||
await m.deleteTable(table.actualTableName);
|
||||
await m.createTable(table);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Future<void> deleteEverything() {
|
||||
return transaction(() async {
|
||||
|
||||
@@ -19,14 +19,14 @@ class $IngredientsTable extends Ingredients
|
||||
late final GeneratedColumn<String> data = GeneratedColumn<String>(
|
||||
'data', aliasedName, false,
|
||||
type: DriftSqlType.string, requiredDuringInsert: true);
|
||||
static const VerificationMeta _lastUpdateMeta =
|
||||
const VerificationMeta('lastUpdate');
|
||||
static const VerificationMeta _lastFetchedMeta =
|
||||
const VerificationMeta('lastFetched');
|
||||
@override
|
||||
late final GeneratedColumn<DateTime> lastUpdate = GeneratedColumn<DateTime>(
|
||||
'last_update', aliasedName, false,
|
||||
late final GeneratedColumn<DateTime> lastFetched = GeneratedColumn<DateTime>(
|
||||
'last_fetched', aliasedName, false,
|
||||
type: DriftSqlType.dateTime, requiredDuringInsert: true);
|
||||
@override
|
||||
List<GeneratedColumn> get $columns => [id, data, lastUpdate];
|
||||
List<GeneratedColumn> get $columns => [id, data, lastFetched];
|
||||
@override
|
||||
String get aliasedName => _alias ?? actualTableName;
|
||||
@override
|
||||
@@ -48,13 +48,13 @@ class $IngredientsTable extends Ingredients
|
||||
} else if (isInserting) {
|
||||
context.missing(_dataMeta);
|
||||
}
|
||||
if (data.containsKey('last_update')) {
|
||||
if (data.containsKey('last_fetched')) {
|
||||
context.handle(
|
||||
_lastUpdateMeta,
|
||||
lastUpdate.isAcceptableOrUnknown(
|
||||
data['last_update']!, _lastUpdateMeta));
|
||||
_lastFetchedMeta,
|
||||
lastFetched.isAcceptableOrUnknown(
|
||||
data['last_fetched']!, _lastFetchedMeta));
|
||||
} else if (isInserting) {
|
||||
context.missing(_lastUpdateMeta);
|
||||
context.missing(_lastFetchedMeta);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
@@ -69,8 +69,8 @@ class $IngredientsTable extends Ingredients
|
||||
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
|
||||
data: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}data'])!,
|
||||
lastUpdate: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.dateTime, data['${effectivePrefix}last_update'])!,
|
||||
lastFetched: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.dateTime, data['${effectivePrefix}last_fetched'])!,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -83,15 +83,15 @@ class $IngredientsTable extends Ingredients
|
||||
class IngredientTable extends DataClass implements Insertable<IngredientTable> {
|
||||
final int id;
|
||||
final String data;
|
||||
final DateTime lastUpdate;
|
||||
final DateTime lastFetched;
|
||||
const IngredientTable(
|
||||
{required this.id, required this.data, required this.lastUpdate});
|
||||
{required this.id, required this.data, required this.lastFetched});
|
||||
@override
|
||||
Map<String, Expression> toColumns(bool nullToAbsent) {
|
||||
final map = <String, Expression>{};
|
||||
map['id'] = Variable<int>(id);
|
||||
map['data'] = Variable<String>(data);
|
||||
map['last_update'] = Variable<DateTime>(lastUpdate);
|
||||
map['last_fetched'] = Variable<DateTime>(lastFetched);
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
|
||||
return IngredientsCompanion(
|
||||
id: Value(id),
|
||||
data: Value(data),
|
||||
lastUpdate: Value(lastUpdate),
|
||||
lastFetched: Value(lastFetched),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
|
||||
return IngredientTable(
|
||||
id: serializer.fromJson<int>(json['id']),
|
||||
data: serializer.fromJson<String>(json['data']),
|
||||
lastUpdate: serializer.fromJson<DateTime>(json['lastUpdate']),
|
||||
lastFetched: serializer.fromJson<DateTime>(json['lastFetched']),
|
||||
);
|
||||
}
|
||||
@override
|
||||
@@ -118,22 +118,22 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
|
||||
return <String, dynamic>{
|
||||
'id': serializer.toJson<int>(id),
|
||||
'data': serializer.toJson<String>(data),
|
||||
'lastUpdate': serializer.toJson<DateTime>(lastUpdate),
|
||||
'lastFetched': serializer.toJson<DateTime>(lastFetched),
|
||||
};
|
||||
}
|
||||
|
||||
IngredientTable copyWith({int? id, String? data, DateTime? lastUpdate}) =>
|
||||
IngredientTable copyWith({int? id, String? data, DateTime? lastFetched}) =>
|
||||
IngredientTable(
|
||||
id: id ?? this.id,
|
||||
data: data ?? this.data,
|
||||
lastUpdate: lastUpdate ?? this.lastUpdate,
|
||||
lastFetched: lastFetched ?? this.lastFetched,
|
||||
);
|
||||
IngredientTable copyWithCompanion(IngredientsCompanion data) {
|
||||
return IngredientTable(
|
||||
id: data.id.present ? data.id.value : this.id,
|
||||
data: data.data.present ? data.data.value : this.data,
|
||||
lastUpdate:
|
||||
data.lastUpdate.present ? data.lastUpdate.value : this.lastUpdate,
|
||||
lastFetched:
|
||||
data.lastFetched.present ? data.lastFetched.value : this.lastFetched,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -142,51 +142,51 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
|
||||
return (StringBuffer('IngredientTable(')
|
||||
..write('id: $id, ')
|
||||
..write('data: $data, ')
|
||||
..write('lastUpdate: $lastUpdate')
|
||||
..write('lastFetched: $lastFetched')
|
||||
..write(')'))
|
||||
.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(id, data, lastUpdate);
|
||||
int get hashCode => Object.hash(id, data, lastFetched);
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
(other is IngredientTable &&
|
||||
other.id == this.id &&
|
||||
other.data == this.data &&
|
||||
other.lastUpdate == this.lastUpdate);
|
||||
other.lastFetched == this.lastFetched);
|
||||
}
|
||||
|
||||
class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
|
||||
final Value<int> id;
|
||||
final Value<String> data;
|
||||
final Value<DateTime> lastUpdate;
|
||||
final Value<DateTime> lastFetched;
|
||||
final Value<int> rowid;
|
||||
const IngredientsCompanion({
|
||||
this.id = const Value.absent(),
|
||||
this.data = const Value.absent(),
|
||||
this.lastUpdate = const Value.absent(),
|
||||
this.lastFetched = const Value.absent(),
|
||||
this.rowid = const Value.absent(),
|
||||
});
|
||||
IngredientsCompanion.insert({
|
||||
required int id,
|
||||
required String data,
|
||||
required DateTime lastUpdate,
|
||||
required DateTime lastFetched,
|
||||
this.rowid = const Value.absent(),
|
||||
}) : id = Value(id),
|
||||
data = Value(data),
|
||||
lastUpdate = Value(lastUpdate);
|
||||
lastFetched = Value(lastFetched);
|
||||
static Insertable<IngredientTable> custom({
|
||||
Expression<int>? id,
|
||||
Expression<String>? data,
|
||||
Expression<DateTime>? lastUpdate,
|
||||
Expression<DateTime>? lastFetched,
|
||||
Expression<int>? rowid,
|
||||
}) {
|
||||
return RawValuesInsertable({
|
||||
if (id != null) 'id': id,
|
||||
if (data != null) 'data': data,
|
||||
if (lastUpdate != null) 'last_update': lastUpdate,
|
||||
if (lastFetched != null) 'last_fetched': lastFetched,
|
||||
if (rowid != null) 'rowid': rowid,
|
||||
});
|
||||
}
|
||||
@@ -194,12 +194,12 @@ class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
|
||||
IngredientsCompanion copyWith(
|
||||
{Value<int>? id,
|
||||
Value<String>? data,
|
||||
Value<DateTime>? lastUpdate,
|
||||
Value<DateTime>? lastFetched,
|
||||
Value<int>? rowid}) {
|
||||
return IngredientsCompanion(
|
||||
id: id ?? this.id,
|
||||
data: data ?? this.data,
|
||||
lastUpdate: lastUpdate ?? this.lastUpdate,
|
||||
lastFetched: lastFetched ?? this.lastFetched,
|
||||
rowid: rowid ?? this.rowid,
|
||||
);
|
||||
}
|
||||
@@ -213,8 +213,8 @@ class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
|
||||
if (data.present) {
|
||||
map['data'] = Variable<String>(data.value);
|
||||
}
|
||||
if (lastUpdate.present) {
|
||||
map['last_update'] = Variable<DateTime>(lastUpdate.value);
|
||||
if (lastFetched.present) {
|
||||
map['last_fetched'] = Variable<DateTime>(lastFetched.value);
|
||||
}
|
||||
if (rowid.present) {
|
||||
map['rowid'] = Variable<int>(rowid.value);
|
||||
@@ -227,7 +227,7 @@ class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
|
||||
return (StringBuffer('IngredientsCompanion(')
|
||||
..write('id: $id, ')
|
||||
..write('data: $data, ')
|
||||
..write('lastUpdate: $lastUpdate, ')
|
||||
..write('lastFetched: $lastFetched, ')
|
||||
..write('rowid: $rowid')
|
||||
..write(')'))
|
||||
.toString();
|
||||
@@ -249,14 +249,14 @@ typedef $$IngredientsTableCreateCompanionBuilder = IngredientsCompanion
|
||||
Function({
|
||||
required int id,
|
||||
required String data,
|
||||
required DateTime lastUpdate,
|
||||
required DateTime lastFetched,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $$IngredientsTableUpdateCompanionBuilder = IngredientsCompanion
|
||||
Function({
|
||||
Value<int> id,
|
||||
Value<String> data,
|
||||
Value<DateTime> lastUpdate,
|
||||
Value<DateTime> lastFetched,
|
||||
Value<int> rowid,
|
||||
});
|
||||
|
||||
@@ -280,25 +280,25 @@ class $$IngredientsTableTableManager extends RootTableManager<
|
||||
updateCompanionCallback: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
Value<String> data = const Value.absent(),
|
||||
Value<DateTime> lastUpdate = const Value.absent(),
|
||||
Value<DateTime> lastFetched = const Value.absent(),
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
IngredientsCompanion(
|
||||
id: id,
|
||||
data: data,
|
||||
lastUpdate: lastUpdate,
|
||||
lastFetched: lastFetched,
|
||||
rowid: rowid,
|
||||
),
|
||||
createCompanionCallback: ({
|
||||
required int id,
|
||||
required String data,
|
||||
required DateTime lastUpdate,
|
||||
required DateTime lastFetched,
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
IngredientsCompanion.insert(
|
||||
id: id,
|
||||
data: data,
|
||||
lastUpdate: lastUpdate,
|
||||
lastFetched: lastFetched,
|
||||
rowid: rowid,
|
||||
),
|
||||
));
|
||||
@@ -317,8 +317,8 @@ class $$IngredientsTableFilterComposer
|
||||
builder: (column, joinBuilders) =>
|
||||
ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnFilters<DateTime> get lastUpdate => $state.composableBuilder(
|
||||
column: $state.table.lastUpdate,
|
||||
ColumnFilters<DateTime> get lastFetched => $state.composableBuilder(
|
||||
column: $state.table.lastFetched,
|
||||
builder: (column, joinBuilders) =>
|
||||
ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
@@ -336,8 +336,8 @@ class $$IngredientsTableOrderingComposer
|
||||
builder: (column, joinBuilders) =>
|
||||
ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnOrderings<DateTime> get lastUpdate => $state.composableBuilder(
|
||||
column: $state.table.lastUpdate,
|
||||
ColumnOrderings<DateTime> get lastFetched => $state.composableBuilder(
|
||||
column: $state.table.lastFetched,
|
||||
builder: (column, joinBuilders) =>
|
||||
ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ class NutritionPlansProvider with ChangeNotifier {
|
||||
|
||||
// Prune old entries
|
||||
if (DateTime.now()
|
||||
.isAfter(ingredientDb.lastUpdate.add(const Duration(days: DAYS_TO_CACHE)))) {
|
||||
.isAfter(ingredientDb.lastFetched.add(const Duration(days: DAYS_TO_CACHE)))) {
|
||||
(database.delete(database.ingredients)..where((i) => i.id.isValue(ingredientId))).go();
|
||||
}
|
||||
} else {
|
||||
@@ -329,7 +329,7 @@ class NutritionPlansProvider with ChangeNotifier {
|
||||
IngredientsCompanion.insert(
|
||||
id: ingredientId,
|
||||
data: jsonEncode(data),
|
||||
lastUpdate: DateTime.now(),
|
||||
lastFetched: DateTime.now(),
|
||||
),
|
||||
);
|
||||
log("Saved ingredient '${ingredient.name}' to db cache");
|
||||
|
||||
@@ -3,17 +3,18 @@
|
||||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i8;
|
||||
import 'dart:ui' as _i10;
|
||||
import 'dart:async' as _i9;
|
||||
import 'dart:ui' as _i11;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:wger/models/exercises/ingredient_api.dart' as _i9;
|
||||
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/database/ingredients/ingredients_database.dart' as _i3;
|
||||
import 'package:wger/models/exercises/ingredient_api.dart' as _i10;
|
||||
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/base_provider.dart' as _i2;
|
||||
import 'package:wger/providers/nutrition.dart' as _i7;
|
||||
import 'package:wger/providers/nutrition.dart' as _i8;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
@@ -39,9 +40,9 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeNutritionalPlan_1 extends _i1.SmartFake
|
||||
implements _i3.NutritionalPlan {
|
||||
_FakeNutritionalPlan_1(
|
||||
class _FakeIngredientDatabase_1 extends _i1.SmartFake
|
||||
implements _i3.IngredientDatabase {
|
||||
_FakeIngredientDatabase_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -50,8 +51,9 @@ class _FakeNutritionalPlan_1 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMeal_2 extends _i1.SmartFake implements _i4.Meal {
|
||||
_FakeMeal_2(
|
||||
class _FakeNutritionalPlan_2 extends _i1.SmartFake
|
||||
implements _i4.NutritionalPlan {
|
||||
_FakeNutritionalPlan_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -60,8 +62,8 @@ class _FakeMeal_2 extends _i1.SmartFake implements _i4.Meal {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMealItem_3 extends _i1.SmartFake implements _i5.MealItem {
|
||||
_FakeMealItem_3(
|
||||
class _FakeMeal_3 extends _i1.SmartFake implements _i5.Meal {
|
||||
_FakeMeal_3(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -70,8 +72,18 @@ class _FakeMealItem_3 extends _i1.SmartFake implements _i5.MealItem {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeIngredient_4 extends _i1.SmartFake implements _i6.Ingredient {
|
||||
_FakeIngredient_4(
|
||||
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(
|
||||
@@ -84,7 +96,7 @@ class _FakeIngredient_4 extends _i1.SmartFake implements _i6.Ingredient {
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockNutritionPlansProvider extends _i1.Mock
|
||||
implements _i7.NutritionPlansProvider {
|
||||
implements _i8.NutritionPlansProvider {
|
||||
MockNutritionPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -99,10 +111,28 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i3.NutritionalPlan> get items => (super.noSuchMethod(
|
||||
_i3.IngredientDatabase get database => (super.noSuchMethod(
|
||||
Invocation.getter(#database),
|
||||
returnValue: _FakeIngredientDatabase_1(
|
||||
this,
|
||||
Invocation.getter(#database),
|
||||
),
|
||||
) as _i3.IngredientDatabase);
|
||||
|
||||
@override
|
||||
set database(_i3.IngredientDatabase? _database) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#database,
|
||||
_database,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i4.NutritionalPlan> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i3.NutritionalPlan>[],
|
||||
) as List<_i3.NutritionalPlan>);
|
||||
returnValue: <_i4.NutritionalPlan>[],
|
||||
) as List<_i4.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
set ingredients(dynamic items) => super.noSuchMethod(
|
||||
@@ -129,120 +159,120 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.NutritionalPlan findById(int? id) => (super.noSuchMethod(
|
||||
_i4.NutritionalPlan findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _FakeNutritionalPlan_1(
|
||||
returnValue: _FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
),
|
||||
) as _i3.NutritionalPlan);
|
||||
) as _i4.NutritionalPlan);
|
||||
|
||||
@override
|
||||
_i4.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(
|
||||
_i5.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(
|
||||
#findMealById,
|
||||
[id],
|
||||
)) as _i4.Meal?);
|
||||
)) as _i5.Meal?);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
|
||||
_i9.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetAllPlansSparse,
|
||||
[],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
|
||||
_i9.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetAllPlansFull,
|
||||
[],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
returnValue:
|
||||
_i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
[planId],
|
||||
),
|
||||
returnValue:
|
||||
_i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
[planId],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i3.NutritionalPlan> addPlan(_i3.NutritionalPlan? planData) =>
|
||||
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
[planData],
|
||||
),
|
||||
returnValue:
|
||||
_i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
[planData],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> editPlan(_i3.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
_i9.Future<void> editPlan(_i4.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#editPlan,
|
||||
[plan],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deletePlan(int? id) => (super.noSuchMethod(
|
||||
_i9.Future<void> deletePlan(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deletePlan,
|
||||
[id],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i4.Meal> addMeal(
|
||||
_i4.Meal? meal,
|
||||
_i9.Future<_i5.Meal> addMeal(
|
||||
_i5.Meal? meal,
|
||||
int? planId,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
@@ -253,7 +283,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
planId,
|
||||
],
|
||||
),
|
||||
returnValue: _i8.Future<_i4.Meal>.value(_FakeMeal_2(
|
||||
returnValue: _i9.Future<_i5.Meal>.value(_FakeMeal_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addMeal,
|
||||
@@ -263,37 +293,37 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i4.Meal>);
|
||||
) as _i9.Future<_i5.Meal>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i4.Meal> editMeal(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
_i9.Future<_i5.Meal> editMeal(_i5.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#editMeal,
|
||||
[meal],
|
||||
),
|
||||
returnValue: _i8.Future<_i4.Meal>.value(_FakeMeal_2(
|
||||
returnValue: _i9.Future<_i5.Meal>.value(_FakeMeal_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#editMeal,
|
||||
[meal],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i4.Meal>);
|
||||
) as _i9.Future<_i5.Meal>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deleteMeal(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
_i9.Future<void> deleteMeal(_i5.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteMeal,
|
||||
[meal],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i5.MealItem> addMealItem(
|
||||
_i5.MealItem? mealItem,
|
||||
_i4.Meal? meal,
|
||||
_i9.Future<_i6.MealItem> addMealItem(
|
||||
_i6.MealItem? mealItem,
|
||||
_i5.Meal? meal,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -303,7 +333,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
meal,
|
||||
],
|
||||
),
|
||||
returnValue: _i8.Future<_i5.MealItem>.value(_FakeMealItem_3(
|
||||
returnValue: _i9.Future<_i6.MealItem>.value(_FakeMealItem_4(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addMealItem,
|
||||
@@ -313,47 +343,57 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i5.MealItem>);
|
||||
) as _i9.Future<_i6.MealItem>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deleteMealItem(_i5.MealItem? mealItem) =>
|
||||
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteMealItem,
|
||||
[mealItem],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i6.Ingredient> fetchIngredient(int? ingredientId) =>
|
||||
_i9.Future<void> clearIngredientCaches() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#clearIngredientCaches,
|
||||
[],
|
||||
),
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i9.Future<_i7.Ingredient> fetchIngredient(int? ingredientId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchIngredient,
|
||||
[ingredientId],
|
||||
),
|
||||
returnValue: _i8.Future<_i6.Ingredient>.value(_FakeIngredient_4(
|
||||
returnValue: _i9.Future<_i7.Ingredient>.value(_FakeIngredient_5(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchIngredient,
|
||||
[ingredientId],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i6.Ingredient>);
|
||||
) as _i9.Future<_i7.Ingredient>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchIngredientsFromCache() => (super.noSuchMethod(
|
||||
_i9.Future<void> fetchIngredientsFromCache() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchIngredientsFromCache,
|
||||
[],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<List<_i9.IngredientApiSearchEntry>> searchIngredient(
|
||||
_i9.Future<List<_i10.IngredientApiSearchEntry>> searchIngredient(
|
||||
String? name, {
|
||||
String? languageCode = r'en',
|
||||
bool? searchEnglish = false,
|
||||
@@ -367,33 +407,33 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
#searchEnglish: searchEnglish,
|
||||
},
|
||||
),
|
||||
returnValue: _i8.Future<List<_i9.IngredientApiSearchEntry>>.value(
|
||||
<_i9.IngredientApiSearchEntry>[]),
|
||||
) as _i8.Future<List<_i9.IngredientApiSearchEntry>>);
|
||||
returnValue: _i9.Future<List<_i10.IngredientApiSearchEntry>>.value(
|
||||
<_i10.IngredientApiSearchEntry>[]),
|
||||
) as _i9.Future<List<_i10.IngredientApiSearchEntry>>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i6.Ingredient?> searchIngredientWithCode(String? code) =>
|
||||
_i9.Future<_i7.Ingredient?> searchIngredientWithCode(String? code) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchIngredientWithCode,
|
||||
[code],
|
||||
),
|
||||
returnValue: _i8.Future<_i6.Ingredient?>.value(),
|
||||
) as _i8.Future<_i6.Ingredient?>);
|
||||
returnValue: _i9.Future<_i7.Ingredient?>.value(),
|
||||
) as _i9.Future<_i7.Ingredient?>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> logMealToDiary(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
_i9.Future<void> logMealToDiary(_i5.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#logMealToDiary,
|
||||
[meal],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> logIngredientToDiary(
|
||||
_i5.MealItem? mealItem,
|
||||
_i9.Future<void> logIngredientToDiary(
|
||||
_i6.MealItem? mealItem,
|
||||
int? planId, [
|
||||
DateTime? dateTime,
|
||||
]) =>
|
||||
@@ -406,12 +446,12 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
dateTime,
|
||||
],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deleteLog(
|
||||
_i9.Future<void> deleteLog(
|
||||
int? logId,
|
||||
int? planId,
|
||||
) =>
|
||||
@@ -423,23 +463,23 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
planId,
|
||||
],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchAndSetLogs(_i3.NutritionalPlan? plan) =>
|
||||
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLogs,
|
||||
[plan],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
void addListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
void addListener(_i11.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addListener,
|
||||
[listener],
|
||||
@@ -448,7 +488,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
void removeListener(_i11.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#removeListener,
|
||||
[listener],
|
||||
|
||||
@@ -3,17 +3,18 @@
|
||||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i8;
|
||||
import 'dart:ui' as _i10;
|
||||
import 'dart:async' as _i9;
|
||||
import 'dart:ui' as _i11;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:wger/models/exercises/ingredient_api.dart' as _i9;
|
||||
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/database/ingredients/ingredients_database.dart' as _i3;
|
||||
import 'package:wger/models/exercises/ingredient_api.dart' as _i10;
|
||||
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/base_provider.dart' as _i2;
|
||||
import 'package:wger/providers/nutrition.dart' as _i7;
|
||||
import 'package:wger/providers/nutrition.dart' as _i8;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
@@ -39,9 +40,9 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeNutritionalPlan_1 extends _i1.SmartFake
|
||||
implements _i3.NutritionalPlan {
|
||||
_FakeNutritionalPlan_1(
|
||||
class _FakeIngredientDatabase_1 extends _i1.SmartFake
|
||||
implements _i3.IngredientDatabase {
|
||||
_FakeIngredientDatabase_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -50,8 +51,9 @@ class _FakeNutritionalPlan_1 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMeal_2 extends _i1.SmartFake implements _i4.Meal {
|
||||
_FakeMeal_2(
|
||||
class _FakeNutritionalPlan_2 extends _i1.SmartFake
|
||||
implements _i4.NutritionalPlan {
|
||||
_FakeNutritionalPlan_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -60,8 +62,8 @@ class _FakeMeal_2 extends _i1.SmartFake implements _i4.Meal {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMealItem_3 extends _i1.SmartFake implements _i5.MealItem {
|
||||
_FakeMealItem_3(
|
||||
class _FakeMeal_3 extends _i1.SmartFake implements _i5.Meal {
|
||||
_FakeMeal_3(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -70,8 +72,18 @@ class _FakeMealItem_3 extends _i1.SmartFake implements _i5.MealItem {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeIngredient_4 extends _i1.SmartFake implements _i6.Ingredient {
|
||||
_FakeIngredient_4(
|
||||
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(
|
||||
@@ -84,7 +96,7 @@ class _FakeIngredient_4 extends _i1.SmartFake implements _i6.Ingredient {
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockNutritionPlansProvider extends _i1.Mock
|
||||
implements _i7.NutritionPlansProvider {
|
||||
implements _i8.NutritionPlansProvider {
|
||||
MockNutritionPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -99,10 +111,28 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i3.NutritionalPlan> get items => (super.noSuchMethod(
|
||||
_i3.IngredientDatabase get database => (super.noSuchMethod(
|
||||
Invocation.getter(#database),
|
||||
returnValue: _FakeIngredientDatabase_1(
|
||||
this,
|
||||
Invocation.getter(#database),
|
||||
),
|
||||
) as _i3.IngredientDatabase);
|
||||
|
||||
@override
|
||||
set database(_i3.IngredientDatabase? _database) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#database,
|
||||
_database,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i4.NutritionalPlan> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i3.NutritionalPlan>[],
|
||||
) as List<_i3.NutritionalPlan>);
|
||||
returnValue: <_i4.NutritionalPlan>[],
|
||||
) as List<_i4.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
set ingredients(dynamic items) => super.noSuchMethod(
|
||||
@@ -129,120 +159,120 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.NutritionalPlan findById(int? id) => (super.noSuchMethod(
|
||||
_i4.NutritionalPlan findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _FakeNutritionalPlan_1(
|
||||
returnValue: _FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#findById,
|
||||
[id],
|
||||
),
|
||||
),
|
||||
) as _i3.NutritionalPlan);
|
||||
) as _i4.NutritionalPlan);
|
||||
|
||||
@override
|
||||
_i4.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(
|
||||
_i5.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(
|
||||
#findMealById,
|
||||
[id],
|
||||
)) as _i4.Meal?);
|
||||
)) as _i5.Meal?);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
|
||||
_i9.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetAllPlansSparse,
|
||||
[],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
|
||||
_i9.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetAllPlansFull,
|
||||
[],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
returnValue:
|
||||
_i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
|
||||
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
[planId],
|
||||
),
|
||||
returnValue:
|
||||
_i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
[planId],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i3.NutritionalPlan> addPlan(_i3.NutritionalPlan? planData) =>
|
||||
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
[planData],
|
||||
),
|
||||
returnValue:
|
||||
_i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
[planData],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
) as _i9.Future<_i4.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> editPlan(_i3.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
_i9.Future<void> editPlan(_i4.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#editPlan,
|
||||
[plan],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deletePlan(int? id) => (super.noSuchMethod(
|
||||
_i9.Future<void> deletePlan(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deletePlan,
|
||||
[id],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i4.Meal> addMeal(
|
||||
_i4.Meal? meal,
|
||||
_i9.Future<_i5.Meal> addMeal(
|
||||
_i5.Meal? meal,
|
||||
int? planId,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
@@ -253,7 +283,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
planId,
|
||||
],
|
||||
),
|
||||
returnValue: _i8.Future<_i4.Meal>.value(_FakeMeal_2(
|
||||
returnValue: _i9.Future<_i5.Meal>.value(_FakeMeal_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addMeal,
|
||||
@@ -263,37 +293,37 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i4.Meal>);
|
||||
) as _i9.Future<_i5.Meal>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i4.Meal> editMeal(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
_i9.Future<_i5.Meal> editMeal(_i5.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#editMeal,
|
||||
[meal],
|
||||
),
|
||||
returnValue: _i8.Future<_i4.Meal>.value(_FakeMeal_2(
|
||||
returnValue: _i9.Future<_i5.Meal>.value(_FakeMeal_3(
|
||||
this,
|
||||
Invocation.method(
|
||||
#editMeal,
|
||||
[meal],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i4.Meal>);
|
||||
) as _i9.Future<_i5.Meal>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deleteMeal(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
_i9.Future<void> deleteMeal(_i5.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteMeal,
|
||||
[meal],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i5.MealItem> addMealItem(
|
||||
_i5.MealItem? mealItem,
|
||||
_i4.Meal? meal,
|
||||
_i9.Future<_i6.MealItem> addMealItem(
|
||||
_i6.MealItem? mealItem,
|
||||
_i5.Meal? meal,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -303,7 +333,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
meal,
|
||||
],
|
||||
),
|
||||
returnValue: _i8.Future<_i5.MealItem>.value(_FakeMealItem_3(
|
||||
returnValue: _i9.Future<_i6.MealItem>.value(_FakeMealItem_4(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addMealItem,
|
||||
@@ -313,47 +343,57 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i5.MealItem>);
|
||||
) as _i9.Future<_i6.MealItem>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deleteMealItem(_i5.MealItem? mealItem) =>
|
||||
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteMealItem,
|
||||
[mealItem],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i6.Ingredient> fetchIngredient(int? ingredientId) =>
|
||||
_i9.Future<void> clearIngredientCaches() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#clearIngredientCaches,
|
||||
[],
|
||||
),
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i9.Future<_i7.Ingredient> fetchIngredient(int? ingredientId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchIngredient,
|
||||
[ingredientId],
|
||||
),
|
||||
returnValue: _i8.Future<_i6.Ingredient>.value(_FakeIngredient_4(
|
||||
returnValue: _i9.Future<_i7.Ingredient>.value(_FakeIngredient_5(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchIngredient,
|
||||
[ingredientId],
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i6.Ingredient>);
|
||||
) as _i9.Future<_i7.Ingredient>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchIngredientsFromCache() => (super.noSuchMethod(
|
||||
_i9.Future<void> fetchIngredientsFromCache() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchIngredientsFromCache,
|
||||
[],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<List<_i9.IngredientApiSearchEntry>> searchIngredient(
|
||||
_i9.Future<List<_i10.IngredientApiSearchEntry>> searchIngredient(
|
||||
String? name, {
|
||||
String? languageCode = r'en',
|
||||
bool? searchEnglish = false,
|
||||
@@ -367,33 +407,33 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
#searchEnglish: searchEnglish,
|
||||
},
|
||||
),
|
||||
returnValue: _i8.Future<List<_i9.IngredientApiSearchEntry>>.value(
|
||||
<_i9.IngredientApiSearchEntry>[]),
|
||||
) as _i8.Future<List<_i9.IngredientApiSearchEntry>>);
|
||||
returnValue: _i9.Future<List<_i10.IngredientApiSearchEntry>>.value(
|
||||
<_i10.IngredientApiSearchEntry>[]),
|
||||
) as _i9.Future<List<_i10.IngredientApiSearchEntry>>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i6.Ingredient?> searchIngredientWithCode(String? code) =>
|
||||
_i9.Future<_i7.Ingredient?> searchIngredientWithCode(String? code) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchIngredientWithCode,
|
||||
[code],
|
||||
),
|
||||
returnValue: _i8.Future<_i6.Ingredient?>.value(),
|
||||
) as _i8.Future<_i6.Ingredient?>);
|
||||
returnValue: _i9.Future<_i7.Ingredient?>.value(),
|
||||
) as _i9.Future<_i7.Ingredient?>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> logMealToDiary(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
_i9.Future<void> logMealToDiary(_i5.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#logMealToDiary,
|
||||
[meal],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> logIngredientToDiary(
|
||||
_i5.MealItem? mealItem,
|
||||
_i9.Future<void> logIngredientToDiary(
|
||||
_i6.MealItem? mealItem,
|
||||
int? planId, [
|
||||
DateTime? dateTime,
|
||||
]) =>
|
||||
@@ -406,12 +446,12 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
dateTime,
|
||||
],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deleteLog(
|
||||
_i9.Future<void> deleteLog(
|
||||
int? logId,
|
||||
int? planId,
|
||||
) =>
|
||||
@@ -423,23 +463,23 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
planId,
|
||||
],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchAndSetLogs(_i3.NutritionalPlan? plan) =>
|
||||
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLogs,
|
||||
[plan],
|
||||
),
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
returnValue: _i9.Future<void>.value(),
|
||||
returnValueForMissingStub: _i9.Future<void>.value(),
|
||||
) as _i9.Future<void>);
|
||||
|
||||
@override
|
||||
void addListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
void addListener(_i11.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addListener,
|
||||
[listener],
|
||||
@@ -448,7 +488,7 @@ class MockNutritionPlansProvider extends _i1.Mock
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
void removeListener(_i11.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#removeListener,
|
||||
[listener],
|
||||
|
||||
Reference in New Issue
Block a user