mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Consistently use "fibers" instead of "fibres"
This commit is contained in:
@@ -954,6 +954,7 @@ class LanguagesCompanion extends UpdateCompanion<LanguagesTable> {
|
||||
|
||||
abstract class _$ExerciseDatabase extends GeneratedDatabase {
|
||||
_$ExerciseDatabase(QueryExecutor e) : super(e);
|
||||
_$ExerciseDatabaseManager get managers => _$ExerciseDatabaseManager(this);
|
||||
late final $ExercisesTable exercises = $ExercisesTable(this);
|
||||
late final $MusclesTable muscles = $MusclesTable(this);
|
||||
late final $EquipmentsTable equipments = $EquipmentsTable(this);
|
||||
@@ -966,3 +967,472 @@ abstract class _$ExerciseDatabase extends GeneratedDatabase {
|
||||
List<DatabaseSchemaEntity> get allSchemaEntities =>
|
||||
[exercises, muscles, equipments, categories, languages];
|
||||
}
|
||||
|
||||
typedef $$ExercisesTableInsertCompanionBuilder = ExercisesCompanion Function({
|
||||
required int id,
|
||||
required String data,
|
||||
required DateTime lastUpdate,
|
||||
required DateTime lastFetched,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $$ExercisesTableUpdateCompanionBuilder = ExercisesCompanion Function({
|
||||
Value<int> id,
|
||||
Value<String> data,
|
||||
Value<DateTime> lastUpdate,
|
||||
Value<DateTime> lastFetched,
|
||||
Value<int> rowid,
|
||||
});
|
||||
|
||||
class $$ExercisesTableTableManager extends RootTableManager<
|
||||
_$ExerciseDatabase,
|
||||
$ExercisesTable,
|
||||
ExerciseTable,
|
||||
$$ExercisesTableFilterComposer,
|
||||
$$ExercisesTableOrderingComposer,
|
||||
$$ExercisesTableProcessedTableManager,
|
||||
$$ExercisesTableInsertCompanionBuilder,
|
||||
$$ExercisesTableUpdateCompanionBuilder> {
|
||||
$$ExercisesTableTableManager(_$ExerciseDatabase db, $ExercisesTable table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
filteringComposer: $$ExercisesTableFilterComposer(ComposerState(db, table)),
|
||||
orderingComposer: $$ExercisesTableOrderingComposer(ComposerState(db, table)),
|
||||
getChildManagerBuilder: (p) => $$ExercisesTableProcessedTableManager(p),
|
||||
getUpdateCompanionBuilder: ({
|
||||
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(),
|
||||
}) =>
|
||||
ExercisesCompanion(
|
||||
id: id,
|
||||
data: data,
|
||||
lastUpdate: lastUpdate,
|
||||
lastFetched: lastFetched,
|
||||
rowid: rowid,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
required int id,
|
||||
required String data,
|
||||
required DateTime lastUpdate,
|
||||
required DateTime lastFetched,
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
ExercisesCompanion.insert(
|
||||
id: id,
|
||||
data: data,
|
||||
lastUpdate: lastUpdate,
|
||||
lastFetched: lastFetched,
|
||||
rowid: rowid,
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
class $$ExercisesTableProcessedTableManager extends ProcessedTableManager<
|
||||
_$ExerciseDatabase,
|
||||
$ExercisesTable,
|
||||
ExerciseTable,
|
||||
$$ExercisesTableFilterComposer,
|
||||
$$ExercisesTableOrderingComposer,
|
||||
$$ExercisesTableProcessedTableManager,
|
||||
$$ExercisesTableInsertCompanionBuilder,
|
||||
$$ExercisesTableUpdateCompanionBuilder> {
|
||||
$$ExercisesTableProcessedTableManager(super.$state);
|
||||
}
|
||||
|
||||
class $$ExercisesTableFilterComposer extends FilterComposer<_$ExerciseDatabase, $ExercisesTable> {
|
||||
$$ExercisesTableFilterComposer(super.$state);
|
||||
ColumnFilters<int> get id => $state.composableBuilder(
|
||||
column: $state.table.id,
|
||||
builder: (column, joinBuilders) => ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnFilters<String> get data => $state.composableBuilder(
|
||||
column: $state.table.data,
|
||||
builder: (column, joinBuilders) => ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnFilters<DateTime> get lastUpdate => $state.composableBuilder(
|
||||
column: $state.table.lastUpdate,
|
||||
builder: (column, joinBuilders) => ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnFilters<DateTime> get lastFetched => $state.composableBuilder(
|
||||
column: $state.table.lastFetched,
|
||||
builder: (column, joinBuilders) => ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
class $$ExercisesTableOrderingComposer
|
||||
extends OrderingComposer<_$ExerciseDatabase, $ExercisesTable> {
|
||||
$$ExercisesTableOrderingComposer(super.$state);
|
||||
ColumnOrderings<int> get id => $state.composableBuilder(
|
||||
column: $state.table.id,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnOrderings<String> get data => $state.composableBuilder(
|
||||
column: $state.table.data,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnOrderings<DateTime> get lastUpdate => $state.composableBuilder(
|
||||
column: $state.table.lastUpdate,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnOrderings<DateTime> get lastFetched => $state.composableBuilder(
|
||||
column: $state.table.lastFetched,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
typedef $$MusclesTableInsertCompanionBuilder = MusclesCompanion Function({
|
||||
required int id,
|
||||
required Muscle data,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $$MusclesTableUpdateCompanionBuilder = MusclesCompanion Function({
|
||||
Value<int> id,
|
||||
Value<Muscle> data,
|
||||
Value<int> rowid,
|
||||
});
|
||||
|
||||
class $$MusclesTableTableManager extends RootTableManager<
|
||||
_$ExerciseDatabase,
|
||||
$MusclesTable,
|
||||
MuscleTable,
|
||||
$$MusclesTableFilterComposer,
|
||||
$$MusclesTableOrderingComposer,
|
||||
$$MusclesTableProcessedTableManager,
|
||||
$$MusclesTableInsertCompanionBuilder,
|
||||
$$MusclesTableUpdateCompanionBuilder> {
|
||||
$$MusclesTableTableManager(_$ExerciseDatabase db, $MusclesTable table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
filteringComposer: $$MusclesTableFilterComposer(ComposerState(db, table)),
|
||||
orderingComposer: $$MusclesTableOrderingComposer(ComposerState(db, table)),
|
||||
getChildManagerBuilder: (p) => $$MusclesTableProcessedTableManager(p),
|
||||
getUpdateCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
Value<Muscle> data = const Value.absent(),
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
MusclesCompanion(
|
||||
id: id,
|
||||
data: data,
|
||||
rowid: rowid,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
required int id,
|
||||
required Muscle data,
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
MusclesCompanion.insert(
|
||||
id: id,
|
||||
data: data,
|
||||
rowid: rowid,
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
class $$MusclesTableProcessedTableManager extends ProcessedTableManager<
|
||||
_$ExerciseDatabase,
|
||||
$MusclesTable,
|
||||
MuscleTable,
|
||||
$$MusclesTableFilterComposer,
|
||||
$$MusclesTableOrderingComposer,
|
||||
$$MusclesTableProcessedTableManager,
|
||||
$$MusclesTableInsertCompanionBuilder,
|
||||
$$MusclesTableUpdateCompanionBuilder> {
|
||||
$$MusclesTableProcessedTableManager(super.$state);
|
||||
}
|
||||
|
||||
class $$MusclesTableFilterComposer extends FilterComposer<_$ExerciseDatabase, $MusclesTable> {
|
||||
$$MusclesTableFilterComposer(super.$state);
|
||||
ColumnFilters<int> get id => $state.composableBuilder(
|
||||
column: $state.table.id,
|
||||
builder: (column, joinBuilders) => ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnWithTypeConverterFilters<Muscle, Muscle, String> get data => $state.composableBuilder(
|
||||
column: $state.table.data,
|
||||
builder: (column, joinBuilders) =>
|
||||
ColumnWithTypeConverterFilters(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
class $$MusclesTableOrderingComposer extends OrderingComposer<_$ExerciseDatabase, $MusclesTable> {
|
||||
$$MusclesTableOrderingComposer(super.$state);
|
||||
ColumnOrderings<int> get id => $state.composableBuilder(
|
||||
column: $state.table.id,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnOrderings<String> get data => $state.composableBuilder(
|
||||
column: $state.table.data,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
typedef $$EquipmentsTableInsertCompanionBuilder = EquipmentsCompanion Function({
|
||||
required int id,
|
||||
required Equipment data,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $$EquipmentsTableUpdateCompanionBuilder = EquipmentsCompanion Function({
|
||||
Value<int> id,
|
||||
Value<Equipment> data,
|
||||
Value<int> rowid,
|
||||
});
|
||||
|
||||
class $$EquipmentsTableTableManager extends RootTableManager<
|
||||
_$ExerciseDatabase,
|
||||
$EquipmentsTable,
|
||||
EquipmentTable,
|
||||
$$EquipmentsTableFilterComposer,
|
||||
$$EquipmentsTableOrderingComposer,
|
||||
$$EquipmentsTableProcessedTableManager,
|
||||
$$EquipmentsTableInsertCompanionBuilder,
|
||||
$$EquipmentsTableUpdateCompanionBuilder> {
|
||||
$$EquipmentsTableTableManager(_$ExerciseDatabase db, $EquipmentsTable table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
filteringComposer: $$EquipmentsTableFilterComposer(ComposerState(db, table)),
|
||||
orderingComposer: $$EquipmentsTableOrderingComposer(ComposerState(db, table)),
|
||||
getChildManagerBuilder: (p) => $$EquipmentsTableProcessedTableManager(p),
|
||||
getUpdateCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
Value<Equipment> data = const Value.absent(),
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
EquipmentsCompanion(
|
||||
id: id,
|
||||
data: data,
|
||||
rowid: rowid,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
required int id,
|
||||
required Equipment data,
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
EquipmentsCompanion.insert(
|
||||
id: id,
|
||||
data: data,
|
||||
rowid: rowid,
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
class $$EquipmentsTableProcessedTableManager extends ProcessedTableManager<
|
||||
_$ExerciseDatabase,
|
||||
$EquipmentsTable,
|
||||
EquipmentTable,
|
||||
$$EquipmentsTableFilterComposer,
|
||||
$$EquipmentsTableOrderingComposer,
|
||||
$$EquipmentsTableProcessedTableManager,
|
||||
$$EquipmentsTableInsertCompanionBuilder,
|
||||
$$EquipmentsTableUpdateCompanionBuilder> {
|
||||
$$EquipmentsTableProcessedTableManager(super.$state);
|
||||
}
|
||||
|
||||
class $$EquipmentsTableFilterComposer extends FilterComposer<_$ExerciseDatabase, $EquipmentsTable> {
|
||||
$$EquipmentsTableFilterComposer(super.$state);
|
||||
ColumnFilters<int> get id => $state.composableBuilder(
|
||||
column: $state.table.id,
|
||||
builder: (column, joinBuilders) => ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnWithTypeConverterFilters<Equipment, Equipment, String> get data => $state.composableBuilder(
|
||||
column: $state.table.data,
|
||||
builder: (column, joinBuilders) =>
|
||||
ColumnWithTypeConverterFilters(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
class $$EquipmentsTableOrderingComposer
|
||||
extends OrderingComposer<_$ExerciseDatabase, $EquipmentsTable> {
|
||||
$$EquipmentsTableOrderingComposer(super.$state);
|
||||
ColumnOrderings<int> get id => $state.composableBuilder(
|
||||
column: $state.table.id,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnOrderings<String> get data => $state.composableBuilder(
|
||||
column: $state.table.data,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
typedef $$CategoriesTableInsertCompanionBuilder = CategoriesCompanion Function({
|
||||
required int id,
|
||||
required ExerciseCategory data,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $$CategoriesTableUpdateCompanionBuilder = CategoriesCompanion Function({
|
||||
Value<int> id,
|
||||
Value<ExerciseCategory> data,
|
||||
Value<int> rowid,
|
||||
});
|
||||
|
||||
class $$CategoriesTableTableManager extends RootTableManager<
|
||||
_$ExerciseDatabase,
|
||||
$CategoriesTable,
|
||||
CategoryTable,
|
||||
$$CategoriesTableFilterComposer,
|
||||
$$CategoriesTableOrderingComposer,
|
||||
$$CategoriesTableProcessedTableManager,
|
||||
$$CategoriesTableInsertCompanionBuilder,
|
||||
$$CategoriesTableUpdateCompanionBuilder> {
|
||||
$$CategoriesTableTableManager(_$ExerciseDatabase db, $CategoriesTable table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
filteringComposer: $$CategoriesTableFilterComposer(ComposerState(db, table)),
|
||||
orderingComposer: $$CategoriesTableOrderingComposer(ComposerState(db, table)),
|
||||
getChildManagerBuilder: (p) => $$CategoriesTableProcessedTableManager(p),
|
||||
getUpdateCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
Value<ExerciseCategory> data = const Value.absent(),
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
CategoriesCompanion(
|
||||
id: id,
|
||||
data: data,
|
||||
rowid: rowid,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
required int id,
|
||||
required ExerciseCategory data,
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
CategoriesCompanion.insert(
|
||||
id: id,
|
||||
data: data,
|
||||
rowid: rowid,
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
class $$CategoriesTableProcessedTableManager extends ProcessedTableManager<
|
||||
_$ExerciseDatabase,
|
||||
$CategoriesTable,
|
||||
CategoryTable,
|
||||
$$CategoriesTableFilterComposer,
|
||||
$$CategoriesTableOrderingComposer,
|
||||
$$CategoriesTableProcessedTableManager,
|
||||
$$CategoriesTableInsertCompanionBuilder,
|
||||
$$CategoriesTableUpdateCompanionBuilder> {
|
||||
$$CategoriesTableProcessedTableManager(super.$state);
|
||||
}
|
||||
|
||||
class $$CategoriesTableFilterComposer extends FilterComposer<_$ExerciseDatabase, $CategoriesTable> {
|
||||
$$CategoriesTableFilterComposer(super.$state);
|
||||
ColumnFilters<int> get id => $state.composableBuilder(
|
||||
column: $state.table.id,
|
||||
builder: (column, joinBuilders) => ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnWithTypeConverterFilters<ExerciseCategory, ExerciseCategory, String> get data =>
|
||||
$state.composableBuilder(
|
||||
column: $state.table.data,
|
||||
builder: (column, joinBuilders) =>
|
||||
ColumnWithTypeConverterFilters(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
class $$CategoriesTableOrderingComposer
|
||||
extends OrderingComposer<_$ExerciseDatabase, $CategoriesTable> {
|
||||
$$CategoriesTableOrderingComposer(super.$state);
|
||||
ColumnOrderings<int> get id => $state.composableBuilder(
|
||||
column: $state.table.id,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnOrderings<String> get data => $state.composableBuilder(
|
||||
column: $state.table.data,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
typedef $$LanguagesTableInsertCompanionBuilder = LanguagesCompanion Function({
|
||||
required int id,
|
||||
required Language data,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $$LanguagesTableUpdateCompanionBuilder = LanguagesCompanion Function({
|
||||
Value<int> id,
|
||||
Value<Language> data,
|
||||
Value<int> rowid,
|
||||
});
|
||||
|
||||
class $$LanguagesTableTableManager extends RootTableManager<
|
||||
_$ExerciseDatabase,
|
||||
$LanguagesTable,
|
||||
LanguagesTable,
|
||||
$$LanguagesTableFilterComposer,
|
||||
$$LanguagesTableOrderingComposer,
|
||||
$$LanguagesTableProcessedTableManager,
|
||||
$$LanguagesTableInsertCompanionBuilder,
|
||||
$$LanguagesTableUpdateCompanionBuilder> {
|
||||
$$LanguagesTableTableManager(_$ExerciseDatabase db, $LanguagesTable table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
filteringComposer: $$LanguagesTableFilterComposer(ComposerState(db, table)),
|
||||
orderingComposer: $$LanguagesTableOrderingComposer(ComposerState(db, table)),
|
||||
getChildManagerBuilder: (p) => $$LanguagesTableProcessedTableManager(p),
|
||||
getUpdateCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
Value<Language> data = const Value.absent(),
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
LanguagesCompanion(
|
||||
id: id,
|
||||
data: data,
|
||||
rowid: rowid,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
required int id,
|
||||
required Language data,
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
LanguagesCompanion.insert(
|
||||
id: id,
|
||||
data: data,
|
||||
rowid: rowid,
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
class $$LanguagesTableProcessedTableManager extends ProcessedTableManager<
|
||||
_$ExerciseDatabase,
|
||||
$LanguagesTable,
|
||||
LanguagesTable,
|
||||
$$LanguagesTableFilterComposer,
|
||||
$$LanguagesTableOrderingComposer,
|
||||
$$LanguagesTableProcessedTableManager,
|
||||
$$LanguagesTableInsertCompanionBuilder,
|
||||
$$LanguagesTableUpdateCompanionBuilder> {
|
||||
$$LanguagesTableProcessedTableManager(super.$state);
|
||||
}
|
||||
|
||||
class $$LanguagesTableFilterComposer extends FilterComposer<_$ExerciseDatabase, $LanguagesTable> {
|
||||
$$LanguagesTableFilterComposer(super.$state);
|
||||
ColumnFilters<int> get id => $state.composableBuilder(
|
||||
column: $state.table.id,
|
||||
builder: (column, joinBuilders) => ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnWithTypeConverterFilters<Language, Language, String> get data => $state.composableBuilder(
|
||||
column: $state.table.data,
|
||||
builder: (column, joinBuilders) =>
|
||||
ColumnWithTypeConverterFilters(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
class $$LanguagesTableOrderingComposer
|
||||
extends OrderingComposer<_$ExerciseDatabase, $LanguagesTable> {
|
||||
$$LanguagesTableOrderingComposer(super.$state);
|
||||
ColumnOrderings<int> get id => $state.composableBuilder(
|
||||
column: $state.table.id,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnOrderings<String> get data => $state.composableBuilder(
|
||||
column: $state.table.data,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
class _$ExerciseDatabaseManager {
|
||||
final _$ExerciseDatabase _db;
|
||||
_$ExerciseDatabaseManager(this._db);
|
||||
$$ExercisesTableTableManager get exercises => $$ExercisesTableTableManager(_db, _db.exercises);
|
||||
$$MusclesTableTableManager get muscles => $$MusclesTableTableManager(_db, _db.muscles);
|
||||
$$EquipmentsTableTableManager get equipments =>
|
||||
$$EquipmentsTableTableManager(_db, _db.equipments);
|
||||
$$CategoriesTableTableManager get categories =>
|
||||
$$CategoriesTableTableManager(_db, _db.categories);
|
||||
$$LanguagesTableTableManager get languages => $$LanguagesTableTableManager(_db, _db.languages);
|
||||
}
|
||||
|
||||
@@ -212,6 +212,7 @@ class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
|
||||
|
||||
abstract class _$IngredientDatabase extends GeneratedDatabase {
|
||||
_$IngredientDatabase(QueryExecutor e) : super(e);
|
||||
_$IngredientDatabaseManager get managers => _$IngredientDatabaseManager(this);
|
||||
late final $IngredientsTable ingredients = $IngredientsTable(this);
|
||||
@override
|
||||
Iterable<TableInfo<Table, Object?>> get allTables =>
|
||||
@@ -219,3 +220,110 @@ abstract class _$IngredientDatabase extends GeneratedDatabase {
|
||||
@override
|
||||
List<DatabaseSchemaEntity> get allSchemaEntities => [ingredients];
|
||||
}
|
||||
|
||||
typedef $$IngredientsTableInsertCompanionBuilder = IngredientsCompanion Function({
|
||||
required int id,
|
||||
required String data,
|
||||
required DateTime lastUpdate,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $$IngredientsTableUpdateCompanionBuilder = IngredientsCompanion Function({
|
||||
Value<int> id,
|
||||
Value<String> data,
|
||||
Value<DateTime> lastUpdate,
|
||||
Value<int> rowid,
|
||||
});
|
||||
|
||||
class $$IngredientsTableTableManager extends RootTableManager<
|
||||
_$IngredientDatabase,
|
||||
$IngredientsTable,
|
||||
IngredientTable,
|
||||
$$IngredientsTableFilterComposer,
|
||||
$$IngredientsTableOrderingComposer,
|
||||
$$IngredientsTableProcessedTableManager,
|
||||
$$IngredientsTableInsertCompanionBuilder,
|
||||
$$IngredientsTableUpdateCompanionBuilder> {
|
||||
$$IngredientsTableTableManager(_$IngredientDatabase db, $IngredientsTable table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
filteringComposer: $$IngredientsTableFilterComposer(ComposerState(db, table)),
|
||||
orderingComposer: $$IngredientsTableOrderingComposer(ComposerState(db, table)),
|
||||
getChildManagerBuilder: (p) => $$IngredientsTableProcessedTableManager(p),
|
||||
getUpdateCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
Value<String> data = const Value.absent(),
|
||||
Value<DateTime> lastUpdate = const Value.absent(),
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
IngredientsCompanion(
|
||||
id: id,
|
||||
data: data,
|
||||
lastUpdate: lastUpdate,
|
||||
rowid: rowid,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
required int id,
|
||||
required String data,
|
||||
required DateTime lastUpdate,
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
IngredientsCompanion.insert(
|
||||
id: id,
|
||||
data: data,
|
||||
lastUpdate: lastUpdate,
|
||||
rowid: rowid,
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
class $$IngredientsTableProcessedTableManager extends ProcessedTableManager<
|
||||
_$IngredientDatabase,
|
||||
$IngredientsTable,
|
||||
IngredientTable,
|
||||
$$IngredientsTableFilterComposer,
|
||||
$$IngredientsTableOrderingComposer,
|
||||
$$IngredientsTableProcessedTableManager,
|
||||
$$IngredientsTableInsertCompanionBuilder,
|
||||
$$IngredientsTableUpdateCompanionBuilder> {
|
||||
$$IngredientsTableProcessedTableManager(super.$state);
|
||||
}
|
||||
|
||||
class $$IngredientsTableFilterComposer
|
||||
extends FilterComposer<_$IngredientDatabase, $IngredientsTable> {
|
||||
$$IngredientsTableFilterComposer(super.$state);
|
||||
ColumnFilters<int> get id => $state.composableBuilder(
|
||||
column: $state.table.id,
|
||||
builder: (column, joinBuilders) => ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnFilters<String> get data => $state.composableBuilder(
|
||||
column: $state.table.data,
|
||||
builder: (column, joinBuilders) => ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnFilters<DateTime> get lastUpdate => $state.composableBuilder(
|
||||
column: $state.table.lastUpdate,
|
||||
builder: (column, joinBuilders) => ColumnFilters(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
class $$IngredientsTableOrderingComposer
|
||||
extends OrderingComposer<_$IngredientDatabase, $IngredientsTable> {
|
||||
$$IngredientsTableOrderingComposer(super.$state);
|
||||
ColumnOrderings<int> get id => $state.composableBuilder(
|
||||
column: $state.table.id,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnOrderings<String> get data => $state.composableBuilder(
|
||||
column: $state.table.data,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
|
||||
ColumnOrderings<DateTime> get lastUpdate => $state.composableBuilder(
|
||||
column: $state.table.lastUpdate,
|
||||
builder: (column, joinBuilders) => ColumnOrderings(column, joinBuilders: joinBuilders));
|
||||
}
|
||||
|
||||
class _$IngredientDatabaseManager {
|
||||
final _$IngredientDatabase _db;
|
||||
_$IngredientDatabaseManager(this._db);
|
||||
$$IngredientsTableTableManager get ingredients =>
|
||||
$$IngredientsTableTableManager(_db, _db.ingredients);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ WeightEntry _$WeightEntryFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'weight', 'date'],
|
||||
);
|
||||
return WeightEntry(
|
||||
id: json['id'] as int?,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
weight: stringToNum(json['weight'] as String?),
|
||||
date: json['date'] == null ? null : DateTime.parse(json['date'] as String),
|
||||
);
|
||||
|
||||
@@ -12,8 +12,8 @@ Alias _$AliasFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'alias'],
|
||||
);
|
||||
return Alias(
|
||||
id: json['id'] as int?,
|
||||
exerciseId: json['exercise'] as int?,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
exerciseId: (json['exercise'] as num?)?.toInt(),
|
||||
alias: json['alias'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ ExerciseCategory _$ExerciseCategoryFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'name'],
|
||||
);
|
||||
return ExerciseCategory(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ Comment _$CommentFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'comment'],
|
||||
);
|
||||
return Comment(
|
||||
id: json['id'] as int,
|
||||
exerciseId: json['exercise'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
exerciseId: (json['exercise'] as num).toInt(),
|
||||
comment: json['comment'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ Equipment _$EquipmentFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'name'],
|
||||
);
|
||||
return Equipment(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ Exercise _$ExerciseFromJson(Map<String, dynamic> json) {
|
||||
],
|
||||
);
|
||||
return Exercise(
|
||||
id: json['id'] as int?,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
uuid: json['uuid'] as String?,
|
||||
created: json['created'] == null ? null : DateTime.parse(json['created'] as String),
|
||||
lastUpdate: json['last_update'] == null ? null : DateTime.parse(json['last_update'] as String),
|
||||
lastUpdateGlobal: json['last_update_global'] == null
|
||||
? null
|
||||
: DateTime.parse(json['last_update_global'] as String),
|
||||
variationId: json['variations'] as int?,
|
||||
variationId: (json['variations'] as num?)?.toInt(),
|
||||
translations: (json['translations'] as List<dynamic>?)
|
||||
?.map((e) => Translation.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
@@ -38,11 +38,11 @@ Exercise _$ExerciseFromJson(Map<String, dynamic> json) {
|
||||
? null
|
||||
: ExerciseCategory.fromJson(json['categories'] as Map<String, dynamic>),
|
||||
)
|
||||
..categoryId = json['category'] as int
|
||||
..musclesIds = (json['muscles'] as List<dynamic>).map((e) => e as int).toList()
|
||||
..categoryId = (json['category'] as num).toInt()
|
||||
..musclesIds = (json['muscles'] as List<dynamic>).map((e) => (e as num).toInt()).toList()
|
||||
..musclesSecondaryIds =
|
||||
(json['muscles_secondary'] as List<dynamic>).map((e) => e as int).toList()
|
||||
..equipmentIds = (json['equipment'] as List<dynamic>).map((e) => e as int).toList();
|
||||
(json['muscles_secondary'] as List<dynamic>).map((e) => (e as num).toInt()).toList()
|
||||
..equipmentIds = (json['equipment'] as List<dynamic>).map((e) => (e as num).toInt()).toList();
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$ExerciseToJson(Exercise instance) => <String, dynamic>{
|
||||
|
||||
@@ -8,9 +8,9 @@ part of 'exercise_api.dart';
|
||||
|
||||
_$ExerciseBaseDataImpl _$$ExerciseBaseDataImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ExerciseBaseDataImpl(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
uuid: json['uuid'] as String,
|
||||
variationId: json['variations'] as int? ?? null,
|
||||
variationId: (json['variations'] as num?)?.toInt() ?? null,
|
||||
created: DateTime.parse(json['created'] as String),
|
||||
lastUpdate: DateTime.parse(json['last_update'] as String),
|
||||
lastUpdateGlobal: DateTime.parse(json['last_update_global'] as String),
|
||||
@@ -59,8 +59,8 @@ Map<String, dynamic> _$$ExerciseBaseDataImplToJson(_$ExerciseBaseDataImpl instan
|
||||
|
||||
_$ExerciseSearchDetailsImpl _$$ExerciseSearchDetailsImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ExerciseSearchDetailsImpl(
|
||||
translationId: json['id'] as int,
|
||||
exerciseId: json['base_id'] as int,
|
||||
translationId: (json['id'] as num).toInt(),
|
||||
exerciseId: (json['base_id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
category: json['category'] as String,
|
||||
image: json['image'] as String?,
|
||||
|
||||
@@ -12,9 +12,9 @@ ExerciseImage _$ExerciseImageFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'uuid', 'exercise_base', 'image'],
|
||||
);
|
||||
return ExerciseImage(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
uuid: json['uuid'] as String,
|
||||
exerciseBaseId: json['exercise_base'] as int,
|
||||
exerciseBaseId: (json['exercise_base'] as num).toInt(),
|
||||
url: json['image'] as String,
|
||||
isMain: json['is_main'] as bool? ?? false,
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@ part of 'ingredient_api.dart';
|
||||
_$IngredientApiSearchDetailsImpl _$$IngredientApiSearchDetailsImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$IngredientApiSearchDetailsImpl(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
image: json['image'] as String?,
|
||||
imageThumbnail: json['image_thumbnail'] as String?,
|
||||
|
||||
@@ -12,7 +12,7 @@ Language _$LanguageFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'short_name', 'full_name'],
|
||||
);
|
||||
return Language(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
shortName: json['short_name'] as String,
|
||||
fullName: json['full_name'] as String,
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ Muscle _$MuscleFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'name', 'name_en', 'is_front'],
|
||||
);
|
||||
return Muscle(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
nameEn: json['name_en'] as String,
|
||||
isFront: json['is_front'] as bool,
|
||||
|
||||
@@ -20,14 +20,14 @@ Translation _$TranslationFromJson(Map<String, dynamic> json) {
|
||||
],
|
||||
);
|
||||
return Translation(
|
||||
id: json['id'] as int?,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
uuid: json['uuid'] as String?,
|
||||
created: json['created'] == null ? null : DateTime.parse(json['created'] as String),
|
||||
name: json['name'] as String,
|
||||
description: json['description'] as String,
|
||||
exerciseId: json['exercise_base'] as int?,
|
||||
exerciseId: (json['exercise_base'] as num?)?.toInt(),
|
||||
)
|
||||
..languageId = json['language'] as int
|
||||
..languageId = (json['language'] as num).toInt()
|
||||
..notes = (json['notes'] as List<dynamic>)
|
||||
.map((e) => Comment.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
|
||||
@@ -12,7 +12,7 @@ Variation _$VariationFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id'],
|
||||
);
|
||||
return Variation(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,17 +25,17 @@ Video _$VideoFromJson(Map<String, dynamic> json) {
|
||||
],
|
||||
);
|
||||
return Video(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
uuid: json['uuid'] as String,
|
||||
base: json['exercise_base'] as int,
|
||||
size: json['size'] as int,
|
||||
base: (json['exercise_base'] as num).toInt(),
|
||||
size: (json['size'] as num).toInt(),
|
||||
url: json['video'] as String,
|
||||
duration: stringToNum(json['duration'] as String?),
|
||||
width: json['width'] as int,
|
||||
height: json['height'] as int,
|
||||
width: (json['width'] as num).toInt(),
|
||||
height: (json['height'] as num).toInt(),
|
||||
codec: json['codec'] as String,
|
||||
codecLong: json['codec_long'] as String,
|
||||
license: json['license'] as int,
|
||||
license: (json['license'] as num).toInt(),
|
||||
licenseAuthor: json['license_author'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ Image _$ImageFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'date', 'image'],
|
||||
);
|
||||
return Image(
|
||||
id: json['id'] as int?,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
date: DateTime.parse(json['date'] as String),
|
||||
url: json['image'] as String?,
|
||||
description: json['description'] as String? ?? '',
|
||||
|
||||
@@ -12,7 +12,7 @@ MeasurementCategory _$MeasurementCategoryFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'name', 'unit'],
|
||||
);
|
||||
return MeasurementCategory(
|
||||
id: json['id'] as int?,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
name: json['name'] as String,
|
||||
unit: json['unit'] as String,
|
||||
entries: (json['entries'] as List<dynamic>?)
|
||||
|
||||
@@ -12,8 +12,8 @@ MeasurementEntry _$MeasurementEntryFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'category', 'date', 'value', 'notes'],
|
||||
);
|
||||
return MeasurementEntry(
|
||||
id: json['id'] as int?,
|
||||
category: json['category'] as int,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
category: (json['category'] as num).toInt(),
|
||||
date: DateTime.parse(json['date'] as String),
|
||||
value: json['value'] as num,
|
||||
notes: json['notes'] as String? ?? '',
|
||||
|
||||
@@ -24,12 +24,12 @@ IngredientImage _$IngredientImageFromJson(Map<String, dynamic> json) {
|
||||
],
|
||||
);
|
||||
return IngredientImage(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
uuid: json['uuid'] as String,
|
||||
ingredientId: json['ingredient_id'] as int,
|
||||
ingredientId: (json['ingredient_id'] as num).toInt(),
|
||||
image: json['image'] as String,
|
||||
size: json['size'] as int,
|
||||
licenseId: json['license'] as int,
|
||||
size: (json['size'] as num).toInt(),
|
||||
licenseId: (json['license'] as num).toInt(),
|
||||
author: json['license_author'] as String,
|
||||
authorUrl: json['license_author_url'] as String,
|
||||
title: json['license_title'] as String,
|
||||
|
||||
@@ -62,8 +62,8 @@ class Ingredient {
|
||||
final num fatSaturated;
|
||||
|
||||
/// g per 100g of product
|
||||
@JsonKey(required: true, fromJson: stringToNum, toJson: numToString)
|
||||
final num fibres;
|
||||
@JsonKey(required: true, fromJson: stringToNum, toJson: numToString, name: 'fibres')
|
||||
final num fibers;
|
||||
|
||||
/// g per 100g of product
|
||||
@JsonKey(required: true, fromJson: stringToNum, toJson: numToString)
|
||||
@@ -82,7 +82,7 @@ class Ingredient {
|
||||
required this.protein,
|
||||
required this.fat,
|
||||
required this.fatSaturated,
|
||||
required this.fibres,
|
||||
required this.fibers,
|
||||
required this.sodium,
|
||||
this.image,
|
||||
});
|
||||
|
||||
@@ -25,17 +25,17 @@ Ingredient _$IngredientFromJson(Map<String, dynamic> json) {
|
||||
],
|
||||
);
|
||||
return Ingredient(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
code: json['code'] as String?,
|
||||
name: json['name'] as String,
|
||||
created: DateTime.parse(json['created'] as String),
|
||||
energy: json['energy'] as int,
|
||||
energy: (json['energy'] as num).toInt(),
|
||||
carbohydrates: stringToNum(json['carbohydrates'] as String?),
|
||||
carbohydratesSugar: stringToNum(json['carbohydrates_sugar'] as String?),
|
||||
protein: stringToNum(json['protein'] as String?),
|
||||
fat: stringToNum(json['fat'] as String?),
|
||||
fatSaturated: stringToNum(json['fat_saturated'] as String?),
|
||||
fibres: stringToNum(json['fibres'] as String?),
|
||||
fibers: stringToNum(json['fibres'] as String?),
|
||||
sodium: stringToNum(json['sodium'] as String?),
|
||||
image: json['image'] == null
|
||||
? null
|
||||
@@ -54,7 +54,7 @@ Map<String, dynamic> _$IngredientToJson(Ingredient instance) => <String, dynamic
|
||||
'protein': numToString(instance.protein),
|
||||
'fat': numToString(instance.fat),
|
||||
'fat_saturated': numToString(instance.fatSaturated),
|
||||
'fibres': numToString(instance.fibres),
|
||||
'fibres': numToString(instance.fibers),
|
||||
'sodium': numToString(instance.sodium),
|
||||
'image': instance.image,
|
||||
};
|
||||
|
||||
@@ -12,10 +12,10 @@ IngredientWeightUnit _$IngredientWeightUnitFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'weight_unit', 'ingredient', 'grams', 'amount'],
|
||||
);
|
||||
return IngredientWeightUnit(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
weightUnit: WeightUnit.fromJson(json['weight_unit'] as Map<String, dynamic>),
|
||||
ingredient: Ingredient.fromJson(json['ingredient'] as Map<String, dynamic>),
|
||||
grams: json['grams'] as int,
|
||||
grams: (json['grams'] as num).toInt(),
|
||||
amount: (json['amount'] as num).toDouble(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ class Log {
|
||||
out.carbohydratesSugar = ingredient.carbohydratesSugar * weight / 100;
|
||||
out.fat = ingredient.fat * weight / 100;
|
||||
out.fatSaturated = ingredient.fatSaturated * weight / 100;
|
||||
out.fibres = ingredient.fibres * weight / 100;
|
||||
out.fibers = ingredient.fibers * weight / 100;
|
||||
out.sodium = ingredient.sodium * weight / 100;
|
||||
|
||||
return out;
|
||||
|
||||
@@ -12,12 +12,12 @@ Log _$LogFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'plan', 'datetime', 'ingredient', 'weight_unit', 'amount'],
|
||||
);
|
||||
return Log(
|
||||
id: json['id'] as int?,
|
||||
mealId: json['meal'] as int?,
|
||||
ingredientId: json['ingredient'] as int,
|
||||
weightUnitId: json['weight_unit'] as int?,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
mealId: (json['meal'] as num?)?.toInt(),
|
||||
ingredientId: (json['ingredient'] as num).toInt(),
|
||||
weightUnitId: (json['weight_unit'] as num?)?.toInt(),
|
||||
amount: stringToNum(json['amount'] as String?),
|
||||
planId: json['plan'] as int,
|
||||
planId: (json['plan'] as num).toInt(),
|
||||
datetime: DateTime.parse(json['datetime'] as String),
|
||||
comment: json['comment'] as String?,
|
||||
);
|
||||
|
||||
@@ -7,10 +7,10 @@ part of 'meal.dart';
|
||||
// **************************************************************************
|
||||
|
||||
Meal _$MealFromJson(Map<String, dynamic> json) => Meal(
|
||||
id: json['id'] as int?,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
time: stringToTime(json['time'] as String?),
|
||||
name: json['name'] as String?,
|
||||
)..planId = json['plan'] as int;
|
||||
)..planId = (json['plan'] as num).toInt();
|
||||
|
||||
Map<String, dynamic> _$MealToJson(Meal instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
|
||||
@@ -85,7 +85,7 @@ class MealItem {
|
||||
out.carbohydratesSugar = ingredient.carbohydratesSugar * weight / 100;
|
||||
out.fat = ingredient.fat * weight / 100;
|
||||
out.fatSaturated = ingredient.fatSaturated * weight / 100;
|
||||
out.fibres = ingredient.fibres * weight / 100;
|
||||
out.fibers = ingredient.fibers * weight / 100;
|
||||
out.sodium = ingredient.sodium * weight / 100;
|
||||
|
||||
return out;
|
||||
|
||||
@@ -12,10 +12,10 @@ MealItem _$MealItemFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'amount'],
|
||||
);
|
||||
return MealItem(
|
||||
id: json['id'] as int?,
|
||||
mealId: json['meal'] as int?,
|
||||
ingredientId: json['ingredient'] as int,
|
||||
weightUnitId: json['weight_unit'] as int?,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
mealId: (json['meal'] as num?)?.toInt(),
|
||||
ingredientId: (json['ingredient'] as num).toInt(),
|
||||
weightUnitId: (json['weight_unit'] as num?)?.toInt(),
|
||||
amount: stringToNum(json['amount'] as String?),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class NutritionalGoals {
|
||||
double? carbohydratesSugar = 0;
|
||||
double? fat = 0;
|
||||
double? fatSaturated = 0;
|
||||
double? fibres = 0;
|
||||
double? fibers = 0;
|
||||
double? sodium = 0;
|
||||
|
||||
NutritionalGoals({
|
||||
@@ -36,7 +36,7 @@ class NutritionalGoals {
|
||||
this.carbohydratesSugar,
|
||||
this.fat,
|
||||
this.fatSaturated,
|
||||
this.fibres,
|
||||
this.fibers,
|
||||
this.sodium,
|
||||
}) {
|
||||
// infer values where we can
|
||||
@@ -71,7 +71,7 @@ class NutritionalGoals {
|
||||
carbohydratesSugar: carbohydratesSugar != null ? carbohydratesSugar! / v : null,
|
||||
fat: fat != null ? fat! / v : null,
|
||||
fatSaturated: fatSaturated != null ? fatSaturated! / v : null,
|
||||
fibres: fibres != null ? fibres! / v : null,
|
||||
fibers: fibers != null ? fibers! / v : null,
|
||||
sodium: sodium != null ? sodium! / v : null,
|
||||
);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ class NutritionalGoals {
|
||||
carbohydratesSugar ?? 0,
|
||||
fat ?? 0,
|
||||
fatSaturated ?? 0,
|
||||
fibres ?? 0,
|
||||
fibers ?? 0,
|
||||
sodium ?? 0,
|
||||
);
|
||||
}
|
||||
@@ -126,7 +126,7 @@ class NutritionalGoals {
|
||||
'carbohydratesSugar' => carbohydratesSugar,
|
||||
'fat' => fat,
|
||||
'fatSaturated' => fatSaturated,
|
||||
'fibres' => fibres,
|
||||
'fibres' => fibers,
|
||||
'sodium' => sodium,
|
||||
_ => 0,
|
||||
};
|
||||
@@ -134,13 +134,13 @@ class NutritionalGoals {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'e: $energy, p: $protein, c: $carbohydrates, cS: $carbohydratesSugar, f: $fat, fS: $fatSaturated, fi: $fibres, s: $sodium';
|
||||
return 'e: $energy, p: $protein, c: $carbohydrates, cS: $carbohydratesSugar, f: $fat, fS: $fatSaturated, fi: $fibers, s: $sodium';
|
||||
}
|
||||
|
||||
@override
|
||||
//ignore: avoid_equals_and_hash_code_on_mutable_classes
|
||||
int get hashCode => Object.hash(
|
||||
energy, protein, carbohydrates, carbohydratesSugar, fat, fatSaturated, fibres, sodium);
|
||||
energy, protein, carbohydrates, carbohydratesSugar, fat, fatSaturated, fibers, sodium);
|
||||
|
||||
@override
|
||||
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
||||
@@ -155,7 +155,7 @@ class NutritionalGoals {
|
||||
other.carbohydratesSugar == carbohydratesSugar &&
|
||||
other.fat == fat &&
|
||||
other.fatSaturated == fatSaturated &&
|
||||
other.fibres == fibres &&
|
||||
other.fibers == fibers &&
|
||||
other.sodium == sodium;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ class NutritionalPlan {
|
||||
fat: goalFat?.toDouble(),
|
||||
protein: goalProtein?.toDouble(),
|
||||
carbohydrates: goalCarbohydrates?.toDouble(),
|
||||
fibres: goalFibers?.toDouble(),
|
||||
fibers: goalFibers?.toDouble(),
|
||||
);
|
||||
}
|
||||
// if there are no set goals and no defined meals, the goals are still undefined
|
||||
@@ -141,7 +141,7 @@ class NutritionalPlan {
|
||||
carbohydrates: sumValues.carbohydrates,
|
||||
carbohydratesSugar: sumValues.carbohydratesSugar,
|
||||
fatSaturated: sumValues.fatSaturated,
|
||||
fibres: sumValues.fibres,
|
||||
fibers: sumValues.fibers,
|
||||
sodium: sumValues.sodium,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class NutritionalValues {
|
||||
double carbohydratesSugar = 0;
|
||||
double fat = 0;
|
||||
double fatSaturated = 0;
|
||||
double fibres = 0;
|
||||
double fibers = 0;
|
||||
double sodium = 0;
|
||||
|
||||
NutritionalValues();
|
||||
@@ -35,7 +35,7 @@ class NutritionalValues {
|
||||
this.carbohydratesSugar,
|
||||
this.fat,
|
||||
this.fatSaturated,
|
||||
this.fibres,
|
||||
this.fibers,
|
||||
this.sodium,
|
||||
);
|
||||
|
||||
@@ -51,7 +51,7 @@ class NutritionalValues {
|
||||
carbohydratesSugar += data.carbohydratesSugar;
|
||||
fat += data.fat;
|
||||
fatSaturated += data.fatSaturated;
|
||||
fibres += data.fibres;
|
||||
fibers += data.fibers;
|
||||
sodium += data.sodium;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class NutritionalValues {
|
||||
carbohydratesSugar + o.carbohydratesSugar,
|
||||
fat + o.fat,
|
||||
fatSaturated + o.fatSaturated,
|
||||
fibres + o.fibres,
|
||||
fibers + o.fibers,
|
||||
sodium + o.sodium,
|
||||
);
|
||||
}
|
||||
@@ -76,7 +76,7 @@ class NutritionalValues {
|
||||
carbohydratesSugar / o,
|
||||
fat / o,
|
||||
fatSaturated / o,
|
||||
fibres / o,
|
||||
fibers / o,
|
||||
sodium / o,
|
||||
);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ class NutritionalValues {
|
||||
carbohydratesSugar == other.carbohydratesSugar &&
|
||||
fat == other.fat &&
|
||||
fatSaturated == other.fatSaturated &&
|
||||
fibres == other.fibres &&
|
||||
fibers == other.fibers &&
|
||||
sodium == other.sodium;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ class NutritionalValues {
|
||||
'carbohydratesSugar' => carbohydratesSugar,
|
||||
'fat' => fat,
|
||||
'fatSaturated' => fatSaturated,
|
||||
'fibres' => fibres,
|
||||
'fibres' => fibers,
|
||||
'sodium' => sodium,
|
||||
_ => 0,
|
||||
};
|
||||
@@ -111,11 +111,11 @@ class NutritionalValues {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'e: $energy, p: $protein, c: $carbohydrates, cS: $carbohydratesSugar, f: $fat, fS: $fatSaturated, fi: $fibres, s: $sodium';
|
||||
return 'e: $energy, p: $protein, c: $carbohydrates, cS: $carbohydratesSugar, f: $fat, fS: $fatSaturated, fi: $fibers, s: $sodium';
|
||||
}
|
||||
|
||||
@override
|
||||
//ignore: avoid_equals_and_hash_code_on_mutable_classes
|
||||
int get hashCode => Object.hash(
|
||||
energy, protein, carbohydrates, carbohydratesSugar, fat, fatSaturated, fibres, sodium);
|
||||
energy, protein, carbohydrates, carbohydratesSugar, fat, fatSaturated, fibers, sodium);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ WeightUnit _$WeightUnitFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'name'],
|
||||
);
|
||||
return WeightUnit(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@ Day _$DayFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'training', 'description', 'day'],
|
||||
);
|
||||
return Day()
|
||||
..id = json['id'] as int?
|
||||
..workoutId = json['training'] as int
|
||||
..id = (json['id'] as num?)?.toInt()
|
||||
..workoutId = (json['training'] as num).toInt()
|
||||
..description = json['description'] as String
|
||||
..daysOfWeek = (json['day'] as List<dynamic>).map((e) => e as int).toList();
|
||||
..daysOfWeek = (json['day'] as List<dynamic>).map((e) => (e as num).toInt()).toList();
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$DayToJson(Day instance) => <String, dynamic>{
|
||||
|
||||
@@ -21,14 +21,14 @@ Log _$LogFromJson(Map<String, dynamic> json) {
|
||||
],
|
||||
);
|
||||
return Log(
|
||||
id: json['id'] as int?,
|
||||
exerciseBaseId: json['exercise_base'] as int,
|
||||
workoutPlan: json['workout'] as int,
|
||||
reps: json['reps'] as int,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
exerciseBaseId: (json['exercise_base'] as num).toInt(),
|
||||
workoutPlan: (json['workout'] as num).toInt(),
|
||||
reps: (json['reps'] as num).toInt(),
|
||||
rir: json['rir'] as String?,
|
||||
repetitionUnitId: json['repetition_unit'] as int,
|
||||
repetitionUnitId: (json['repetition_unit'] as num).toInt(),
|
||||
weight: stringToNum(json['weight'] as String?),
|
||||
weightUnitId: json['weight_unit'] as int,
|
||||
weightUnitId: (json['weight_unit'] as num).toInt(),
|
||||
date: DateTime.parse(json['date'] as String),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ RepetitionUnit _$RepetitionUnitFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'name'],
|
||||
);
|
||||
return RepetitionUnit(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ WorkoutSession _$WorkoutSessionFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'workout', 'date', 'impression', 'time_start', 'time_end'],
|
||||
);
|
||||
return WorkoutSession()
|
||||
..id = json['id'] as int?
|
||||
..workoutId = json['workout'] as int
|
||||
..id = (json['id'] as num?)?.toInt()
|
||||
..workoutId = (json['workout'] as num).toInt()
|
||||
..date = DateTime.parse(json['date'] as String)
|
||||
..impression = stringToNum(json['impression'] as String?)
|
||||
..notes = json['notes'] as String? ?? ''
|
||||
|
||||
@@ -12,11 +12,11 @@ Set _$SetFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'sets', 'order', 'comment'],
|
||||
);
|
||||
return Set(
|
||||
day: json['exerciseday'] as int,
|
||||
sets: json['sets'] as int,
|
||||
order: json['order'] as int,
|
||||
day: (json['exerciseday'] as num).toInt(),
|
||||
sets: (json['sets'] as num).toInt(),
|
||||
order: (json['order'] as num).toInt(),
|
||||
)
|
||||
..id = json['id'] as int?
|
||||
..id = (json['id'] as num?)?.toInt()
|
||||
..comment = json['comment'] as String? ?? '';
|
||||
}
|
||||
|
||||
|
||||
@@ -23,13 +23,13 @@ Setting _$SettingFromJson(Map<String, dynamic> json) {
|
||||
],
|
||||
);
|
||||
return Setting(
|
||||
id: json['id'] as int?,
|
||||
setId: json['set'] as int,
|
||||
order: json['order'] as int,
|
||||
exerciseId: json['exercise_base'] as int,
|
||||
repetitionUnitId: json['repetition_unit'] as int,
|
||||
reps: json['reps'] as int?,
|
||||
weightUnitId: json['weight_unit'] as int,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
setId: (json['set'] as num).toInt(),
|
||||
order: (json['order'] as num).toInt(),
|
||||
exerciseId: (json['exercise_base'] as num).toInt(),
|
||||
repetitionUnitId: (json['repetition_unit'] as num).toInt(),
|
||||
reps: (json['reps'] as num?)?.toInt(),
|
||||
weightUnitId: (json['weight_unit'] as num).toInt(),
|
||||
comment: json['comment'] as String,
|
||||
rir: json['rir'] as String?,
|
||||
)..weight = stringToNum(json['weight'] as String?);
|
||||
|
||||
@@ -12,7 +12,7 @@ WeightUnit _$WeightUnitFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'name'],
|
||||
);
|
||||
return WeightUnit(
|
||||
id: json['id'] as int,
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ WorkoutPlan _$WorkoutPlanFromJson(Map<String, dynamic> json) {
|
||||
requiredKeys: const ['id', 'creation_date', 'name', 'description'],
|
||||
);
|
||||
return WorkoutPlan(
|
||||
id: json['id'] as int?,
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
creationDate: DateTime.parse(json['creation_date'] as String),
|
||||
name: json['name'] as String,
|
||||
description: json['description'] as String?,
|
||||
|
||||
@@ -100,7 +100,7 @@ class FlNutritionalPlanGoalWidgetState extends State<FlNutritionalPlanGoalWidget
|
||||
today.carbohydrates / goals.carbohydrates!,
|
||||
if (goals.fat != null && goals.fat! > 0) today.fat / goals.fat!,
|
||||
if (goals.energy != null && goals.energy! > 0) today.energy / goals.energy!,
|
||||
if (goals.fibres != null && goals.fibres! > 0) today.fibres / goals.fibres!,
|
||||
if (goals.fibers != null && goals.fibers! > 0) today.fibers / goals.fibers!,
|
||||
].reduce(max);
|
||||
|
||||
final normWidth = constraints.maxWidth / maxVal;
|
||||
@@ -132,13 +132,13 @@ class FlNutritionalPlanGoalWidgetState extends State<FlNutritionalPlanGoalWidget
|
||||
const SizedBox(height: 2),
|
||||
_diyGauge(context, normWidth, goals.energy, today.energy),
|
||||
// optionally display the advanced macro goals:
|
||||
if (goals.fibres != null)
|
||||
if (goals.fibers != null)
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
const SizedBox(height: 8),
|
||||
Text(fmtMacro(AppLocalizations.of(context).fibres, today.fibres, goals.fibres,
|
||||
Text(fmtMacro(AppLocalizations.of(context).fibres, today.fibers, goals.fibers,
|
||||
AppLocalizations.of(context).g)),
|
||||
const SizedBox(height: 2),
|
||||
_diyGauge(context, normWidth, goals.fibres, today.fibres),
|
||||
_diyGauge(context, normWidth, goals.fibers, today.fibers),
|
||||
]),
|
||||
],
|
||||
);
|
||||
@@ -400,8 +400,8 @@ class NutritionalDiaryChartWidgetFlState extends State<NutritionalDiaryChartWidg
|
||||
barchartGroup(2, barsSpace, barsWidth, 'carbohydratesSugar'),
|
||||
barchartGroup(3, barsSpace, barsWidth, 'fat'),
|
||||
barchartGroup(4, barsSpace, barsWidth, 'fatSaturated'),
|
||||
if (widget._nutritionalPlan.nutritionalGoals.fibres != null)
|
||||
barchartGroup(5, barsSpace, barsWidth, 'fibres'),
|
||||
if (widget._nutritionalPlan.nutritionalGoals.fibers != null)
|
||||
barchartGroup(5, barsSpace, barsWidth, 'fibers'),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -152,8 +152,8 @@ class MacronutrientsTable extends StatelessWidget {
|
||||
),
|
||||
const Text(''),
|
||||
const Text(''),
|
||||
Text(nutritionalGoals.fibres != null
|
||||
? nutritionalGoals.fibres!.toStringAsFixed(0) + AppLocalizations.of(context).g
|
||||
Text(nutritionalGoals.fibers != null
|
||||
? nutritionalGoals.fibers!.toStringAsFixed(0) + AppLocalizations.of(context).g
|
||||
: ''),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -190,9 +190,9 @@ class NutritionDiaryTable extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: tablePadding),
|
||||
child: Text(AppLocalizations.of(context).fibres),
|
||||
),
|
||||
Text(AppLocalizations.of(context).gValue(planned.fibres.toStringAsFixed(0))),
|
||||
Text(AppLocalizations.of(context).gValue(logged.fibres.toStringAsFixed(0))),
|
||||
Text((logged.fibres - planned.fibres).toStringAsFixed(0)),
|
||||
Text(AppLocalizations.of(context).gValue(planned.fibers.toStringAsFixed(0))),
|
||||
Text(AppLocalizations.of(context).gValue(logged.fibers.toStringAsFixed(0))),
|
||||
Text((logged.fibers - planned.fibers).toStringAsFixed(0)),
|
||||
],
|
||||
),
|
||||
TableRow(
|
||||
|
||||
Reference in New Issue
Block a user