Add a third option to the theme mode

This allows the user to use the system settings as well, and not always force
light or dark mode in the app. Also move the logic to the UserProvider and
do some light refactoring.
This commit is contained in:
Roland Geider
2025-01-23 23:22:50 +01:00
parent 8dc72b9fc4
commit 86f8b7ae35
61 changed files with 952 additions and 1237 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -3,24 +3,20 @@
part of 'ingredients_database.dart';
// ignore_for_file: type=lint
class $IngredientsTable extends Ingredients
with TableInfo<$IngredientsTable, IngredientTable> {
class $IngredientsTable extends Ingredients with TableInfo<$IngredientsTable, IngredientTable> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$IngredientsTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<int> id = GeneratedColumn<int>(
'id', aliasedName, false,
late final GeneratedColumn<int> id = GeneratedColumn<int>('id', aliasedName, false,
type: DriftSqlType.int, requiredDuringInsert: true);
static const VerificationMeta _dataMeta = const VerificationMeta('data');
@override
late final GeneratedColumn<String> data = GeneratedColumn<String>(
'data', aliasedName, false,
late final GeneratedColumn<String> data = GeneratedColumn<String>('data', aliasedName, false,
type: DriftSqlType.string, requiredDuringInsert: true);
static const VerificationMeta _lastFetchedMeta =
const VerificationMeta('lastFetched');
static const VerificationMeta _lastFetchedMeta = const VerificationMeta('lastFetched');
@override
late final GeneratedColumn<DateTime> lastFetched = GeneratedColumn<DateTime>(
'last_fetched', aliasedName, false,
@@ -43,16 +39,13 @@ class $IngredientsTable extends Ingredients
context.missing(_idMeta);
}
if (data.containsKey('data')) {
context.handle(
_dataMeta, this.data.isAcceptableOrUnknown(data['data']!, _dataMeta));
context.handle(_dataMeta, this.data.isAcceptableOrUnknown(data['data']!, _dataMeta));
} else if (isInserting) {
context.missing(_dataMeta);
}
if (data.containsKey('last_fetched')) {
context.handle(
_lastFetchedMeta,
lastFetched.isAcceptableOrUnknown(
data['last_fetched']!, _lastFetchedMeta));
context.handle(_lastFetchedMeta,
lastFetched.isAcceptableOrUnknown(data['last_fetched']!, _lastFetchedMeta));
} else if (isInserting) {
context.missing(_lastFetchedMeta);
}
@@ -65,10 +58,8 @@ class $IngredientsTable extends Ingredients
IngredientTable map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return IngredientTable(
id: attachedDatabase.typeMapping
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
data: attachedDatabase.typeMapping
.read(DriftSqlType.string, data['${effectivePrefix}data'])!,
id: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
data: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}data'])!,
lastFetched: attachedDatabase.typeMapping
.read(DriftSqlType.dateTime, data['${effectivePrefix}last_fetched'])!,
);
@@ -86,8 +77,7 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
/// The date when the ingredient was last fetched from the server
final DateTime lastFetched;
const IngredientTable(
{required this.id, required this.data, required this.lastFetched});
const IngredientTable({required this.id, required this.data, required this.lastFetched});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
@@ -105,8 +95,7 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
);
}
factory IngredientTable.fromJson(Map<String, dynamic> json,
{ValueSerializer? serializer}) {
factory IngredientTable.fromJson(Map<String, dynamic> json, {ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return IngredientTable(
id: serializer.fromJson<int>(json['id']),
@@ -124,8 +113,7 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
};
}
IngredientTable copyWith({int? id, String? data, DateTime? lastFetched}) =>
IngredientTable(
IngredientTable copyWith({int? id, String? data, DateTime? lastFetched}) => IngredientTable(
id: id ?? this.id,
data: data ?? this.data,
lastFetched: lastFetched ?? this.lastFetched,
@@ -134,8 +122,7 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
return IngredientTable(
id: data.id.present ? data.id.value : this.id,
data: data.data.present ? data.data.value : this.data,
lastFetched:
data.lastFetched.present ? data.lastFetched.value : this.lastFetched,
lastFetched: data.lastFetched.present ? data.lastFetched.value : this.lastFetched,
);
}
@@ -194,10 +181,7 @@ class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
}
IngredientsCompanion copyWith(
{Value<int>? id,
Value<String>? data,
Value<DateTime>? lastFetched,
Value<int>? rowid}) {
{Value<int>? id, Value<String>? data, Value<DateTime>? lastFetched, Value<int>? rowid}) {
return IngredientsCompanion(
id: id ?? this.id,
data: data ?? this.data,
@@ -247,23 +231,20 @@ abstract class _$IngredientDatabase extends GeneratedDatabase {
List<DatabaseSchemaEntity> get allSchemaEntities => [ingredients];
}
typedef $$IngredientsTableCreateCompanionBuilder = IngredientsCompanion
Function({
typedef $$IngredientsTableCreateCompanionBuilder = IngredientsCompanion Function({
required int id,
required String data,
required DateTime lastFetched,
Value<int> rowid,
});
typedef $$IngredientsTableUpdateCompanionBuilder = IngredientsCompanion
Function({
typedef $$IngredientsTableUpdateCompanionBuilder = IngredientsCompanion Function({
Value<int> id,
Value<String> data,
Value<DateTime> lastFetched,
Value<int> rowid,
});
class $$IngredientsTableFilterComposer
extends Composer<_$IngredientDatabase, $IngredientsTable> {
class $$IngredientsTableFilterComposer extends Composer<_$IngredientDatabase, $IngredientsTable> {
$$IngredientsTableFilterComposer({
required super.$db,
required super.$table,
@@ -271,18 +252,17 @@ class $$IngredientsTableFilterComposer
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<int> get id => $composableBuilder(
column: $table.id, builder: (column) => ColumnFilters(column));
ColumnFilters<int> get id =>
$composableBuilder(column: $table.id, builder: (column) => ColumnFilters(column));
ColumnFilters<String> get data => $composableBuilder(
column: $table.data, builder: (column) => ColumnFilters(column));
ColumnFilters<String> get data =>
$composableBuilder(column: $table.data, builder: (column) => ColumnFilters(column));
ColumnFilters<DateTime> get lastFetched => $composableBuilder(
column: $table.lastFetched, builder: (column) => ColumnFilters(column));
ColumnFilters<DateTime> get lastFetched =>
$composableBuilder(column: $table.lastFetched, builder: (column) => ColumnFilters(column));
}
class $$IngredientsTableOrderingComposer
extends Composer<_$IngredientDatabase, $IngredientsTable> {
class $$IngredientsTableOrderingComposer extends Composer<_$IngredientDatabase, $IngredientsTable> {
$$IngredientsTableOrderingComposer({
required super.$db,
required super.$table,
@@ -290,14 +270,14 @@ class $$IngredientsTableOrderingComposer
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<int> get id => $composableBuilder(
column: $table.id, builder: (column) => ColumnOrderings(column));
ColumnOrderings<int> get id =>
$composableBuilder(column: $table.id, builder: (column) => ColumnOrderings(column));
ColumnOrderings<String> get data => $composableBuilder(
column: $table.data, builder: (column) => ColumnOrderings(column));
ColumnOrderings<String> get data =>
$composableBuilder(column: $table.data, builder: (column) => ColumnOrderings(column));
ColumnOrderings<DateTime> get lastFetched => $composableBuilder(
column: $table.lastFetched, builder: (column) => ColumnOrderings(column));
ColumnOrderings<DateTime> get lastFetched =>
$composableBuilder(column: $table.lastFetched, builder: (column) => ColumnOrderings(column));
}
class $$IngredientsTableAnnotationComposer
@@ -309,14 +289,13 @@ class $$IngredientsTableAnnotationComposer
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<int> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<int> get id => $composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<String> get data =>
$composableBuilder(column: $table.data, builder: (column) => column);
GeneratedColumn<DateTime> get lastFetched => $composableBuilder(
column: $table.lastFetched, builder: (column) => column);
GeneratedColumn<DateTime> get lastFetched =>
$composableBuilder(column: $table.lastFetched, builder: (column) => column);
}
class $$IngredientsTableTableManager extends RootTableManager<
@@ -328,21 +307,15 @@ class $$IngredientsTableTableManager extends RootTableManager<
$$IngredientsTableAnnotationComposer,
$$IngredientsTableCreateCompanionBuilder,
$$IngredientsTableUpdateCompanionBuilder,
(
IngredientTable,
BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>
),
(IngredientTable, BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>),
IngredientTable,
PrefetchHooks Function()> {
$$IngredientsTableTableManager(
_$IngredientDatabase db, $IngredientsTable table)
$$IngredientsTableTableManager(_$IngredientDatabase db, $IngredientsTable table)
: super(TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$IngredientsTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$IngredientsTableOrderingComposer($db: db, $table: table),
createFilteringComposer: () => $$IngredientsTableFilterComposer($db: db, $table: table),
createOrderingComposer: () => $$IngredientsTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$IngredientsTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback: ({
@@ -369,9 +342,8 @@ class $$IngredientsTableTableManager extends RootTableManager<
lastFetched: lastFetched,
rowid: rowid,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
withReferenceMapper: (p0) =>
p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(),
prefetchHooksCallback: null,
));
}
@@ -385,10 +357,7 @@ typedef $$IngredientsTableProcessedTableManager = ProcessedTableManager<
$$IngredientsTableAnnotationComposer,
$$IngredientsTableCreateCompanionBuilder,
$$IngredientsTableUpdateCompanionBuilder,
(
IngredientTable,
BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>
),
(IngredientTable, BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>),
IngredientTable,
PrefetchHooks Function()>;

View File

@@ -62,6 +62,7 @@ const PREFS_LAST_UPDATED_LANGUAGES = 'lastUpdatedLanguages';
const PREFS_INGREDIENTS = 'ingredientData';
const PREFS_WORKOUT_UNITS = 'workoutUnits';
const PREFS_USER = 'userData';
const PREFS_USER_DARK_THEME = 'userDarkMode';
const PREFS_LAST_SERVER = 'lastServer';
const DEFAULT_ANIMATION_DURATION = Duration(milliseconds: 200);

View File

@@ -913,8 +913,8 @@
"@indicatorAvg": {
"description": "added for localization of Class Indicator's field text"
},
"darkMode": "Dark Mode",
"@darkMode": {
"description": "added for localization for field text"
}
"themeMode": "Theme mode",
"darkMode": "Always dark mode",
"lightMode": "Always light mode",
"systemMode": "System settings"
}

View File

@@ -134,46 +134,48 @@ class MyApp extends StatelessWidget {
),
],
child: Consumer<AuthProvider>(
builder: (ctx, auth, _) => MaterialApp(
title: 'wger',
theme: wgerLightTheme,
darkTheme: wgerDarkTheme,
highContrastTheme: wgerLightThemeHc,
highContrastDarkTheme: wgerDarkThemeHc,
themeMode: auth.themeMode, ///ThemeMode.system,
home: auth.isAuth
? const HomeTabsScreen()
: FutureBuilder(
future: auth.tryAutoLogin(),
builder: (ctx, authResultSnapshot) =>
authResultSnapshot.connectionState == ConnectionState.waiting
? const SplashScreen()
: const AuthScreen(),
),
routes: {
DashboardScreen.routeName: (ctx) => const DashboardScreen(),
FormScreen.routeName: (ctx) => const FormScreen(),
GalleryScreen.routeName: (ctx) => const GalleryScreen(),
GymModeScreen.routeName: (ctx) => const GymModeScreen(),
HomeTabsScreen.routeName: (ctx) => const HomeTabsScreen(),
MeasurementCategoriesScreen.routeName: (ctx) => const MeasurementCategoriesScreen(),
MeasurementEntriesScreen.routeName: (ctx) => const MeasurementEntriesScreen(),
NutritionalPlansScreen.routeName: (ctx) => const NutritionalPlansScreen(),
NutritionalDiaryScreen.routeName: (ctx) => const NutritionalDiaryScreen(),
NutritionalPlanScreen.routeName: (ctx) => const NutritionalPlanScreen(),
LogMealsScreen.routeName: (ctx) => const LogMealsScreen(),
LogMealScreen.routeName: (ctx) => const LogMealScreen(),
WeightScreen.routeName: (ctx) => const WeightScreen(),
WorkoutPlanScreen.routeName: (ctx) => const WorkoutPlanScreen(),
WorkoutPlansScreen.routeName: (ctx) => const WorkoutPlansScreen(),
ExercisesScreen.routeName: (ctx) => const ExercisesScreen(),
ExerciseDetailScreen.routeName: (ctx) => const ExerciseDetailScreen(),
AddExerciseScreen.routeName: (ctx) => const AddExerciseScreen(),
AboutPage.routeName: (ctx) => const AboutPage(),
SettingsPage.routeName: (ctx) => const SettingsPage(),
},
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
builder: (ctx, auth, _) => Consumer<UserProvider>(
builder: (ctx, user, _) => MaterialApp(
title: 'wger',
theme: wgerLightTheme,
darkTheme: wgerDarkTheme,
highContrastTheme: wgerLightThemeHc,
highContrastDarkTheme: wgerDarkThemeHc,
themeMode: user.themeMode,
home: auth.isAuth
? const HomeTabsScreen()
: FutureBuilder(
future: auth.tryAutoLogin(),
builder: (ctx, authResultSnapshot) =>
authResultSnapshot.connectionState == ConnectionState.waiting
? const SplashScreen()
: const AuthScreen(),
),
routes: {
DashboardScreen.routeName: (ctx) => const DashboardScreen(),
FormScreen.routeName: (ctx) => const FormScreen(),
GalleryScreen.routeName: (ctx) => const GalleryScreen(),
GymModeScreen.routeName: (ctx) => const GymModeScreen(),
HomeTabsScreen.routeName: (ctx) => const HomeTabsScreen(),
MeasurementCategoriesScreen.routeName: (ctx) => const MeasurementCategoriesScreen(),
MeasurementEntriesScreen.routeName: (ctx) => const MeasurementEntriesScreen(),
NutritionalPlansScreen.routeName: (ctx) => const NutritionalPlansScreen(),
NutritionalDiaryScreen.routeName: (ctx) => const NutritionalDiaryScreen(),
NutritionalPlanScreen.routeName: (ctx) => const NutritionalPlanScreen(),
LogMealsScreen.routeName: (ctx) => const LogMealsScreen(),
LogMealScreen.routeName: (ctx) => const LogMealScreen(),
WeightScreen.routeName: (ctx) => const WeightScreen(),
WorkoutPlanScreen.routeName: (ctx) => const WorkoutPlanScreen(),
WorkoutPlansScreen.routeName: (ctx) => const WorkoutPlansScreen(),
ExercisesScreen.routeName: (ctx) => const ExercisesScreen(),
ExerciseDetailScreen.routeName: (ctx) => const ExerciseDetailScreen(),
AddExerciseScreen.routeName: (ctx) => const AddExerciseScreen(),
AboutPage.routeName: (ctx) => const AboutPage(),
SettingsPage.routeName: (ctx) => const SettingsPage(),
},
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
),
),
),
);

View File

@@ -18,8 +18,7 @@ WeightEntry _$WeightEntryFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$WeightEntryToJson(WeightEntry instance) =>
<String, dynamic>{
Map<String, dynamic> _$WeightEntryToJson(WeightEntry instance) => <String, dynamic>{
'id': instance.id,
'weight': numToString(instance.weight),
'date': toDate(instance.date),

View File

@@ -17,8 +17,7 @@ ExerciseCategory _$ExerciseCategoryFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$ExerciseCategoryToJson(ExerciseCategory instance) =>
<String, dynamic>{
Map<String, dynamic> _$ExerciseCategoryToJson(ExerciseCategory instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
};

View File

@@ -25,12 +25,8 @@ Exercise _$ExerciseFromJson(Map<String, dynamic> json) {
return Exercise(
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),
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),
@@ -43,15 +39,10 @@ Exercise _$ExerciseFromJson(Map<String, dynamic> json) {
: ExerciseCategory.fromJson(json['categories'] as Map<String, dynamic>),
)
..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 num).toInt())
.toList()
..equipmentIds = (json['equipment'] as List<dynamic>)
.map((e) => (e as num).toInt())
.toList();
..musclesIds = (json['muscles'] as List<dynamic>).map((e) => (e as num).toInt()).toList()
..musclesSecondaryIds =
(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>{
@@ -65,7 +56,6 @@ Map<String, dynamic> _$ExerciseToJson(Exercise instance) => <String, dynamic>{
'categories': instance.category?.toJson(),
'muscles': instance.musclesIds,
'muscles_secondary': instance.musclesSecondaryIds,
'musclesSecondary':
instance.musclesSecondary.map((e) => e.toJson()).toList(),
'musclesSecondary': instance.musclesSecondary.map((e) => e.toJson()).toList(),
'equipment': instance.equipmentIds,
};

View File

@@ -21,14 +21,11 @@ ExerciseApiData _$ExerciseApiDataFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$ExerciseApiData {
int get id => throw _privateConstructorUsedError;
String get uuid =>
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
String get uuid => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
@JsonKey(name: 'variations')
int? get variationId =>
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
int? get variationId => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
@JsonKey(name: 'created')
DateTime get created =>
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
DateTime get created => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
@JsonKey(name: 'last_update')
DateTime get lastUpdate =>
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
@@ -45,8 +42,7 @@ mixin _$ExerciseApiData {
@JsonKey(name: 'exercises')
List<Translation> get translations => throw _privateConstructorUsedError;
List<ExerciseImage> get images => throw _privateConstructorUsedError;
List<Video> get videos =>
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
List<Video> get videos => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
@JsonKey(name: 'author_history')
List<String> get authors =>
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
@@ -59,14 +55,12 @@ mixin _$ExerciseApiData {
/// Create a copy of ExerciseApiData
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ExerciseApiDataCopyWith<ExerciseApiData> get copyWith =>
throw _privateConstructorUsedError;
$ExerciseApiDataCopyWith<ExerciseApiData> get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ExerciseApiDataCopyWith<$Res> {
factory $ExerciseApiDataCopyWith(
ExerciseApiData value, $Res Function(ExerciseApiData) then) =
factory $ExerciseApiDataCopyWith(ExerciseApiData value, $Res Function(ExerciseApiData) then) =
_$ExerciseApiDataCopyWithImpl<$Res, ExerciseApiData>;
@useResult
$Res call(
@@ -184,10 +178,9 @@ class _$ExerciseApiDataCopyWithImpl<$Res, $Val extends ExerciseApiData>
}
/// @nodoc
abstract class _$$ExerciseBaseDataImplCopyWith<$Res>
implements $ExerciseApiDataCopyWith<$Res> {
factory _$$ExerciseBaseDataImplCopyWith(_$ExerciseBaseDataImpl value,
$Res Function(_$ExerciseBaseDataImpl) then) =
abstract class _$$ExerciseBaseDataImplCopyWith<$Res> implements $ExerciseApiDataCopyWith<$Res> {
factory _$$ExerciseBaseDataImplCopyWith(
_$ExerciseBaseDataImpl value, $Res Function(_$ExerciseBaseDataImpl) then) =
__$$ExerciseBaseDataImplCopyWithImpl<$Res>;
@override
@useResult
@@ -213,8 +206,8 @@ abstract class _$$ExerciseBaseDataImplCopyWith<$Res>
class __$$ExerciseBaseDataImplCopyWithImpl<$Res>
extends _$ExerciseApiDataCopyWithImpl<$Res, _$ExerciseBaseDataImpl>
implements _$$ExerciseBaseDataImplCopyWith<$Res> {
__$$ExerciseBaseDataImplCopyWithImpl(_$ExerciseBaseDataImpl _value,
$Res Function(_$ExerciseBaseDataImpl) _then)
__$$ExerciseBaseDataImplCopyWithImpl(
_$ExerciseBaseDataImpl _value, $Res Function(_$ExerciseBaseDataImpl) _then)
: super(_value, _then);
/// Create a copy of ExerciseApiData
@@ -315,15 +308,13 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
@JsonKey(name: 'last_update_global') required this.lastUpdateGlobal,
required this.category,
required final List<Muscle> muscles,
@JsonKey(name: 'muscles_secondary')
required final List<Muscle> musclesSecondary,
@JsonKey(name: 'muscles_secondary') required final List<Muscle> musclesSecondary,
required final List<Equipment> equipment,
@JsonKey(name: 'exercises') required final List<Translation> translations,
required final List<ExerciseImage> images,
required final List<Video> videos,
@JsonKey(name: 'author_history') required final List<String> authors,
@JsonKey(name: 'total_authors_history')
required final List<String> authorsGlobal})
@JsonKey(name: 'total_authors_history') required final List<String> authorsGlobal})
: _muscles = muscles,
_musclesSecondary = musclesSecondary,
_equipment = equipment,
@@ -372,8 +363,7 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
@override
@JsonKey(name: 'muscles_secondary')
List<Muscle> get musclesSecondary {
if (_musclesSecondary is EqualUnmodifiableListView)
return _musclesSecondary;
if (_musclesSecondary is EqualUnmodifiableListView) return _musclesSecondary;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_musclesSecondary);
}
@@ -449,27 +439,20 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
other is _$ExerciseBaseDataImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.uuid, uuid) || other.uuid == uuid) &&
(identical(other.variationId, variationId) ||
other.variationId == variationId) &&
(identical(other.variationId, variationId) || other.variationId == variationId) &&
(identical(other.created, created) || other.created == created) &&
(identical(other.lastUpdate, lastUpdate) ||
other.lastUpdate == lastUpdate) &&
(identical(other.lastUpdate, lastUpdate) || other.lastUpdate == lastUpdate) &&
(identical(other.lastUpdateGlobal, lastUpdateGlobal) ||
other.lastUpdateGlobal == lastUpdateGlobal) &&
(identical(other.category, category) ||
other.category == category) &&
(identical(other.category, category) || other.category == category) &&
const DeepCollectionEquality().equals(other._muscles, _muscles) &&
const DeepCollectionEquality()
.equals(other._musclesSecondary, _musclesSecondary) &&
const DeepCollectionEquality()
.equals(other._equipment, _equipment) &&
const DeepCollectionEquality()
.equals(other._translations, _translations) &&
const DeepCollectionEquality().equals(other._musclesSecondary, _musclesSecondary) &&
const DeepCollectionEquality().equals(other._equipment, _equipment) &&
const DeepCollectionEquality().equals(other._translations, _translations) &&
const DeepCollectionEquality().equals(other._images, _images) &&
const DeepCollectionEquality().equals(other._videos, _videos) &&
const DeepCollectionEquality().equals(other._authors, _authors) &&
const DeepCollectionEquality()
.equals(other._authorsGlobal, _authorsGlobal));
const DeepCollectionEquality().equals(other._authorsGlobal, _authorsGlobal));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -498,8 +481,7 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
@override
@pragma('vm:prefer-inline')
_$$ExerciseBaseDataImplCopyWith<_$ExerciseBaseDataImpl> get copyWith =>
__$$ExerciseBaseDataImplCopyWithImpl<_$ExerciseBaseDataImpl>(
this, _$identity);
__$$ExerciseBaseDataImplCopyWithImpl<_$ExerciseBaseDataImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -511,27 +493,24 @@ class _$ExerciseBaseDataImpl implements _ExerciseBaseData {
abstract class _ExerciseBaseData implements ExerciseApiData {
factory _ExerciseBaseData(
{required final int id,
required final String uuid,
@JsonKey(name: 'variations') final int? variationId,
@JsonKey(name: 'created') required final DateTime created,
@JsonKey(name: 'last_update') required final DateTime lastUpdate,
@JsonKey(name: 'last_update_global')
required final DateTime lastUpdateGlobal,
required final ExerciseCategory category,
required final List<Muscle> muscles,
@JsonKey(name: 'muscles_secondary')
required final List<Muscle> musclesSecondary,
required final List<Equipment> equipment,
@JsonKey(name: 'exercises') required final List<Translation> translations,
required final List<ExerciseImage> images,
required final List<Video> videos,
@JsonKey(name: 'author_history') required final List<String> authors,
@JsonKey(name: 'total_authors_history')
required final List<String> authorsGlobal}) = _$ExerciseBaseDataImpl;
{required final int id,
required final String uuid,
@JsonKey(name: 'variations') final int? variationId,
@JsonKey(name: 'created') required final DateTime created,
@JsonKey(name: 'last_update') required final DateTime lastUpdate,
@JsonKey(name: 'last_update_global') required final DateTime lastUpdateGlobal,
required final ExerciseCategory category,
required final List<Muscle> muscles,
@JsonKey(name: 'muscles_secondary') required final List<Muscle> musclesSecondary,
required final List<Equipment> equipment,
@JsonKey(name: 'exercises') required final List<Translation> translations,
required final List<ExerciseImage> images,
required final List<Video> videos,
@JsonKey(name: 'author_history') required final List<String> authors,
@JsonKey(name: 'total_authors_history') required final List<String> authorsGlobal}) =
_$ExerciseBaseDataImpl;
factory _ExerciseBaseData.fromJson(Map<String, dynamic> json) =
_$ExerciseBaseDataImpl.fromJson;
factory _ExerciseBaseData.fromJson(Map<String, dynamic> json) = _$ExerciseBaseDataImpl.fromJson;
@override
int get id;
@@ -580,8 +559,7 @@ abstract class _ExerciseBaseData implements ExerciseApiData {
throw _privateConstructorUsedError;
}
ExerciseSearchDetails _$ExerciseSearchDetailsFromJson(
Map<String, dynamic> json) {
ExerciseSearchDetails _$ExerciseSearchDetailsFromJson(Map<String, dynamic> json) {
return _ExerciseSearchDetails.fromJson(json);
}
@@ -589,14 +567,12 @@ ExerciseSearchDetails _$ExerciseSearchDetailsFromJson(
mixin _$ExerciseSearchDetails {
// ignore: invalid_annotation_target
@JsonKey(name: 'id')
int get translationId =>
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
int get translationId => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
@JsonKey(name: 'base_id')
int get exerciseId => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
String get category => throw _privateConstructorUsedError;
String? get image =>
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
String? get image => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
@JsonKey(name: 'image_thumbnail')
String? get imageThumbnail => throw _privateConstructorUsedError;
@@ -612,8 +588,8 @@ mixin _$ExerciseSearchDetails {
/// @nodoc
abstract class $ExerciseSearchDetailsCopyWith<$Res> {
factory $ExerciseSearchDetailsCopyWith(ExerciseSearchDetails value,
$Res Function(ExerciseSearchDetails) then) =
factory $ExerciseSearchDetailsCopyWith(
ExerciseSearchDetails value, $Res Function(ExerciseSearchDetails) then) =
_$ExerciseSearchDetailsCopyWithImpl<$Res, ExerciseSearchDetails>;
@useResult
$Res call(
@@ -626,8 +602,7 @@ abstract class $ExerciseSearchDetailsCopyWith<$Res> {
}
/// @nodoc
class _$ExerciseSearchDetailsCopyWithImpl<$Res,
$Val extends ExerciseSearchDetails>
class _$ExerciseSearchDetailsCopyWithImpl<$Res, $Val extends ExerciseSearchDetails>
implements $ExerciseSearchDetailsCopyWith<$Res> {
_$ExerciseSearchDetailsCopyWithImpl(this._value, this._then);
@@ -681,8 +656,7 @@ class _$ExerciseSearchDetailsCopyWithImpl<$Res,
abstract class _$$ExerciseSearchDetailsImplCopyWith<$Res>
implements $ExerciseSearchDetailsCopyWith<$Res> {
factory _$$ExerciseSearchDetailsImplCopyWith(
_$ExerciseSearchDetailsImpl value,
$Res Function(_$ExerciseSearchDetailsImpl) then) =
_$ExerciseSearchDetailsImpl value, $Res Function(_$ExerciseSearchDetailsImpl) then) =
__$$ExerciseSearchDetailsImplCopyWithImpl<$Res>;
@override
@useResult
@@ -697,11 +671,10 @@ abstract class _$$ExerciseSearchDetailsImplCopyWith<$Res>
/// @nodoc
class __$$ExerciseSearchDetailsImplCopyWithImpl<$Res>
extends _$ExerciseSearchDetailsCopyWithImpl<$Res,
_$ExerciseSearchDetailsImpl>
extends _$ExerciseSearchDetailsCopyWithImpl<$Res, _$ExerciseSearchDetailsImpl>
implements _$$ExerciseSearchDetailsImplCopyWith<$Res> {
__$$ExerciseSearchDetailsImplCopyWithImpl(_$ExerciseSearchDetailsImpl _value,
$Res Function(_$ExerciseSearchDetailsImpl) _then)
__$$ExerciseSearchDetailsImplCopyWithImpl(
_$ExerciseSearchDetailsImpl _value, $Res Function(_$ExerciseSearchDetailsImpl) _then)
: super(_value, _then);
/// Create a copy of ExerciseSearchDetails
@@ -790,11 +763,9 @@ class _$ExerciseSearchDetailsImpl implements _ExerciseSearchDetails {
other is _$ExerciseSearchDetailsImpl &&
(identical(other.translationId, translationId) ||
other.translationId == translationId) &&
(identical(other.exerciseId, exerciseId) ||
other.exerciseId == exerciseId) &&
(identical(other.exerciseId, exerciseId) || other.exerciseId == exerciseId) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.category, category) ||
other.category == category) &&
(identical(other.category, category) || other.category == category) &&
(identical(other.image, image) || other.image == image) &&
(identical(other.imageThumbnail, imageThumbnail) ||
other.imageThumbnail == imageThumbnail));
@@ -802,17 +773,16 @@ class _$ExerciseSearchDetailsImpl implements _ExerciseSearchDetails {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, translationId, exerciseId, name,
category, image, imageThumbnail);
int get hashCode =>
Object.hash(runtimeType, translationId, exerciseId, name, category, image, imageThumbnail);
/// Create a copy of ExerciseSearchDetails
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ExerciseSearchDetailsImplCopyWith<_$ExerciseSearchDetailsImpl>
get copyWith => __$$ExerciseSearchDetailsImplCopyWithImpl<
_$ExerciseSearchDetailsImpl>(this, _$identity);
_$$ExerciseSearchDetailsImplCopyWith<_$ExerciseSearchDetailsImpl> get copyWith =>
__$$ExerciseSearchDetailsImplCopyWithImpl<_$ExerciseSearchDetailsImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -824,13 +794,13 @@ class _$ExerciseSearchDetailsImpl implements _ExerciseSearchDetails {
abstract class _ExerciseSearchDetails implements ExerciseSearchDetails {
factory _ExerciseSearchDetails(
{@JsonKey(name: 'id') required final int translationId,
@JsonKey(name: 'base_id') required final int exerciseId,
required final String name,
required final String category,
required final String? image,
@JsonKey(name: 'image_thumbnail')
required final String? imageThumbnail}) = _$ExerciseSearchDetailsImpl;
{@JsonKey(name: 'id') required final int translationId,
@JsonKey(name: 'base_id') required final int exerciseId,
required final String name,
required final String category,
required final String? image,
@JsonKey(name: 'image_thumbnail') required final String? imageThumbnail}) =
_$ExerciseSearchDetailsImpl;
factory _ExerciseSearchDetails.fromJson(Map<String, dynamic> json) =
_$ExerciseSearchDetailsImpl.fromJson;
@@ -856,8 +826,8 @@ abstract class _ExerciseSearchDetails implements ExerciseSearchDetails {
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ExerciseSearchDetailsImplCopyWith<_$ExerciseSearchDetailsImpl>
get copyWith => throw _privateConstructorUsedError;
_$$ExerciseSearchDetailsImplCopyWith<_$ExerciseSearchDetailsImpl> get copyWith =>
throw _privateConstructorUsedError;
}
ExerciseSearchEntry _$ExerciseSearchEntryFromJson(Map<String, dynamic> json) {
@@ -934,8 +904,8 @@ class _$ExerciseSearchEntryCopyWithImpl<$Res, $Val extends ExerciseSearchEntry>
/// @nodoc
abstract class _$$ExerciseSearchEntryImplCopyWith<$Res>
implements $ExerciseSearchEntryCopyWith<$Res> {
factory _$$ExerciseSearchEntryImplCopyWith(_$ExerciseSearchEntryImpl value,
$Res Function(_$ExerciseSearchEntryImpl) then) =
factory _$$ExerciseSearchEntryImplCopyWith(
_$ExerciseSearchEntryImpl value, $Res Function(_$ExerciseSearchEntryImpl) then) =
__$$ExerciseSearchEntryImplCopyWithImpl<$Res>;
@override
@useResult
@@ -949,8 +919,8 @@ abstract class _$$ExerciseSearchEntryImplCopyWith<$Res>
class __$$ExerciseSearchEntryImplCopyWithImpl<$Res>
extends _$ExerciseSearchEntryCopyWithImpl<$Res, _$ExerciseSearchEntryImpl>
implements _$$ExerciseSearchEntryImplCopyWith<$Res> {
__$$ExerciseSearchEntryImplCopyWithImpl(_$ExerciseSearchEntryImpl _value,
$Res Function(_$ExerciseSearchEntryImpl) _then)
__$$ExerciseSearchEntryImplCopyWithImpl(
_$ExerciseSearchEntryImpl _value, $Res Function(_$ExerciseSearchEntryImpl) _then)
: super(_value, _then);
/// Create a copy of ExerciseSearchEntry
@@ -1011,8 +981,7 @@ class _$ExerciseSearchEntryImpl implements _ExerciseSearchEntry {
@override
@pragma('vm:prefer-inline')
_$$ExerciseSearchEntryImplCopyWith<_$ExerciseSearchEntryImpl> get copyWith =>
__$$ExerciseSearchEntryImplCopyWithImpl<_$ExerciseSearchEntryImpl>(
this, _$identity);
__$$ExerciseSearchEntryImplCopyWithImpl<_$ExerciseSearchEntryImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -1049,8 +1018,7 @@ ExerciseApiSearch _$ExerciseApiSearchFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$ExerciseApiSearch {
List<ExerciseSearchEntry> get suggestions =>
throw _privateConstructorUsedError;
List<ExerciseSearchEntry> get suggestions => throw _privateConstructorUsedError;
/// Serializes this ExerciseApiSearch to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@@ -1058,8 +1026,7 @@ mixin _$ExerciseApiSearch {
/// Create a copy of ExerciseApiSearch
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ExerciseApiSearchCopyWith<ExerciseApiSearch> get copyWith =>
throw _privateConstructorUsedError;
$ExerciseApiSearchCopyWith<ExerciseApiSearch> get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
@@ -1098,10 +1065,9 @@ class _$ExerciseApiSearchCopyWithImpl<$Res, $Val extends ExerciseApiSearch>
}
/// @nodoc
abstract class _$$ExerciseApiSearchImplCopyWith<$Res>
implements $ExerciseApiSearchCopyWith<$Res> {
factory _$$ExerciseApiSearchImplCopyWith(_$ExerciseApiSearchImpl value,
$Res Function(_$ExerciseApiSearchImpl) then) =
abstract class _$$ExerciseApiSearchImplCopyWith<$Res> implements $ExerciseApiSearchCopyWith<$Res> {
factory _$$ExerciseApiSearchImplCopyWith(
_$ExerciseApiSearchImpl value, $Res Function(_$ExerciseApiSearchImpl) then) =
__$$ExerciseApiSearchImplCopyWithImpl<$Res>;
@override
@useResult
@@ -1112,8 +1078,8 @@ abstract class _$$ExerciseApiSearchImplCopyWith<$Res>
class __$$ExerciseApiSearchImplCopyWithImpl<$Res>
extends _$ExerciseApiSearchCopyWithImpl<$Res, _$ExerciseApiSearchImpl>
implements _$$ExerciseApiSearchImplCopyWith<$Res> {
__$$ExerciseApiSearchImplCopyWithImpl(_$ExerciseApiSearchImpl _value,
$Res Function(_$ExerciseApiSearchImpl) _then)
__$$ExerciseApiSearchImplCopyWithImpl(
_$ExerciseApiSearchImpl _value, $Res Function(_$ExerciseApiSearchImpl) _then)
: super(_value, _then);
/// Create a copy of ExerciseApiSearch
@@ -1135,8 +1101,7 @@ class __$$ExerciseApiSearchImplCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
class _$ExerciseApiSearchImpl implements _ExerciseApiSearch {
_$ExerciseApiSearchImpl(
{required final List<ExerciseSearchEntry> suggestions})
_$ExerciseApiSearchImpl({required final List<ExerciseSearchEntry> suggestions})
: _suggestions = suggestions;
factory _$ExerciseApiSearchImpl.fromJson(Map<String, dynamic> json) =>
@@ -1160,14 +1125,12 @@ class _$ExerciseApiSearchImpl implements _ExerciseApiSearch {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ExerciseApiSearchImpl &&
const DeepCollectionEquality()
.equals(other._suggestions, _suggestions));
const DeepCollectionEquality().equals(other._suggestions, _suggestions));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, const DeepCollectionEquality().hash(_suggestions));
int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_suggestions));
/// Create a copy of ExerciseApiSearch
/// with the given fields replaced by the non-null parameter values.
@@ -1175,8 +1138,7 @@ class _$ExerciseApiSearchImpl implements _ExerciseApiSearch {
@override
@pragma('vm:prefer-inline')
_$$ExerciseApiSearchImplCopyWith<_$ExerciseApiSearchImpl> get copyWith =>
__$$ExerciseApiSearchImplCopyWithImpl<_$ExerciseApiSearchImpl>(
this, _$identity);
__$$ExerciseApiSearchImplCopyWithImpl<_$ExerciseApiSearchImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -1187,12 +1149,10 @@ class _$ExerciseApiSearchImpl implements _ExerciseApiSearch {
}
abstract class _ExerciseApiSearch implements ExerciseApiSearch {
factory _ExerciseApiSearch(
{required final List<ExerciseSearchEntry> suggestions}) =
factory _ExerciseApiSearch({required final List<ExerciseSearchEntry> suggestions}) =
_$ExerciseApiSearchImpl;
factory _ExerciseApiSearch.fromJson(Map<String, dynamic> json) =
_$ExerciseApiSearchImpl.fromJson;
factory _ExerciseApiSearch.fromJson(Map<String, dynamic> json) = _$ExerciseApiSearchImpl.fromJson;
@override
List<ExerciseSearchEntry> get suggestions;

View File

@@ -6,8 +6,7 @@ part of 'exercise_api.dart';
// JsonSerializableGenerator
// **************************************************************************
_$ExerciseBaseDataImpl _$$ExerciseBaseDataImplFromJson(
Map<String, dynamic> json) =>
_$ExerciseBaseDataImpl _$$ExerciseBaseDataImplFromJson(Map<String, dynamic> json) =>
_$ExerciseBaseDataImpl(
id: (json['id'] as num).toInt(),
uuid: json['uuid'] as String,
@@ -15,8 +14,7 @@ _$ExerciseBaseDataImpl _$$ExerciseBaseDataImplFromJson(
created: DateTime.parse(json['created'] as String),
lastUpdate: DateTime.parse(json['last_update'] as String),
lastUpdateGlobal: DateTime.parse(json['last_update_global'] as String),
category:
ExerciseCategory.fromJson(json['category'] as Map<String, dynamic>),
category: ExerciseCategory.fromJson(json['category'] as Map<String, dynamic>),
muscles: (json['muscles'] as List<dynamic>)
.map((e) => Muscle.fromJson(e as Map<String, dynamic>))
.toList(),
@@ -35,16 +33,12 @@ _$ExerciseBaseDataImpl _$$ExerciseBaseDataImplFromJson(
videos: (json['videos'] as List<dynamic>)
.map((e) => Video.fromJson(e as Map<String, dynamic>))
.toList(),
authors: (json['author_history'] as List<dynamic>)
.map((e) => e as String)
.toList(),
authorsGlobal: (json['total_authors_history'] as List<dynamic>)
.map((e) => e as String)
.toList(),
authors: (json['author_history'] as List<dynamic>).map((e) => e as String).toList(),
authorsGlobal:
(json['total_authors_history'] as List<dynamic>).map((e) => e as String).toList(),
);
Map<String, dynamic> _$$ExerciseBaseDataImplToJson(
_$ExerciseBaseDataImpl instance) =>
Map<String, dynamic> _$$ExerciseBaseDataImplToJson(_$ExerciseBaseDataImpl instance) =>
<String, dynamic>{
'id': instance.id,
'uuid': instance.uuid,
@@ -63,8 +57,7 @@ Map<String, dynamic> _$$ExerciseBaseDataImplToJson(
'total_authors_history': instance.authorsGlobal,
};
_$ExerciseSearchDetailsImpl _$$ExerciseSearchDetailsImplFromJson(
Map<String, dynamic> json) =>
_$ExerciseSearchDetailsImpl _$$ExerciseSearchDetailsImplFromJson(Map<String, dynamic> json) =>
_$ExerciseSearchDetailsImpl(
translationId: (json['id'] as num).toInt(),
exerciseId: (json['base_id'] as num).toInt(),
@@ -74,8 +67,7 @@ _$ExerciseSearchDetailsImpl _$$ExerciseSearchDetailsImplFromJson(
imageThumbnail: json['image_thumbnail'] as String?,
);
Map<String, dynamic> _$$ExerciseSearchDetailsImplToJson(
_$ExerciseSearchDetailsImpl instance) =>
Map<String, dynamic> _$$ExerciseSearchDetailsImplToJson(_$ExerciseSearchDetailsImpl instance) =>
<String, dynamic>{
'id': instance.translationId,
'base_id': instance.exerciseId,
@@ -85,31 +77,26 @@ Map<String, dynamic> _$$ExerciseSearchDetailsImplToJson(
'image_thumbnail': instance.imageThumbnail,
};
_$ExerciseSearchEntryImpl _$$ExerciseSearchEntryImplFromJson(
Map<String, dynamic> json) =>
_$ExerciseSearchEntryImpl _$$ExerciseSearchEntryImplFromJson(Map<String, dynamic> json) =>
_$ExerciseSearchEntryImpl(
value: json['value'] as String,
data:
ExerciseSearchDetails.fromJson(json['data'] as Map<String, dynamic>),
data: ExerciseSearchDetails.fromJson(json['data'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$ExerciseSearchEntryImplToJson(
_$ExerciseSearchEntryImpl instance) =>
Map<String, dynamic> _$$ExerciseSearchEntryImplToJson(_$ExerciseSearchEntryImpl instance) =>
<String, dynamic>{
'value': instance.value,
'data': instance.data,
};
_$ExerciseApiSearchImpl _$$ExerciseApiSearchImplFromJson(
Map<String, dynamic> json) =>
_$ExerciseApiSearchImpl _$$ExerciseApiSearchImplFromJson(Map<String, dynamic> json) =>
_$ExerciseApiSearchImpl(
suggestions: (json['suggestions'] as List<dynamic>)
.map((e) => ExerciseSearchEntry.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$$ExerciseApiSearchImplToJson(
_$ExerciseApiSearchImpl instance) =>
Map<String, dynamic> _$$ExerciseApiSearchImplToJson(_$ExerciseApiSearchImpl instance) =>
<String, dynamic>{
'suggestions': instance.suggestions,
};

View File

@@ -20,8 +20,7 @@ ExerciseImage _$ExerciseImageFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$ExerciseImageToJson(ExerciseImage instance) =>
<String, dynamic>{
Map<String, dynamic> _$ExerciseImageToJson(ExerciseImage instance) => <String, dynamic>{
'id': instance.id,
'uuid': instance.uuid,
'exercise_base': instance.exerciseBaseId,

View File

@@ -14,8 +14,7 @@ T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
IngredientApiSearchDetails _$IngredientApiSearchDetailsFromJson(
Map<String, dynamic> json) {
IngredientApiSearchDetails _$IngredientApiSearchDetailsFromJson(Map<String, dynamic> json) {
return _IngredientApiSearchDetails.fromJson(json);
}
@@ -23,8 +22,7 @@ IngredientApiSearchDetails _$IngredientApiSearchDetailsFromJson(
mixin _$IngredientApiSearchDetails {
int get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
String? get image =>
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
String? get image => throw _privateConstructorUsedError; // ignore: invalid_annotation_target
@JsonKey(name: 'image_thumbnail')
String? get imageThumbnail => throw _privateConstructorUsedError;
@@ -34,16 +32,15 @@ mixin _$IngredientApiSearchDetails {
/// Create a copy of IngredientApiSearchDetails
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$IngredientApiSearchDetailsCopyWith<IngredientApiSearchDetails>
get copyWith => throw _privateConstructorUsedError;
$IngredientApiSearchDetailsCopyWith<IngredientApiSearchDetails> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $IngredientApiSearchDetailsCopyWith<$Res> {
factory $IngredientApiSearchDetailsCopyWith(IngredientApiSearchDetails value,
$Res Function(IngredientApiSearchDetails) then) =
_$IngredientApiSearchDetailsCopyWithImpl<$Res,
IngredientApiSearchDetails>;
factory $IngredientApiSearchDetailsCopyWith(
IngredientApiSearchDetails value, $Res Function(IngredientApiSearchDetails) then) =
_$IngredientApiSearchDetailsCopyWithImpl<$Res, IngredientApiSearchDetails>;
@useResult
$Res call(
{int id,
@@ -53,8 +50,7 @@ abstract class $IngredientApiSearchDetailsCopyWith<$Res> {
}
/// @nodoc
class _$IngredientApiSearchDetailsCopyWithImpl<$Res,
$Val extends IngredientApiSearchDetails>
class _$IngredientApiSearchDetailsCopyWithImpl<$Res, $Val extends IngredientApiSearchDetails>
implements $IngredientApiSearchDetailsCopyWith<$Res> {
_$IngredientApiSearchDetailsCopyWithImpl(this._value, this._then);
@@ -97,8 +93,7 @@ class _$IngredientApiSearchDetailsCopyWithImpl<$Res,
/// @nodoc
abstract class _$$IngredientApiSearchDetailsImplCopyWith<$Res>
implements $IngredientApiSearchDetailsCopyWith<$Res> {
factory _$$IngredientApiSearchDetailsImplCopyWith(
_$IngredientApiSearchDetailsImpl value,
factory _$$IngredientApiSearchDetailsImplCopyWith(_$IngredientApiSearchDetailsImpl value,
$Res Function(_$IngredientApiSearchDetailsImpl) then) =
__$$IngredientApiSearchDetailsImplCopyWithImpl<$Res>;
@override
@@ -112,11 +107,9 @@ abstract class _$$IngredientApiSearchDetailsImplCopyWith<$Res>
/// @nodoc
class __$$IngredientApiSearchDetailsImplCopyWithImpl<$Res>
extends _$IngredientApiSearchDetailsCopyWithImpl<$Res,
_$IngredientApiSearchDetailsImpl>
extends _$IngredientApiSearchDetailsCopyWithImpl<$Res, _$IngredientApiSearchDetailsImpl>
implements _$$IngredientApiSearchDetailsImplCopyWith<$Res> {
__$$IngredientApiSearchDetailsImplCopyWithImpl(
_$IngredientApiSearchDetailsImpl _value,
__$$IngredientApiSearchDetailsImplCopyWithImpl(_$IngredientApiSearchDetailsImpl _value,
$Res Function(_$IngredientApiSearchDetailsImpl) _then)
: super(_value, _then);
@@ -160,8 +153,7 @@ class _$IngredientApiSearchDetailsImpl implements _IngredientApiSearchDetails {
required this.image,
@JsonKey(name: 'image_thumbnail') required this.imageThumbnail});
factory _$IngredientApiSearchDetailsImpl.fromJson(
Map<String, dynamic> json) =>
factory _$IngredientApiSearchDetailsImpl.fromJson(Map<String, dynamic> json) =>
_$$IngredientApiSearchDetailsImplFromJson(json);
@override
@@ -201,9 +193,9 @@ class _$IngredientApiSearchDetailsImpl implements _IngredientApiSearchDetails {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$IngredientApiSearchDetailsImplCopyWith<_$IngredientApiSearchDetailsImpl>
get copyWith => __$$IngredientApiSearchDetailsImplCopyWithImpl<
_$IngredientApiSearchDetailsImpl>(this, _$identity);
_$$IngredientApiSearchDetailsImplCopyWith<_$IngredientApiSearchDetailsImpl> get copyWith =>
__$$IngredientApiSearchDetailsImplCopyWithImpl<_$IngredientApiSearchDetailsImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -213,14 +205,12 @@ class _$IngredientApiSearchDetailsImpl implements _IngredientApiSearchDetails {
}
}
abstract class _IngredientApiSearchDetails
implements IngredientApiSearchDetails {
abstract class _IngredientApiSearchDetails implements IngredientApiSearchDetails {
factory _IngredientApiSearchDetails(
{required final int id,
required final String name,
required final String? image,
@JsonKey(name: 'image_thumbnail')
required final String? imageThumbnail}) =
@JsonKey(name: 'image_thumbnail') required final String? imageThumbnail}) =
_$IngredientApiSearchDetailsImpl;
factory _IngredientApiSearchDetails.fromJson(Map<String, dynamic> json) =
@@ -240,12 +230,11 @@ abstract class _IngredientApiSearchDetails
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$IngredientApiSearchDetailsImplCopyWith<_$IngredientApiSearchDetailsImpl>
get copyWith => throw _privateConstructorUsedError;
_$$IngredientApiSearchDetailsImplCopyWith<_$IngredientApiSearchDetailsImpl> get copyWith =>
throw _privateConstructorUsedError;
}
IngredientApiSearchEntry _$IngredientApiSearchEntryFromJson(
Map<String, dynamic> json) {
IngredientApiSearchEntry _$IngredientApiSearchEntryFromJson(Map<String, dynamic> json) {
return _IngredientApiSearchEntry.fromJson(json);
}
@@ -266,8 +255,8 @@ mixin _$IngredientApiSearchEntry {
/// @nodoc
abstract class $IngredientApiSearchEntryCopyWith<$Res> {
factory $IngredientApiSearchEntryCopyWith(IngredientApiSearchEntry value,
$Res Function(IngredientApiSearchEntry) then) =
factory $IngredientApiSearchEntryCopyWith(
IngredientApiSearchEntry value, $Res Function(IngredientApiSearchEntry) then) =
_$IngredientApiSearchEntryCopyWithImpl<$Res, IngredientApiSearchEntry>;
@useResult
$Res call({String value, IngredientApiSearchDetails data});
@@ -276,8 +265,7 @@ abstract class $IngredientApiSearchEntryCopyWith<$Res> {
}
/// @nodoc
class _$IngredientApiSearchEntryCopyWithImpl<$Res,
$Val extends IngredientApiSearchEntry>
class _$IngredientApiSearchEntryCopyWithImpl<$Res, $Val extends IngredientApiSearchEntry>
implements $IngredientApiSearchEntryCopyWith<$Res> {
_$IngredientApiSearchEntryCopyWithImpl(this._value, this._then);
@@ -320,8 +308,7 @@ class _$IngredientApiSearchEntryCopyWithImpl<$Res,
/// @nodoc
abstract class _$$IngredientApiSearchEntryImplCopyWith<$Res>
implements $IngredientApiSearchEntryCopyWith<$Res> {
factory _$$IngredientApiSearchEntryImplCopyWith(
_$IngredientApiSearchEntryImpl value,
factory _$$IngredientApiSearchEntryImplCopyWith(_$IngredientApiSearchEntryImpl value,
$Res Function(_$IngredientApiSearchEntryImpl) then) =
__$$IngredientApiSearchEntryImplCopyWithImpl<$Res>;
@override
@@ -334,12 +321,10 @@ abstract class _$$IngredientApiSearchEntryImplCopyWith<$Res>
/// @nodoc
class __$$IngredientApiSearchEntryImplCopyWithImpl<$Res>
extends _$IngredientApiSearchEntryCopyWithImpl<$Res,
_$IngredientApiSearchEntryImpl>
extends _$IngredientApiSearchEntryCopyWithImpl<$Res, _$IngredientApiSearchEntryImpl>
implements _$$IngredientApiSearchEntryImplCopyWith<$Res> {
__$$IngredientApiSearchEntryImplCopyWithImpl(
_$IngredientApiSearchEntryImpl _value,
$Res Function(_$IngredientApiSearchEntryImpl) _then)
_$IngredientApiSearchEntryImpl _value, $Res Function(_$IngredientApiSearchEntryImpl) _then)
: super(_value, _then);
/// Create a copy of IngredientApiSearchEntry
@@ -399,9 +384,9 @@ class _$IngredientApiSearchEntryImpl implements _IngredientApiSearchEntry {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$IngredientApiSearchEntryImplCopyWith<_$IngredientApiSearchEntryImpl>
get copyWith => __$$IngredientApiSearchEntryImplCopyWithImpl<
_$IngredientApiSearchEntryImpl>(this, _$identity);
_$$IngredientApiSearchEntryImplCopyWith<_$IngredientApiSearchEntryImpl> get copyWith =>
__$$IngredientApiSearchEntryImplCopyWithImpl<_$IngredientApiSearchEntryImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -413,9 +398,8 @@ class _$IngredientApiSearchEntryImpl implements _IngredientApiSearchEntry {
abstract class _IngredientApiSearchEntry implements IngredientApiSearchEntry {
factory _IngredientApiSearchEntry(
{required final String value,
required final IngredientApiSearchDetails data}) =
_$IngredientApiSearchEntryImpl;
{required final String value,
required final IngredientApiSearchDetails data}) = _$IngredientApiSearchEntryImpl;
factory _IngredientApiSearchEntry.fromJson(Map<String, dynamic> json) =
_$IngredientApiSearchEntryImpl.fromJson;
@@ -429,8 +413,8 @@ abstract class _IngredientApiSearchEntry implements IngredientApiSearchEntry {
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$IngredientApiSearchEntryImplCopyWith<_$IngredientApiSearchEntryImpl>
get copyWith => throw _privateConstructorUsedError;
_$$IngredientApiSearchEntryImplCopyWith<_$IngredientApiSearchEntryImpl> get copyWith =>
throw _privateConstructorUsedError;
}
IngredientApiSearch _$IngredientApiSearchFromJson(Map<String, dynamic> json) {
@@ -439,8 +423,7 @@ IngredientApiSearch _$IngredientApiSearchFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$IngredientApiSearch {
List<IngredientApiSearchEntry> get suggestions =>
throw _privateConstructorUsedError;
List<IngredientApiSearchEntry> get suggestions => throw _privateConstructorUsedError;
/// Serializes this IngredientApiSearch to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@@ -490,8 +473,8 @@ class _$IngredientApiSearchCopyWithImpl<$Res, $Val extends IngredientApiSearch>
/// @nodoc
abstract class _$$IngredientApiSearchImplCopyWith<$Res>
implements $IngredientApiSearchCopyWith<$Res> {
factory _$$IngredientApiSearchImplCopyWith(_$IngredientApiSearchImpl value,
$Res Function(_$IngredientApiSearchImpl) then) =
factory _$$IngredientApiSearchImplCopyWith(
_$IngredientApiSearchImpl value, $Res Function(_$IngredientApiSearchImpl) then) =
__$$IngredientApiSearchImplCopyWithImpl<$Res>;
@override
@useResult
@@ -502,8 +485,8 @@ abstract class _$$IngredientApiSearchImplCopyWith<$Res>
class __$$IngredientApiSearchImplCopyWithImpl<$Res>
extends _$IngredientApiSearchCopyWithImpl<$Res, _$IngredientApiSearchImpl>
implements _$$IngredientApiSearchImplCopyWith<$Res> {
__$$IngredientApiSearchImplCopyWithImpl(_$IngredientApiSearchImpl _value,
$Res Function(_$IngredientApiSearchImpl) _then)
__$$IngredientApiSearchImplCopyWithImpl(
_$IngredientApiSearchImpl _value, $Res Function(_$IngredientApiSearchImpl) _then)
: super(_value, _then);
/// Create a copy of IngredientApiSearch
@@ -525,8 +508,7 @@ class __$$IngredientApiSearchImplCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
class _$IngredientApiSearchImpl implements _IngredientApiSearch {
_$IngredientApiSearchImpl(
{required final List<IngredientApiSearchEntry> suggestions})
_$IngredientApiSearchImpl({required final List<IngredientApiSearchEntry> suggestions})
: _suggestions = suggestions;
factory _$IngredientApiSearchImpl.fromJson(Map<String, dynamic> json) =>
@@ -550,14 +532,12 @@ class _$IngredientApiSearchImpl implements _IngredientApiSearch {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$IngredientApiSearchImpl &&
const DeepCollectionEquality()
.equals(other._suggestions, _suggestions));
const DeepCollectionEquality().equals(other._suggestions, _suggestions));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, const DeepCollectionEquality().hash(_suggestions));
int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_suggestions));
/// Create a copy of IngredientApiSearch
/// with the given fields replaced by the non-null parameter values.
@@ -565,8 +545,7 @@ class _$IngredientApiSearchImpl implements _IngredientApiSearch {
@override
@pragma('vm:prefer-inline')
_$$IngredientApiSearchImplCopyWith<_$IngredientApiSearchImpl> get copyWith =>
__$$IngredientApiSearchImplCopyWithImpl<_$IngredientApiSearchImpl>(
this, _$identity);
__$$IngredientApiSearchImplCopyWithImpl<_$IngredientApiSearchImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -577,8 +556,7 @@ class _$IngredientApiSearchImpl implements _IngredientApiSearch {
}
abstract class _IngredientApiSearch implements IngredientApiSearch {
factory _IngredientApiSearch(
{required final List<IngredientApiSearchEntry> suggestions}) =
factory _IngredientApiSearch({required final List<IngredientApiSearchEntry> suggestions}) =
_$IngredientApiSearchImpl;
factory _IngredientApiSearch.fromJson(Map<String, dynamic> json) =

View File

@@ -24,12 +24,10 @@ Map<String, dynamic> _$$IngredientApiSearchDetailsImplToJson(
'image_thumbnail': instance.imageThumbnail,
};
_$IngredientApiSearchEntryImpl _$$IngredientApiSearchEntryImplFromJson(
Map<String, dynamic> json) =>
_$IngredientApiSearchEntryImpl _$$IngredientApiSearchEntryImplFromJson(Map<String, dynamic> json) =>
_$IngredientApiSearchEntryImpl(
value: json['value'] as String,
data: IngredientApiSearchDetails.fromJson(
json['data'] as Map<String, dynamic>),
data: IngredientApiSearchDetails.fromJson(json['data'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$IngredientApiSearchEntryImplToJson(
@@ -39,17 +37,14 @@ Map<String, dynamic> _$$IngredientApiSearchEntryImplToJson(
'data': instance.data,
};
_$IngredientApiSearchImpl _$$IngredientApiSearchImplFromJson(
Map<String, dynamic> json) =>
_$IngredientApiSearchImpl _$$IngredientApiSearchImplFromJson(Map<String, dynamic> json) =>
_$IngredientApiSearchImpl(
suggestions: (json['suggestions'] as List<dynamic>)
.map((e) =>
IngredientApiSearchEntry.fromJson(e as Map<String, dynamic>))
.map((e) => IngredientApiSearchEntry.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$$IngredientApiSearchImplToJson(
_$IngredientApiSearchImpl instance) =>
Map<String, dynamic> _$$IngredientApiSearchImplToJson(_$IngredientApiSearchImpl instance) =>
<String, dynamic>{
'suggestions': instance.suggestions,
};

View File

@@ -22,9 +22,7 @@ Translation _$TranslationFromJson(Map<String, dynamic> json) {
return Translation(
id: (json['id'] as num?)?.toInt(),
uuid: json['uuid'] as String?,
created: json['created'] == null
? null
: DateTime.parse(json['created'] 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 num?)?.toInt(),
@@ -38,8 +36,7 @@ Translation _$TranslationFromJson(Map<String, dynamic> json) {
.toList();
}
Map<String, dynamic> _$TranslationToJson(Translation instance) =>
<String, dynamic>{
Map<String, dynamic> _$TranslationToJson(Translation instance) => <String, dynamic>{
'id': instance.id,
'uuid': instance.uuid,
'language': instance.languageId,

View File

@@ -22,9 +22,7 @@ MeasurementCategory _$MeasurementCategoryFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$MeasurementCategoryToJson(
MeasurementCategory instance) =>
<String, dynamic>{
Map<String, dynamic> _$MeasurementCategoryToJson(MeasurementCategory instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
'unit': instance.unit,

View File

@@ -20,8 +20,7 @@ MeasurementEntry _$MeasurementEntryFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$MeasurementEntryToJson(MeasurementEntry instance) =>
<String, dynamic>{
Map<String, dynamic> _$MeasurementEntryToJson(MeasurementEntry instance) => <String, dynamic>{
'id': instance.id,
'category': instance.category,
'date': toDate(instance.date),

View File

@@ -51,8 +51,7 @@ Ingredient _$IngredientFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$IngredientToJson(Ingredient instance) =>
<String, dynamic>{
Map<String, dynamic> _$IngredientToJson(Ingredient instance) => <String, dynamic>{
'id': instance.id,
'remote_id': instance.remoteId,
'source_name': instance.sourceName,

View File

@@ -38,8 +38,7 @@ IngredientImage _$IngredientImageFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$IngredientImageToJson(IngredientImage instance) =>
<String, dynamic>{
Map<String, dynamic> _$IngredientImageToJson(IngredientImage instance) => <String, dynamic>{
'id': instance.id,
'uuid': instance.uuid,
'ingredient_id': instance.ingredientId,

View File

@@ -13,16 +13,14 @@ IngredientWeightUnit _$IngredientWeightUnitFromJson(Map<String, dynamic> json) {
);
return IngredientWeightUnit(
id: (json['id'] as num).toInt(),
weightUnit:
WeightUnit.fromJson(json['weight_unit'] as Map<String, dynamic>),
weightUnit: WeightUnit.fromJson(json['weight_unit'] as Map<String, dynamic>),
ingredient: Ingredient.fromJson(json['ingredient'] as Map<String, dynamic>),
grams: (json['grams'] as num).toInt(),
amount: (json['amount'] as num).toDouble(),
);
}
Map<String, dynamic> _$IngredientWeightUnitToJson(
IngredientWeightUnit instance) =>
Map<String, dynamic> _$IngredientWeightUnitToJson(IngredientWeightUnit instance) =>
<String, dynamic>{
'id': instance.id,
'weight_unit': instance.weightUnit,

View File

@@ -9,14 +9,7 @@ part of 'log.dart';
Log _$LogFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const [
'id',
'plan',
'datetime',
'ingredient',
'weight_unit',
'amount'
],
requiredKeys: const ['id', 'plan', 'datetime', 'ingredient', 'weight_unit', 'amount'],
);
return Log(
id: (json['id'] as num?)?.toInt(),

View File

@@ -34,8 +34,7 @@ NutritionalPlan _$NutritionalPlanFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$NutritionalPlanToJson(NutritionalPlan instance) =>
<String, dynamic>{
Map<String, dynamic> _$NutritionalPlanToJson(NutritionalPlan instance) => <String, dynamic>{
'id': instance.id,
'description': instance.description,
'creation_date': toDate(instance.creationDate),

View File

@@ -17,8 +17,7 @@ WeightUnit _$WeightUnitFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$WeightUnitToJson(WeightUnit instance) =>
<String, dynamic>{
Map<String, dynamic> _$WeightUnitToJson(WeightUnit instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
};

View File

@@ -9,13 +9,7 @@ part of 'profile.dart';
Profile _$ProfileFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const [
'username',
'email_verified',
'is_trustworthy',
'weight_unit',
'email'
],
requiredKeys: const ['username', 'email_verified', 'is_trustworthy', 'weight_unit', 'email'],
);
return Profile(
username: json['username'] as String,

View File

@@ -15,8 +15,7 @@ Day _$DayFromJson(Map<String, dynamic> json) {
..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 num).toInt()).toList();
..daysOfWeek = (json['day'] as List<dynamic>).map((e) => (e as num).toInt()).toList();
}
Map<String, dynamic> _$DayToJson(Day instance) => <String, dynamic>{

View File

@@ -17,8 +17,7 @@ RepetitionUnit _$RepetitionUnitFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$RepetitionUnitToJson(RepetitionUnit instance) =>
<String, dynamic>{
Map<String, dynamic> _$RepetitionUnitToJson(RepetitionUnit instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
};

View File

@@ -9,14 +9,7 @@ part of 'session.dart';
WorkoutSession _$WorkoutSessionFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const [
'id',
'workout',
'date',
'impression',
'time_start',
'time_end'
],
requiredKeys: const ['id', 'workout', 'date', 'impression', 'time_start', 'time_end'],
);
return WorkoutSession()
..id = (json['id'] as num?)?.toInt()
@@ -28,8 +21,7 @@ WorkoutSession _$WorkoutSessionFromJson(Map<String, dynamic> json) {
..timeEnd = stringToTime(json['time_end'] as String?);
}
Map<String, dynamic> _$WorkoutSessionToJson(WorkoutSession instance) =>
<String, dynamic>{
Map<String, dynamic> _$WorkoutSessionToJson(WorkoutSession instance) => <String, dynamic>{
'id': instance.id,
'workout': instance.workoutId,
'date': toDate(instance.date),

View File

@@ -17,8 +17,7 @@ WeightUnit _$WeightUnitFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$WeightUnitToJson(WeightUnit instance) =>
<String, dynamic>{
Map<String, dynamic> _$WeightUnitToJson(WeightUnit instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
};

View File

@@ -19,8 +19,7 @@ WorkoutPlan _$WorkoutPlanFromJson(Map<String, dynamic> json) {
);
}
Map<String, dynamic> _$WorkoutPlanToJson(WorkoutPlan instance) =>
<String, dynamic>{
Map<String, dynamic> _$WorkoutPlanToJson(WorkoutPlan instance) => <String, dynamic>{
'id': instance.id,
'creation_date': instance.creationDate.toIso8601String(),
'name': instance.name,

View File

@@ -54,15 +54,8 @@ class AuthProvider with ChangeNotifier {
AuthProvider([http.Client? client, bool? checkMetadata]) {
this.client = client ?? http.Client();
_loadThemeMode();
}
bool _isLightTheme = false;
ThemeMode _themeMode = ThemeMode.light;
bool get isSwitched => _isLightTheme;
ThemeMode get themeMode => _themeMode;
/// flag to indicate that the application has successfully loaded all initial data
bool dataInit = false;
@@ -70,27 +63,6 @@ class AuthProvider with ChangeNotifier {
return token != null;
}
// Load theme mode from SharedPreferences
Future<void> _loadThemeMode() async {
final prefs = await SharedPreferences.getInstance();
final isDarkMode = prefs.getBool('isDarkMode') ?? false; // Default to false (light mode)
_themeMode = isDarkMode ? ThemeMode.dark : ThemeMode.light;
_isLightTheme = isDarkMode;
notifyListeners(); // Notify listeners when theme is loaded
}
// Change mode on switch button click
void toggleSwitch(bool value) async {
_isLightTheme = value;
_themeMode = value ? ThemeMode.dark : ThemeMode.light;
// Save to SharedPreferences
final prefs = await SharedPreferences.getInstance();
await prefs.setBool('isDarkMode', _isLightTheme);
notifyListeners(); // Notify listeners when the theme is updated
}
/// Server application version
Future<void> setServerVersion() async {
final response = await client.get(makeUri(serverUrl!, SERVER_VERSION_URL));

View File

@@ -19,17 +19,22 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:wger/helpers/consts.dart';
import 'package:wger/models/user/profile.dart';
import 'package:wger/providers/base_provider.dart';
class UserProvider with ChangeNotifier {
ThemeMode themeMode = ThemeMode.system;
final WgerBaseProvider baseProvider;
UserProvider(this.baseProvider);
UserProvider(this.baseProvider) {
_loadThemeMode();
}
static const PROFILE_URL = 'userprofile';
static const VERIFY_EMAIL = 'verify-email';
Profile? profile;
/// Clear the current profile
@@ -37,6 +42,35 @@ class UserProvider with ChangeNotifier {
profile = null;
}
// Load theme mode from SharedPreferences
Future<void> _loadThemeMode() async {
final prefs = SharedPreferencesAsync();
final prefsDarkMode = await prefs.getBool(PREFS_USER_DARK_THEME);
if (prefsDarkMode == null) {
themeMode = ThemeMode.system;
} else {
themeMode = prefsDarkMode ? ThemeMode.dark : ThemeMode.light;
}
notifyListeners();
}
// Change mode on switch button click
void setThemeMode(ThemeMode mode) async {
themeMode = mode;
// Save to SharedPreferences
final prefs = SharedPreferencesAsync();
if (themeMode == ThemeMode.system) {
await prefs.remove(PREFS_USER_DARK_THEME);
} else {
await prefs.setBool(PREFS_USER_DARK_THEME, themeMode == ThemeMode.dark);
}
notifyListeners();
}
/// Fetch the current user's profile
Future<void> fetchAndSetProfile() async {
final userData = await baseProvider.fetch(baseProvider.makeUrl(PROFILE_URL));

View File

@@ -20,12 +20,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:provider/provider.dart';
import 'package:wger/providers/auth.dart';
import 'package:wger/providers/exercises.dart';
import 'package:wger/providers/nutrition.dart';
import 'package:wger/providers/user.dart';
import 'package:wger/theme/theme.dart';
class SettingsPage extends StatelessWidget {
static String routeName = '/SettingsPage';
@@ -36,16 +33,15 @@ class SettingsPage extends StatelessWidget {
Widget build(BuildContext context) {
final exerciseProvider = Provider.of<ExercisesProvider>(context, listen: false);
final nutritionProvider = Provider.of<NutritionPlansProvider>(context, listen: false);
final switchProvider = Provider.of<AuthProvider>(context);
final userProvider = Provider.of<UserProvider>(context);
final i18n = AppLocalizations.of(context);
return Scaffold(
appBar: AppBar(
title: Text(AppLocalizations.of(context).settingsTitle),
),
appBar: AppBar(title: Text(i18n.settingsTitle)),
body: ListView(
children: [
ListTile(
title: Text(AppLocalizations.of(context).settingsExerciseCacheDescription),
title: Text(i18n.settingsExerciseCacheDescription),
trailing: IconButton(
key: const ValueKey('cacheIconExercises'),
icon: const Icon(Icons.delete),
@@ -54,7 +50,7 @@ class SettingsPage extends StatelessWidget {
if (context.mounted) {
final snackBar = SnackBar(
content: Text(AppLocalizations.of(context).settingsCacheDeletedSnackbar),
content: Text(i18n.settingsCacheDeletedSnackbar),
);
ScaffoldMessenger.of(context).showSnackBar(snackBar);
@@ -63,7 +59,7 @@ class SettingsPage extends StatelessWidget {
),
),
ListTile(
title: Text(AppLocalizations.of(context).settingsIngredientCacheDescription),
title: Text(i18n.settingsIngredientCacheDescription),
trailing: IconButton(
key: const ValueKey('cacheIconIngredients'),
icon: const Icon(Icons.delete),
@@ -72,7 +68,7 @@ class SettingsPage extends StatelessWidget {
if (context.mounted) {
final snackBar = SnackBar(
content: Text(AppLocalizations.of(context).settingsCacheDeletedSnackbar),
content: Text(i18n.settingsCacheDeletedSnackbar),
);
ScaffoldMessenger.of(context).showSnackBar(snackBar);
@@ -81,15 +77,32 @@ class SettingsPage extends StatelessWidget {
),
),
ListTile(
title: Text(AppLocalizations.of(context).darkMode),
trailing: Switch(
value: switchProvider.isSwitched, // Use the state from the provider
onChanged: (value) {
switchProvider.toggleSwitch(value); // Update the state when the switch is toggled
title: Text(i18n.themeMode),
trailing: DropdownButton<ThemeMode>(
key: const ValueKey('themeModeDropdown'),
value: userProvider.themeMode,
onChanged: (ThemeMode? newValue) {
if (newValue != null) {
userProvider.setThemeMode(newValue);
}
},
activeColor: wgerPrimaryButtonColor, // Custom color when switch is on
inactiveThumbColor: wgerSecondaryColorLight, // Custom color when switch is off
inactiveTrackColor: wgerSecondaryColor, // Color of the track when the switch is off
items: ThemeMode.values.map<DropdownMenuItem<ThemeMode>>((ThemeMode value) {
final label = (() {
switch (value) {
case ThemeMode.system:
return i18n.systemMode;
case ThemeMode.light:
return i18n.lightMode;
case ThemeMode.dark:
return i18n.darkMode;
}
})();
return DropdownMenuItem<ThemeMode>(
value: value,
child: Text(label),
);
}).toList(),
),
),
],

View File

@@ -77,8 +77,14 @@ List<Widget> getOverviewWidgetsSeries(
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Indicator(color: Theme.of(context).colorScheme.primary, text: AppLocalizations.of(context).indicatorRaw, isSquare: true),
Indicator(color: Theme.of(context).colorScheme.tertiary, text: AppLocalizations.of(context).indicatorAvg, isSquare: true),
Indicator(
color: Theme.of(context).colorScheme.primary,
text: AppLocalizations.of(context).indicatorRaw,
isSquare: true),
Indicator(
color: Theme.of(context).colorScheme.tertiary,
text: AppLocalizations.of(context).indicatorAvg,
isSquare: true),
],
),
];

View File

@@ -1170,7 +1170,7 @@ packages:
source: hosted
version: "2.4.1"
shared_preferences_platform_interface:
dependency: transitive
dependency: "direct dev"
description:
name: shared_preferences_platform_interface
sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80"

View File

@@ -86,6 +86,7 @@ dev_dependencies:
json_serializable: ^6.9.0
mockito: ^5.4.4
network_image_mock: ^2.1.1
shared_preferences_platform_interface: ^2.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

View File

@@ -34,8 +34,7 @@ class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response {
);
}
class _FakeStreamedResponse_1 extends _i1.SmartFake
implements _i2.StreamedResponse {
class _FakeStreamedResponse_1 extends _i1.SmartFake implements _i2.StreamedResponse {
_FakeStreamedResponse_1(
Object parent,
Invocation parentInvocation,
@@ -255,14 +254,12 @@ class MockClient extends _i1.Mock implements _i2.Client {
) as _i3.Future<_i6.Uint8List>);
@override
_i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) =>
(super.noSuchMethod(
_i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod(
Invocation.method(
#send,
[request],
),
returnValue:
_i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1(
returnValue: _i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1(
this,
Invocation.method(
#send,

View File

@@ -24,20 +24,27 @@ import 'package:mockito/mockito.dart';
import 'package:provider/provider.dart';
import 'package:wger/providers/exercises.dart';
import 'package:wger/providers/nutrition.dart';
import 'package:wger/providers/user.dart';
import 'package:wger/widgets/core/settings.dart';
import 'settings_test.mocks.dart';
@GenerateMocks([ExercisesProvider, NutritionPlansProvider])
@GenerateMocks([ExercisesProvider, NutritionPlansProvider, UserProvider])
void main() {
final mockExerciseProvider = MockExercisesProvider();
final mockNutritionProvider = MockNutritionPlansProvider();
final mockUserProvider = MockUserProvider();
setUp(() {
when(mockUserProvider.themeMode).thenReturn(ThemeMode.system);
});
Widget createSettingsScreen({locale = 'en'}) {
return MultiProvider(
providers: [
ChangeNotifierProvider<NutritionPlansProvider>(create: (context) => mockNutritionProvider),
ChangeNotifierProvider<ExercisesProvider>(create: (context) => mockExerciseProvider),
ChangeNotifierProvider<UserProvider>(create: (context) => mockUserProvider),
],
child: MaterialApp(
locale: Locale(locale),
@@ -65,4 +72,13 @@ void main() {
verify(mockNutritionProvider.clearIngredientCache());
});
});
testWidgets('Test changing the theme mode', (WidgetTester tester) async {
await tester.pumpWidget(createSettingsScreen());
await tester.tap(find.byKey(const ValueKey('themeModeDropdown')));
await tester.pumpAndSettle();
await tester.tap(find.text('Always light mode'));
verify(mockUserProvider.setThemeMode(ThemeMode.light));
});
}

View File

@@ -6,6 +6,7 @@
import 'dart:async' as _i15;
import 'dart:ui' as _i16;
import 'package:flutter/material.dart' as _i20;
import 'package:mockito/mockito.dart' as _i1;
import 'package:wger/database/exercises/exercise_database.dart' as _i3;
import 'package:wger/database/ingredients/ingredients_database.dart' as _i9;
@@ -19,9 +20,11 @@ import 'package:wger/models/nutrition/ingredient.dart' as _i13;
import 'package:wger/models/nutrition/meal.dart' as _i11;
import 'package:wger/models/nutrition/meal_item.dart' as _i12;
import 'package:wger/models/nutrition/nutritional_plan.dart' as _i10;
import 'package:wger/models/user/profile.dart' as _i21;
import 'package:wger/providers/base_provider.dart' as _i2;
import 'package:wger/providers/exercises.dart' as _i14;
import 'package:wger/providers/nutrition.dart' as _i17;
import 'package:wger/providers/user.dart' as _i19;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
@@ -36,8 +39,7 @@ import 'package:wger/providers/nutrition.dart' as _i17;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
implements _i2.WgerBaseProvider {
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
_FakeWgerBaseProvider_0(
Object parent,
Invocation parentInvocation,
@@ -47,8 +49,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake
);
}
class _FakeExerciseDatabase_1 extends _i1.SmartFake
implements _i3.ExerciseDatabase {
class _FakeExerciseDatabase_1 extends _i1.SmartFake implements _i3.ExerciseDatabase {
_FakeExerciseDatabase_1(
Object parent,
Invocation parentInvocation,
@@ -68,8 +69,7 @@ class _FakeExercise_2 extends _i1.SmartFake implements _i4.Exercise {
);
}
class _FakeExerciseCategory_3 extends _i1.SmartFake
implements _i5.ExerciseCategory {
class _FakeExerciseCategory_3 extends _i1.SmartFake implements _i5.ExerciseCategory {
_FakeExerciseCategory_3(
Object parent,
Invocation parentInvocation,
@@ -109,8 +109,7 @@ class _FakeLanguage_6 extends _i1.SmartFake implements _i8.Language {
);
}
class _FakeIngredientDatabase_7 extends _i1.SmartFake
implements _i9.IngredientDatabase {
class _FakeIngredientDatabase_7 extends _i1.SmartFake implements _i9.IngredientDatabase {
_FakeIngredientDatabase_7(
Object parent,
Invocation parentInvocation,
@@ -120,8 +119,7 @@ class _FakeIngredientDatabase_7 extends _i1.SmartFake
);
}
class _FakeNutritionalPlan_8 extends _i1.SmartFake
implements _i10.NutritionalPlan {
class _FakeNutritionalPlan_8 extends _i1.SmartFake implements _i10.NutritionalPlan {
_FakeNutritionalPlan_8(
Object parent,
Invocation parentInvocation,
@@ -218,8 +216,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
) as List<_i4.Exercise>);
@override
set filteredExercises(List<_i4.Exercise>? newFilteredExercises) =>
super.noSuchMethod(
set filteredExercises(List<_i4.Exercise>? newFilteredExercises) => super.noSuchMethod(
Invocation.setter(
#filteredExercises,
newFilteredExercises,
@@ -228,8 +225,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
);
@override
Map<int, List<_i4.Exercise>> get exerciseBasesByVariation =>
(super.noSuchMethod(
Map<int, List<_i4.Exercise>> get exerciseBasesByVariation => (super.noSuchMethod(
Invocation.getter(#exerciseBasesByVariation),
returnValue: <int, List<_i4.Exercise>>{},
) as Map<int, List<_i4.Exercise>>);
@@ -441,8 +437,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
) as _i15.Future<void>);
@override
_i15.Future<_i4.Exercise> fetchAndSetExercise(int? exerciseId) =>
(super.noSuchMethod(
_i15.Future<_i4.Exercise> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetExercise,
[exerciseId],
@@ -482,8 +477,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
) as _i15.Future<_i4.Exercise>);
@override
_i15.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) =>
(super.noSuchMethod(
_i15.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod(
Invocation.method(
#initCacheTimesLocalPrefs,
[],
@@ -529,8 +523,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
) as _i15.Future<void>);
@override
_i15.Future<void> updateExerciseCache(_i3.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i15.Future<void> updateExerciseCache(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#updateExerciseCache,
[database],
@@ -540,8 +533,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
) as _i15.Future<void>);
@override
_i15.Future<void> fetchAndSetMuscles(_i3.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i15.Future<void> fetchAndSetMuscles(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetMuscles,
[database],
@@ -551,8 +543,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
) as _i15.Future<void>);
@override
_i15.Future<void> fetchAndSetCategories(_i3.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i15.Future<void> fetchAndSetCategories(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetCategories,
[database],
@@ -562,8 +553,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
) as _i15.Future<void>);
@override
_i15.Future<void> fetchAndSetLanguages(_i3.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i15.Future<void> fetchAndSetLanguages(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetLanguages,
[database],
@@ -573,8 +563,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
) as _i15.Future<void>);
@override
_i15.Future<void> fetchAndSetEquipments(_i3.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i15.Future<void> fetchAndSetEquipments(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetEquipments,
[database],
@@ -641,8 +630,7 @@ class MockExercisesProvider extends _i1.Mock implements _i14.ExercisesProvider {
/// A class which mocks [NutritionPlansProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockNutritionPlansProvider extends _i1.Mock
implements _i17.NutritionPlansProvider {
class MockNutritionPlansProvider extends _i1.Mock implements _i17.NutritionPlansProvider {
MockNutritionPlansProvider() {
_i1.throwOnMissingStub(this);
}
@@ -752,14 +740,12 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i15.Future<void>);
@override
_i15.Future<_i10.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
(super.noSuchMethod(
_i15.Future<_i10.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanSparse,
[planId],
),
returnValue:
_i15.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
returnValue: _i15.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
this,
Invocation.method(
#fetchAndSetPlanSparse,
@@ -769,14 +755,12 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i15.Future<_i10.NutritionalPlan>);
@override
_i15.Future<_i10.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
(super.noSuchMethod(
_i15.Future<_i10.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanFull,
[planId],
),
returnValue:
_i15.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
returnValue: _i15.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
this,
Invocation.method(
#fetchAndSetPlanFull,
@@ -786,14 +770,12 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i15.Future<_i10.NutritionalPlan>);
@override
_i15.Future<_i10.NutritionalPlan> addPlan(_i10.NutritionalPlan? planData) =>
(super.noSuchMethod(
_i15.Future<_i10.NutritionalPlan> addPlan(_i10.NutritionalPlan? planData) => (super.noSuchMethod(
Invocation.method(
#addPlan,
[planData],
),
returnValue:
_i15.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
returnValue: _i15.Future<_i10.NutritionalPlan>.value(_FakeNutritionalPlan_8(
this,
Invocation.method(
#addPlan,
@@ -898,8 +880,7 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i15.Future<_i12.MealItem>);
@override
_i15.Future<void> deleteMealItem(_i12.MealItem? mealItem) =>
(super.noSuchMethod(
_i15.Future<void> deleteMealItem(_i12.MealItem? mealItem) => (super.noSuchMethod(
Invocation.method(
#deleteMealItem,
[mealItem],
@@ -969,8 +950,7 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i15.Future<List<_i18.IngredientApiSearchEntry>>);
@override
_i15.Future<_i13.Ingredient?> searchIngredientWithCode(String? code) =>
(super.noSuchMethod(
_i15.Future<_i13.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod(
Invocation.method(
#searchIngredientWithCode,
[code],
@@ -1025,8 +1005,7 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i15.Future<void>);
@override
_i15.Future<void> fetchAndSetLogs(_i10.NutritionalPlan? plan) =>
(super.noSuchMethod(
_i15.Future<void> fetchAndSetLogs(_i10.NutritionalPlan? plan) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetLogs,
[plan],
@@ -1071,3 +1050,135 @@ class MockNutritionPlansProvider extends _i1.Mock
returnValueForMissingStub: null,
);
}
/// A class which mocks [UserProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockUserProvider extends _i1.Mock implements _i19.UserProvider {
MockUserProvider() {
_i1.throwOnMissingStub(this);
}
@override
_i20.ThemeMode get themeMode => (super.noSuchMethod(
Invocation.getter(#themeMode),
returnValue: _i20.ThemeMode.system,
) as _i20.ThemeMode);
@override
set themeMode(_i20.ThemeMode? _themeMode) => super.noSuchMethod(
Invocation.setter(
#themeMode,
_themeMode,
),
returnValueForMissingStub: null,
);
@override
_i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
Invocation.getter(#baseProvider),
returnValue: _FakeWgerBaseProvider_0(
this,
Invocation.getter(#baseProvider),
),
) as _i2.WgerBaseProvider);
@override
set profile(_i21.Profile? _profile) => super.noSuchMethod(
Invocation.setter(
#profile,
_profile,
),
returnValueForMissingStub: null,
);
@override
bool get hasListeners => (super.noSuchMethod(
Invocation.getter(#hasListeners),
returnValue: false,
) as bool);
@override
void clear() => super.noSuchMethod(
Invocation.method(
#clear,
[],
),
returnValueForMissingStub: null,
);
@override
void setThemeMode(_i20.ThemeMode? mode) => super.noSuchMethod(
Invocation.method(
#setThemeMode,
[mode],
),
returnValueForMissingStub: null,
);
@override
_i15.Future<void> fetchAndSetProfile() => (super.noSuchMethod(
Invocation.method(
#fetchAndSetProfile,
[],
),
returnValue: _i15.Future<void>.value(),
returnValueForMissingStub: _i15.Future<void>.value(),
) as _i15.Future<void>);
@override
_i15.Future<void> saveProfile() => (super.noSuchMethod(
Invocation.method(
#saveProfile,
[],
),
returnValue: _i15.Future<void>.value(),
returnValueForMissingStub: _i15.Future<void>.value(),
) as _i15.Future<void>);
@override
_i15.Future<void> verifyEmail() => (super.noSuchMethod(
Invocation.method(
#verifyEmail,
[],
),
returnValue: _i15.Future<void>.value(),
returnValueForMissingStub: _i15.Future<void>.value(),
) as _i15.Future<void>);
@override
void addListener(_i16.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,
[listener],
),
returnValueForMissingStub: null,
);
@override
void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#removeListener,
[listener],
),
returnValueForMissingStub: null,
);
@override
void dispose() => super.noSuchMethod(
Invocation.method(
#dispose,
[],
),
returnValueForMissingStub: null,
);
@override
void notifyListeners() => super.noSuchMethod(
Invocation.method(
#notifyListeners,
[],
),
returnValueForMissingStub: null,
);
}

View File

@@ -7,6 +7,7 @@ import 'dart:async' as _i13;
import 'dart:io' as _i10;
import 'dart:ui' as _i14;
import 'package:flutter/material.dart' as _i16;
import 'package:mockito/mockito.dart' as _i1;
import 'package:wger/models/exercises/alias.dart' as _i6;
import 'package:wger/models/exercises/category.dart' as _i9;
@@ -16,7 +17,7 @@ import 'package:wger/models/exercises/language.dart' as _i8;
import 'package:wger/models/exercises/muscle.dart' as _i12;
import 'package:wger/models/exercises/translation.dart' as _i4;
import 'package:wger/models/exercises/variation.dart' as _i5;
import 'package:wger/models/user/profile.dart' as _i16;
import 'package:wger/models/user/profile.dart' as _i17;
import 'package:wger/providers/add_exercise.dart' as _i7;
import 'package:wger/providers/base_provider.dart' as _i2;
import 'package:wger/providers/user.dart' as _i15;
@@ -34,8 +35,7 @@ import 'package:wger/providers/user.dart' as _i15;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
implements _i2.WgerBaseProvider {
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
_FakeWgerBaseProvider_0(
Object parent,
Invocation parentInvocation,
@@ -88,8 +88,7 @@ class _FakeAlias_4 extends _i1.SmartFake implements _i6.Alias {
/// A class which mocks [AddExerciseProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockAddExerciseProvider extends _i1.Mock
implements _i7.AddExerciseProvider {
class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvider {
MockAddExerciseProvider() {
_i1.throwOnMissingStub(this);
}
@@ -378,8 +377,7 @@ class MockAddExerciseProvider extends _i1.Mock
) as _i13.Future<void>);
@override
_i13.Future<_i4.Translation> addExerciseTranslation(
_i4.Translation? exercise) =>
_i13.Future<_i4.Translation> addExerciseTranslation(_i4.Translation? exercise) =>
(super.noSuchMethod(
Invocation.method(
#addExerciseTranslation,
@@ -464,6 +462,21 @@ class MockUserProvider extends _i1.Mock implements _i15.UserProvider {
_i1.throwOnMissingStub(this);
}
@override
_i16.ThemeMode get themeMode => (super.noSuchMethod(
Invocation.getter(#themeMode),
returnValue: _i16.ThemeMode.system,
) as _i16.ThemeMode);
@override
set themeMode(_i16.ThemeMode? _themeMode) => super.noSuchMethod(
Invocation.setter(
#themeMode,
_themeMode,
),
returnValueForMissingStub: null,
);
@override
_i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
Invocation.getter(#baseProvider),
@@ -474,7 +487,7 @@ class MockUserProvider extends _i1.Mock implements _i15.UserProvider {
) as _i2.WgerBaseProvider);
@override
set profile(_i16.Profile? _profile) => super.noSuchMethod(
set profile(_i17.Profile? _profile) => super.noSuchMethod(
Invocation.setter(
#profile,
_profile,
@@ -497,6 +510,15 @@ class MockUserProvider extends _i1.Mock implements _i15.UserProvider {
returnValueForMissingStub: null,
);
@override
void setThemeMode(_i16.ThemeMode? mode) => super.noSuchMethod(
Invocation.method(
#setThemeMode,
[mode],
),
returnValueForMissingStub: null,
);
@override
_i13.Future<void> fetchAndSetProfile() => (super.noSuchMethod(
Invocation.method(

View File

@@ -195,8 +195,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
) as _i6.Future<void>);
@override
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
(super.noSuchMethod(
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -242,8 +241,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
#fetch,
[uri],
),
returnValue:
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
@override
@@ -268,8 +266,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
uri,
],
),
returnValue:
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
@override
@@ -285,8 +282,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
uri,
],
),
returnValue:
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
@override

View File

@@ -195,8 +195,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
) as _i6.Future<void>);
@override
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
(super.noSuchMethod(
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -242,8 +241,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
#fetch,
[uri],
),
returnValue:
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
@override
@@ -268,8 +266,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
uri,
],
),
returnValue:
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
@override
@@ -285,8 +282,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
uri,
],
),
returnValue:
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
@override

View File

@@ -25,8 +25,7 @@ import 'package:wger/providers/measurement.dart' as _i4;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
implements _i2.WgerBaseProvider {
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
_FakeWgerBaseProvider_0(
Object parent,
Invocation parentInvocation,
@@ -36,8 +35,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake
);
}
class _FakeMeasurementCategory_1 extends _i1.SmartFake
implements _i3.MeasurementCategory {
class _FakeMeasurementCategory_1 extends _i1.SmartFake implements _i3.MeasurementCategory {
_FakeMeasurementCategory_1(
Object parent,
Invocation parentInvocation,
@@ -50,8 +48,7 @@ class _FakeMeasurementCategory_1 extends _i1.SmartFake
/// A class which mocks [MeasurementProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockMeasurementProvider extends _i1.Mock
implements _i4.MeasurementProvider {
class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvider {
MockMeasurementProvider() {
_i1.throwOnMissingStub(this);
}
@@ -132,8 +129,7 @@ class MockMeasurementProvider extends _i1.Mock
) as _i5.Future<void>);
@override
_i5.Future<void> addCategory(_i3.MeasurementCategory? category) =>
(super.noSuchMethod(
_i5.Future<void> addCategory(_i3.MeasurementCategory? category) => (super.noSuchMethod(
Invocation.method(
#addCategory,
[category],

View File

@@ -108,8 +108,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
);
@override
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
(super.noSuchMethod(
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -155,8 +154,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
#fetch,
[uri],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -181,8 +179,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -198,8 +195,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override

View File

@@ -29,8 +29,7 @@ import 'package:wger/providers/nutrition.dart' as _i8;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
implements _i2.WgerBaseProvider {
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
_FakeWgerBaseProvider_0(
Object parent,
Invocation parentInvocation,
@@ -40,8 +39,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake
);
}
class _FakeIngredientDatabase_1 extends _i1.SmartFake
implements _i3.IngredientDatabase {
class _FakeIngredientDatabase_1 extends _i1.SmartFake implements _i3.IngredientDatabase {
_FakeIngredientDatabase_1(
Object parent,
Invocation parentInvocation,
@@ -51,8 +49,7 @@ class _FakeIngredientDatabase_1 extends _i1.SmartFake
);
}
class _FakeNutritionalPlan_2 extends _i1.SmartFake
implements _i4.NutritionalPlan {
class _FakeNutritionalPlan_2 extends _i1.SmartFake implements _i4.NutritionalPlan {
_FakeNutritionalPlan_2(
Object parent,
Invocation parentInvocation,
@@ -95,8 +92,7 @@ class _FakeIngredient_5 extends _i1.SmartFake implements _i7.Ingredient {
/// A class which mocks [NutritionPlansProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockNutritionPlansProvider extends _i1.Mock
implements _i8.NutritionPlansProvider {
class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansProvider {
MockNutritionPlansProvider() {
_i1.throwOnMissingStub(this);
}
@@ -206,14 +202,12 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i9.Future<void>);
@override
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
(super.noSuchMethod(
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanSparse,
[planId],
),
returnValue:
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
this,
Invocation.method(
#fetchAndSetPlanSparse,
@@ -223,14 +217,12 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
(super.noSuchMethod(
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanFull,
[planId],
),
returnValue:
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
this,
Invocation.method(
#fetchAndSetPlanFull,
@@ -240,14 +232,12 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) =>
(super.noSuchMethod(
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) => (super.noSuchMethod(
Invocation.method(
#addPlan,
[planData],
),
returnValue:
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
this,
Invocation.method(
#addPlan,
@@ -352,8 +342,7 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i9.Future<_i6.MealItem>);
@override
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) =>
(super.noSuchMethod(
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) => (super.noSuchMethod(
Invocation.method(
#deleteMealItem,
[mealItem],
@@ -423,8 +412,7 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i9.Future<List<_i10.IngredientApiSearchEntry>>);
@override
_i9.Future<_i7.Ingredient?> searchIngredientWithCode(String? code) =>
(super.noSuchMethod(
_i9.Future<_i7.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod(
Invocation.method(
#searchIngredientWithCode,
[code],
@@ -479,8 +467,7 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i9.Future<void>);
@override
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) =>
(super.noSuchMethod(
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetLogs,
[plan],

View File

@@ -29,8 +29,7 @@ import 'package:wger/providers/nutrition.dart' as _i8;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
implements _i2.WgerBaseProvider {
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
_FakeWgerBaseProvider_0(
Object parent,
Invocation parentInvocation,
@@ -40,8 +39,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake
);
}
class _FakeIngredientDatabase_1 extends _i1.SmartFake
implements _i3.IngredientDatabase {
class _FakeIngredientDatabase_1 extends _i1.SmartFake implements _i3.IngredientDatabase {
_FakeIngredientDatabase_1(
Object parent,
Invocation parentInvocation,
@@ -51,8 +49,7 @@ class _FakeIngredientDatabase_1 extends _i1.SmartFake
);
}
class _FakeNutritionalPlan_2 extends _i1.SmartFake
implements _i4.NutritionalPlan {
class _FakeNutritionalPlan_2 extends _i1.SmartFake implements _i4.NutritionalPlan {
_FakeNutritionalPlan_2(
Object parent,
Invocation parentInvocation,
@@ -95,8 +92,7 @@ class _FakeIngredient_5 extends _i1.SmartFake implements _i7.Ingredient {
/// A class which mocks [NutritionPlansProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockNutritionPlansProvider extends _i1.Mock
implements _i8.NutritionPlansProvider {
class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansProvider {
MockNutritionPlansProvider() {
_i1.throwOnMissingStub(this);
}
@@ -206,14 +202,12 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i9.Future<void>);
@override
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
(super.noSuchMethod(
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanSparse,
[planId],
),
returnValue:
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
this,
Invocation.method(
#fetchAndSetPlanSparse,
@@ -223,14 +217,12 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
(super.noSuchMethod(
_i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanFull,
[planId],
),
returnValue:
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
this,
Invocation.method(
#fetchAndSetPlanFull,
@@ -240,14 +232,12 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i9.Future<_i4.NutritionalPlan>);
@override
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) =>
(super.noSuchMethod(
_i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) => (super.noSuchMethod(
Invocation.method(
#addPlan,
[planData],
),
returnValue:
_i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
returnValue: _i9.Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2(
this,
Invocation.method(
#addPlan,
@@ -352,8 +342,7 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i9.Future<_i6.MealItem>);
@override
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) =>
(super.noSuchMethod(
_i9.Future<void> deleteMealItem(_i6.MealItem? mealItem) => (super.noSuchMethod(
Invocation.method(
#deleteMealItem,
[mealItem],
@@ -423,8 +412,7 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i9.Future<List<_i10.IngredientApiSearchEntry>>);
@override
_i9.Future<_i7.Ingredient?> searchIngredientWithCode(String? code) =>
(super.noSuchMethod(
_i9.Future<_i7.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod(
Invocation.method(
#searchIngredientWithCode,
[code],
@@ -479,8 +467,7 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i9.Future<void>);
@override
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) =>
(super.noSuchMethod(
_i9.Future<void> fetchAndSetLogs(_i4.NutritionalPlan? plan) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetLogs,
[plan],

View File

@@ -68,8 +68,7 @@ class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response {
);
}
class _FakeStreamedResponse_4 extends _i1.SmartFake
implements _i3.StreamedResponse {
class _FakeStreamedResponse_4 extends _i1.SmartFake implements _i3.StreamedResponse {
_FakeStreamedResponse_4(
Object parent,
Invocation parentInvocation,
@@ -124,8 +123,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
);
@override
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
(super.noSuchMethod(
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -171,8 +169,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
#fetch,
[uri],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -197,8 +194,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -214,8 +210,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -280,8 +275,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
);
@override
set applicationVersion(_i6.PackageInfo? _applicationVersion) =>
super.noSuchMethod(
set applicationVersion(_i6.PackageInfo? _applicationVersion) => super.noSuchMethod(
Invocation.setter(
#applicationVersion,
_applicationVersion,
@@ -415,8 +409,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
#locale: locale,
},
),
returnValue: _i5.Future<Map<String, _i2.LoginActions>>.value(
<String, _i2.LoginActions>{}),
returnValue: _i5.Future<Map<String, _i2.LoginActions>>.value(<String, _i2.LoginActions>{}),
) as _i5.Future<Map<String, _i2.LoginActions>>);
@override
@@ -434,8 +427,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
serverUrl,
],
),
returnValue: _i5.Future<Map<String, _i2.LoginActions>>.value(
<String, _i2.LoginActions>{}),
returnValue: _i5.Future<Map<String, _i2.LoginActions>>.value(<String, _i2.LoginActions>{}),
) as _i5.Future<Map<String, _i2.LoginActions>>);
@override
@@ -735,14 +727,12 @@ class MockClient extends _i1.Mock implements _i3.Client {
) as _i5.Future<_i10.Uint8List>);
@override
_i5.Future<_i3.StreamedResponse> send(_i3.BaseRequest? request) =>
(super.noSuchMethod(
_i5.Future<_i3.StreamedResponse> send(_i3.BaseRequest? request) => (super.noSuchMethod(
Invocation.method(
#send,
[request],
),
returnValue:
_i5.Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_4(
returnValue: _i5.Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_4(
this,
Invocation.method(
#send,

View File

@@ -68,8 +68,7 @@ class _FakeResponse_3 extends _i1.SmartFake implements _i2.Response {
);
}
class _FakeStreamedResponse_4 extends _i1.SmartFake
implements _i2.StreamedResponse {
class _FakeStreamedResponse_4 extends _i1.SmartFake implements _i2.StreamedResponse {
_FakeStreamedResponse_4(
Object parent,
Invocation parentInvocation,
@@ -115,8 +114,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
);
@override
set applicationVersion(_i4.PackageInfo? _applicationVersion) =>
super.noSuchMethod(
set applicationVersion(_i4.PackageInfo? _applicationVersion) => super.noSuchMethod(
Invocation.setter(
#applicationVersion,
_applicationVersion,
@@ -250,8 +248,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
#locale: locale,
},
),
returnValue: _i5.Future<Map<String, _i3.LoginActions>>.value(
<String, _i3.LoginActions>{}),
returnValue: _i5.Future<Map<String, _i3.LoginActions>>.value(<String, _i3.LoginActions>{}),
) as _i5.Future<Map<String, _i3.LoginActions>>);
@override
@@ -269,8 +266,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
serverUrl,
],
),
returnValue: _i5.Future<Map<String, _i3.LoginActions>>.value(
<String, _i3.LoginActions>{}),
returnValue: _i5.Future<Map<String, _i3.LoginActions>>.value(<String, _i3.LoginActions>{}),
) as _i5.Future<Map<String, _i3.LoginActions>>);
@override
@@ -405,8 +401,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i8.WgerBaseProvider {
);
@override
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
(super.noSuchMethod(
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -452,8 +447,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i8.WgerBaseProvider {
#fetch,
[uri],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -478,8 +472,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i8.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -495,8 +488,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i8.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -735,14 +727,12 @@ class MockClient extends _i1.Mock implements _i2.Client {
) as _i5.Future<_i10.Uint8List>);
@override
_i5.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) =>
(super.noSuchMethod(
_i5.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod(
Invocation.method(
#send,
[request],
),
returnValue:
_i5.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_4(
returnValue: _i5.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_4(
this,
Invocation.method(
#send,

View File

@@ -34,8 +34,7 @@ class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response {
);
}
class _FakeStreamedResponse_1 extends _i1.SmartFake
implements _i2.StreamedResponse {
class _FakeStreamedResponse_1 extends _i1.SmartFake implements _i2.StreamedResponse {
_FakeStreamedResponse_1(
Object parent,
Invocation parentInvocation,
@@ -255,14 +254,12 @@ class MockClient extends _i1.Mock implements _i2.Client {
) as _i3.Future<_i6.Uint8List>);
@override
_i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) =>
(super.noSuchMethod(
_i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod(
Invocation.method(
#send,
[request],
),
returnValue:
_i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1(
returnValue: _i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1(
this,
Invocation.method(
#send,

View File

@@ -21,6 +21,8 @@ import 'dart:convert';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:shared_preferences_platform_interface/in_memory_shared_preferences_async.dart';
import 'package:shared_preferences_platform_interface/shared_preferences_async_platform_interface.dart';
import 'package:wger/providers/base_provider.dart';
import 'package:wger/providers/user.dart';
@@ -29,6 +31,7 @@ import 'provider_test.mocks.dart';
@GenerateMocks([WgerBaseProvider])
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
late UserProvider userProvider;
late MockWgerBaseProvider mockWgerBaseProvider;
@@ -47,6 +50,7 @@ void main() {
);
setUp(() {
SharedPreferencesAsyncPlatform.instance = InMemorySharedPreferencesAsync.empty();
mockWgerBaseProvider = MockWgerBaseProvider();
userProvider = UserProvider(mockWgerBaseProvider);

View File

@@ -108,8 +108,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
);
@override
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
(super.noSuchMethod(
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -155,8 +154,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
#fetch,
[uri],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -181,8 +179,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -198,8 +195,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override

View File

@@ -108,8 +108,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
);
@override
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
(super.noSuchMethod(
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -155,8 +154,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
#fetch,
[uri],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -181,8 +179,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -198,8 +195,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override

View File

@@ -75,8 +75,7 @@ void main() {
);
}
testWidgets('Test the widgets on the body weight screen',
(WidgetTester tester) async {
testWidgets('Test the widgets on the body weight screen', (WidgetTester tester) async {
await tester.pumpWidget(createWeightScreen());
expect(find.text('Weight'), findsOneWidget);
@@ -85,8 +84,7 @@ void main() {
expect(find.byType(ListTile), findsNWidgets(2));
});
testWidgets('Test deleting an item using the Delete button',
(WidgetTester tester) async {
testWidgets('Test deleting an item using the Delete button', (WidgetTester tester) async {
// Arrange
await tester.pumpWidget(createWeightScreen());
@@ -101,8 +99,7 @@ void main() {
verify(mockWeightProvider.deleteEntry(1)).called(1);
});
testWidgets('Test the form on the body weight screen',
(WidgetTester tester) async {
testWidgets('Test the form on the body weight screen', (WidgetTester tester) async {
await tester.pumpWidget(createWeightScreen());
expect(find.byType(WeightForm), findsNothing);
@@ -111,16 +108,14 @@ void main() {
expect(find.byType(WeightForm), findsOneWidget);
});
testWidgets('Tests the localization of dates - EN',
(WidgetTester tester) async {
testWidgets('Tests the localization of dates - EN', (WidgetTester tester) async {
await tester.pumpWidget(createWeightScreen());
// these don't work because we only have 2 points, and to prevent overlaps we don't display their titles
// expect(find.text('1/1'), findsOneWidget);
// expect(find.text('1/10'), findsOneWidget);
});
testWidgets('Tests the localization of dates - DE',
(WidgetTester tester) async {
testWidgets('Tests the localization of dates - DE', (WidgetTester tester) async {
await tester.pumpWidget(createWeightScreen(locale: 'de'));
// these don't work because we only have 2 points, and to prevent overlaps we don't display their titles
// expect(find.text('1.1.'), findsOneWidget);

View File

@@ -6,18 +6,19 @@
import 'dart:async' as _i10;
import 'dart:ui' as _i11;
import 'package:flutter/material.dart' as _i13;
import 'package:mockito/mockito.dart' as _i1;
import 'package:wger/database/ingredients/ingredients_database.dart' as _i4;
import 'package:wger/models/body_weight/weight_entry.dart' as _i3;
import 'package:wger/models/exercises/ingredient_api.dart' as _i15;
import 'package:wger/models/exercises/ingredient_api.dart' as _i16;
import 'package:wger/models/nutrition/ingredient.dart' as _i8;
import 'package:wger/models/nutrition/meal.dart' as _i6;
import 'package:wger/models/nutrition/meal_item.dart' as _i7;
import 'package:wger/models/nutrition/nutritional_plan.dart' as _i5;
import 'package:wger/models/user/profile.dart' as _i13;
import 'package:wger/models/user/profile.dart' as _i14;
import 'package:wger/providers/base_provider.dart' as _i2;
import 'package:wger/providers/body_weight.dart' as _i9;
import 'package:wger/providers/nutrition.dart' as _i14;
import 'package:wger/providers/nutrition.dart' as _i15;
import 'package:wger/providers/user.dart' as _i12;
// ignore_for_file: type=lint
@@ -33,8 +34,7 @@ import 'package:wger/providers/user.dart' as _i12;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
implements _i2.WgerBaseProvider {
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
_FakeWgerBaseProvider_0(
Object parent,
Invocation parentInvocation,
@@ -54,8 +54,7 @@ class _FakeWeightEntry_1 extends _i1.SmartFake implements _i3.WeightEntry {
);
}
class _FakeIngredientDatabase_2 extends _i1.SmartFake
implements _i4.IngredientDatabase {
class _FakeIngredientDatabase_2 extends _i1.SmartFake implements _i4.IngredientDatabase {
_FakeIngredientDatabase_2(
Object parent,
Invocation parentInvocation,
@@ -65,8 +64,7 @@ class _FakeIngredientDatabase_2 extends _i1.SmartFake
);
}
class _FakeNutritionalPlan_3 extends _i1.SmartFake
implements _i5.NutritionalPlan {
class _FakeNutritionalPlan_3 extends _i1.SmartFake implements _i5.NutritionalPlan {
_FakeNutritionalPlan_3(
Object parent,
Invocation parentInvocation,
@@ -109,8 +107,7 @@ class _FakeIngredient_6 extends _i1.SmartFake implements _i8.Ingredient {
/// A class which mocks [BodyWeightProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockBodyWeightProvider extends _i1.Mock
implements _i9.BodyWeightProvider {
class MockBodyWeightProvider extends _i1.Mock implements _i9.BodyWeightProvider {
MockBodyWeightProvider() {
_i1.throwOnMissingStub(this);
}
@@ -170,26 +167,22 @@ class MockBodyWeightProvider extends _i1.Mock
) as _i3.WeightEntry);
@override
_i3.WeightEntry? findByDate(DateTime? date) =>
(super.noSuchMethod(Invocation.method(
_i3.WeightEntry? findByDate(DateTime? date) => (super.noSuchMethod(Invocation.method(
#findByDate,
[date],
)) as _i3.WeightEntry?);
@override
_i10.Future<List<_i3.WeightEntry>> fetchAndSetEntries() =>
(super.noSuchMethod(
_i10.Future<List<_i3.WeightEntry>> fetchAndSetEntries() => (super.noSuchMethod(
Invocation.method(
#fetchAndSetEntries,
[],
),
returnValue:
_i10.Future<List<_i3.WeightEntry>>.value(<_i3.WeightEntry>[]),
returnValue: _i10.Future<List<_i3.WeightEntry>>.value(<_i3.WeightEntry>[]),
) as _i10.Future<List<_i3.WeightEntry>>);
@override
_i10.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) =>
(super.noSuchMethod(
_i10.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) => (super.noSuchMethod(
Invocation.method(
#addEntry,
[entry],
@@ -268,6 +261,21 @@ class MockUserProvider extends _i1.Mock implements _i12.UserProvider {
_i1.throwOnMissingStub(this);
}
@override
_i13.ThemeMode get themeMode => (super.noSuchMethod(
Invocation.getter(#themeMode),
returnValue: _i13.ThemeMode.system,
) as _i13.ThemeMode);
@override
set themeMode(_i13.ThemeMode? _themeMode) => super.noSuchMethod(
Invocation.setter(
#themeMode,
_themeMode,
),
returnValueForMissingStub: null,
);
@override
_i2.WgerBaseProvider get baseProvider => (super.noSuchMethod(
Invocation.getter(#baseProvider),
@@ -278,7 +286,7 @@ class MockUserProvider extends _i1.Mock implements _i12.UserProvider {
) as _i2.WgerBaseProvider);
@override
set profile(_i13.Profile? _profile) => super.noSuchMethod(
set profile(_i14.Profile? _profile) => super.noSuchMethod(
Invocation.setter(
#profile,
_profile,
@@ -301,6 +309,15 @@ class MockUserProvider extends _i1.Mock implements _i12.UserProvider {
returnValueForMissingStub: null,
);
@override
void setThemeMode(_i13.ThemeMode? mode) => super.noSuchMethod(
Invocation.method(
#setThemeMode,
[mode],
),
returnValueForMissingStub: null,
);
@override
_i10.Future<void> fetchAndSetProfile() => (super.noSuchMethod(
Invocation.method(
@@ -371,8 +388,7 @@ class MockUserProvider extends _i1.Mock implements _i12.UserProvider {
/// A class which mocks [NutritionPlansProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockNutritionPlansProvider extends _i1.Mock
implements _i14.NutritionPlansProvider {
class MockNutritionPlansProvider extends _i1.Mock implements _i15.NutritionPlansProvider {
MockNutritionPlansProvider() {
_i1.throwOnMissingStub(this);
}
@@ -482,14 +498,12 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i10.Future<void>);
@override
_i10.Future<_i5.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
(super.noSuchMethod(
_i10.Future<_i5.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanSparse,
[planId],
),
returnValue:
_i10.Future<_i5.NutritionalPlan>.value(_FakeNutritionalPlan_3(
returnValue: _i10.Future<_i5.NutritionalPlan>.value(_FakeNutritionalPlan_3(
this,
Invocation.method(
#fetchAndSetPlanSparse,
@@ -499,14 +513,12 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i10.Future<_i5.NutritionalPlan>);
@override
_i10.Future<_i5.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
(super.noSuchMethod(
_i10.Future<_i5.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanFull,
[planId],
),
returnValue:
_i10.Future<_i5.NutritionalPlan>.value(_FakeNutritionalPlan_3(
returnValue: _i10.Future<_i5.NutritionalPlan>.value(_FakeNutritionalPlan_3(
this,
Invocation.method(
#fetchAndSetPlanFull,
@@ -516,14 +528,12 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i10.Future<_i5.NutritionalPlan>);
@override
_i10.Future<_i5.NutritionalPlan> addPlan(_i5.NutritionalPlan? planData) =>
(super.noSuchMethod(
_i10.Future<_i5.NutritionalPlan> addPlan(_i5.NutritionalPlan? planData) => (super.noSuchMethod(
Invocation.method(
#addPlan,
[planData],
),
returnValue:
_i10.Future<_i5.NutritionalPlan>.value(_FakeNutritionalPlan_3(
returnValue: _i10.Future<_i5.NutritionalPlan>.value(_FakeNutritionalPlan_3(
this,
Invocation.method(
#addPlan,
@@ -628,8 +638,7 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i10.Future<_i7.MealItem>);
@override
_i10.Future<void> deleteMealItem(_i7.MealItem? mealItem) =>
(super.noSuchMethod(
_i10.Future<void> deleteMealItem(_i7.MealItem? mealItem) => (super.noSuchMethod(
Invocation.method(
#deleteMealItem,
[mealItem],
@@ -680,7 +689,7 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i10.Future<void>);
@override
_i10.Future<List<_i15.IngredientApiSearchEntry>> searchIngredient(
_i10.Future<List<_i16.IngredientApiSearchEntry>> searchIngredient(
String? name, {
String? languageCode = r'en',
bool? searchEnglish = false,
@@ -694,13 +703,12 @@ class MockNutritionPlansProvider extends _i1.Mock
#searchEnglish: searchEnglish,
},
),
returnValue: _i10.Future<List<_i15.IngredientApiSearchEntry>>.value(
<_i15.IngredientApiSearchEntry>[]),
) as _i10.Future<List<_i15.IngredientApiSearchEntry>>);
returnValue: _i10.Future<List<_i16.IngredientApiSearchEntry>>.value(
<_i16.IngredientApiSearchEntry>[]),
) as _i10.Future<List<_i16.IngredientApiSearchEntry>>);
@override
_i10.Future<_i8.Ingredient?> searchIngredientWithCode(String? code) =>
(super.noSuchMethod(
_i10.Future<_i8.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod(
Invocation.method(
#searchIngredientWithCode,
[code],
@@ -755,8 +763,7 @@ class MockNutritionPlansProvider extends _i1.Mock
) as _i10.Future<void>);
@override
_i10.Future<void> fetchAndSetLogs(_i5.NutritionalPlan? plan) =>
(super.noSuchMethod(
_i10.Future<void> fetchAndSetLogs(_i5.NutritionalPlan? plan) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetLogs,
[plan],

View File

@@ -71,8 +71,7 @@ class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response {
);
}
class _FakeWgerBaseProvider_4 extends _i1.SmartFake
implements _i4.WgerBaseProvider {
class _FakeWgerBaseProvider_4 extends _i1.SmartFake implements _i4.WgerBaseProvider {
_FakeWgerBaseProvider_4(
Object parent,
Invocation parentInvocation,
@@ -82,8 +81,7 @@ class _FakeWgerBaseProvider_4 extends _i1.SmartFake
);
}
class _FakeExerciseDatabase_5 extends _i1.SmartFake
implements _i5.ExerciseDatabase {
class _FakeExerciseDatabase_5 extends _i1.SmartFake implements _i5.ExerciseDatabase {
_FakeExerciseDatabase_5(
Object parent,
Invocation parentInvocation,
@@ -103,8 +101,7 @@ class _FakeExercise_6 extends _i1.SmartFake implements _i6.Exercise {
);
}
class _FakeExerciseCategory_7 extends _i1.SmartFake
implements _i7.ExerciseCategory {
class _FakeExerciseCategory_7 extends _i1.SmartFake implements _i7.ExerciseCategory {
_FakeExerciseCategory_7(
Object parent,
Invocation parentInvocation,
@@ -189,8 +186,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
);
@override
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
(super.noSuchMethod(
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -236,8 +232,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
#fetch,
[uri],
),
returnValue:
_i11.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i11.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i11.Future<Map<String, dynamic>>);
@override
@@ -262,8 +257,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i11.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i11.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i11.Future<Map<String, dynamic>>);
@override
@@ -279,8 +273,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i11.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i11.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i11.Future<Map<String, dynamic>>);
@override
@@ -366,8 +359,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
) as List<_i6.Exercise>);
@override
set filteredExercises(List<_i6.Exercise>? newFilteredExercises) =>
super.noSuchMethod(
set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => super.noSuchMethod(
Invocation.setter(
#filteredExercises,
newFilteredExercises,
@@ -376,8 +368,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
);
@override
Map<int, List<_i6.Exercise>> get exerciseBasesByVariation =>
(super.noSuchMethod(
Map<int, List<_i6.Exercise>> get exerciseBasesByVariation => (super.noSuchMethod(
Invocation.getter(#exerciseBasesByVariation),
returnValue: <int, List<_i6.Exercise>>{},
) as Map<int, List<_i6.Exercise>>);
@@ -589,8 +580,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
) as _i11.Future<void>);
@override
_i11.Future<_i6.Exercise> fetchAndSetExercise(int? exerciseId) =>
(super.noSuchMethod(
_i11.Future<_i6.Exercise> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetExercise,
[exerciseId],
@@ -630,8 +620,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
) as _i11.Future<_i6.Exercise>);
@override
_i11.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) =>
(super.noSuchMethod(
_i11.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod(
Invocation.method(
#initCacheTimesLocalPrefs,
[],
@@ -677,8 +666,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
) as _i11.Future<void>);
@override
_i11.Future<void> updateExerciseCache(_i5.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i11.Future<void> updateExerciseCache(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#updateExerciseCache,
[database],
@@ -688,8 +676,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
) as _i11.Future<void>);
@override
_i11.Future<void> fetchAndSetMuscles(_i5.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i11.Future<void> fetchAndSetMuscles(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetMuscles,
[database],
@@ -699,8 +686,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
) as _i11.Future<void>);
@override
_i11.Future<void> fetchAndSetCategories(_i5.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i11.Future<void> fetchAndSetCategories(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetCategories,
[database],
@@ -710,8 +696,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
) as _i11.Future<void>);
@override
_i11.Future<void> fetchAndSetLanguages(_i5.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i11.Future<void> fetchAndSetLanguages(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetLanguages,
[database],
@@ -721,8 +706,7 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider {
) as _i11.Future<void>);
@override
_i11.Future<void> fetchAndSetEquipments(_i5.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i11.Future<void> fetchAndSetEquipments(_i5.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetEquipments,
[database],

View File

@@ -34,8 +34,7 @@ import 'package:wger/providers/workout_plans.dart' as _i11;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
implements _i2.WgerBaseProvider {
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
_FakeWgerBaseProvider_0(
Object parent,
Invocation parentInvocation,
@@ -55,8 +54,7 @@ class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit {
);
}
class _FakeRepetitionUnit_2 extends _i1.SmartFake
implements _i4.RepetitionUnit {
class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit {
_FakeRepetitionUnit_2(
Object parent,
Invocation parentInvocation,
@@ -106,8 +104,7 @@ class _FakeSetting_6 extends _i1.SmartFake implements _i8.Setting {
);
}
class _FakeWorkoutSession_7 extends _i1.SmartFake
implements _i9.WorkoutSession {
class _FakeWorkoutSession_7 extends _i1.SmartFake implements _i9.WorkoutSession {
_FakeWorkoutSession_7(
Object parent,
Invocation parentInvocation,
@@ -130,8 +127,7 @@ class _FakeLog_8 extends _i1.SmartFake implements _i10.Log {
/// A class which mocks [WorkoutPlansProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockWorkoutPlansProvider extends _i1.Mock
implements _i11.WorkoutPlansProvider {
class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProvider {
MockWorkoutPlansProvider() {
_i1.throwOnMissingStub(this);
}
@@ -268,8 +264,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<void>);
@override
_i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) =>
(super.noSuchMethod(
_i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanSparse,
[planId],
@@ -284,8 +279,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<_i5.WorkoutPlan>);
@override
_i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) =>
(super.noSuchMethod(
_i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetWorkoutPlanFull,
[workoutId],
@@ -300,8 +294,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<_i5.WorkoutPlan>);
@override
_i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) =>
(super.noSuchMethod(
_i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod(
Invocation.method(
#addWorkout,
[workout],
@@ -316,8 +309,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<_i5.WorkoutPlan>);
@override
_i12.Future<void> editWorkout(_i5.WorkoutPlan? workout) =>
(super.noSuchMethod(
_i12.Future<void> editWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod(
Invocation.method(
#editWorkout,
[workout],
@@ -349,8 +341,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
base,
],
),
returnValue:
_i12.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i12.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i12.Future<Map<String, dynamic>>);
@override
@@ -470,8 +461,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<List<_i7.Set>>);
@override
_i12.Future<void> fetchComputedSettings(_i7.Set? workoutSet) =>
(super.noSuchMethod(
_i12.Future<void> fetchComputedSettings(_i7.Set? workoutSet) => (super.noSuchMethod(
Invocation.method(
#fetchComputedSettings,
[workoutSet],
@@ -516,8 +506,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<void>);
@override
_i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) =>
(super.noSuchMethod(
_i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => (super.noSuchMethod(
Invocation.method(
#addSetting,
[workoutSetting],
@@ -541,14 +530,12 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<dynamic>);
@override
_i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) =>
(super.noSuchMethod(
_i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => (super.noSuchMethod(
Invocation.method(
#addSession,
[session],
),
returnValue:
_i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7(
returnValue: _i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7(
this,
Invocation.method(
#addSession,

View File

@@ -24,8 +24,7 @@ import 'package:wger/providers/body_weight.dart' as _i4;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
implements _i2.WgerBaseProvider {
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
_FakeWgerBaseProvider_0(
Object parent,
Invocation parentInvocation,
@@ -48,8 +47,7 @@ class _FakeWeightEntry_1 extends _i1.SmartFake implements _i3.WeightEntry {
/// A class which mocks [BodyWeightProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockBodyWeightProvider extends _i1.Mock
implements _i4.BodyWeightProvider {
class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider {
MockBodyWeightProvider() {
_i1.throwOnMissingStub(this);
}
@@ -109,8 +107,7 @@ class MockBodyWeightProvider extends _i1.Mock
) as _i3.WeightEntry);
@override
_i3.WeightEntry? findByDate(DateTime? date) =>
(super.noSuchMethod(Invocation.method(
_i3.WeightEntry? findByDate(DateTime? date) => (super.noSuchMethod(Invocation.method(
#findByDate,
[date],
)) as _i3.WeightEntry?);
@@ -121,13 +118,11 @@ class MockBodyWeightProvider extends _i1.Mock
#fetchAndSetEntries,
[],
),
returnValue:
_i5.Future<List<_i3.WeightEntry>>.value(<_i3.WeightEntry>[]),
returnValue: _i5.Future<List<_i3.WeightEntry>>.value(<_i3.WeightEntry>[]),
) as _i5.Future<List<_i3.WeightEntry>>);
@override
_i5.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) =>
(super.noSuchMethod(
_i5.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) => (super.noSuchMethod(
Invocation.method(
#addEntry,
[entry],

View File

@@ -34,8 +34,7 @@ import 'package:wger/providers/workout_plans.dart' as _i11;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
implements _i2.WgerBaseProvider {
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
_FakeWgerBaseProvider_0(
Object parent,
Invocation parentInvocation,
@@ -55,8 +54,7 @@ class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit {
);
}
class _FakeRepetitionUnit_2 extends _i1.SmartFake
implements _i4.RepetitionUnit {
class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit {
_FakeRepetitionUnit_2(
Object parent,
Invocation parentInvocation,
@@ -106,8 +104,7 @@ class _FakeSetting_6 extends _i1.SmartFake implements _i8.Setting {
);
}
class _FakeWorkoutSession_7 extends _i1.SmartFake
implements _i9.WorkoutSession {
class _FakeWorkoutSession_7 extends _i1.SmartFake implements _i9.WorkoutSession {
_FakeWorkoutSession_7(
Object parent,
Invocation parentInvocation,
@@ -130,8 +127,7 @@ class _FakeLog_8 extends _i1.SmartFake implements _i10.Log {
/// A class which mocks [WorkoutPlansProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockWorkoutPlansProvider extends _i1.Mock
implements _i11.WorkoutPlansProvider {
class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProvider {
MockWorkoutPlansProvider() {
_i1.throwOnMissingStub(this);
}
@@ -268,8 +264,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<void>);
@override
_i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) =>
(super.noSuchMethod(
_i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanSparse,
[planId],
@@ -284,8 +279,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<_i5.WorkoutPlan>);
@override
_i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) =>
(super.noSuchMethod(
_i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetWorkoutPlanFull,
[workoutId],
@@ -300,8 +294,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<_i5.WorkoutPlan>);
@override
_i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) =>
(super.noSuchMethod(
_i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod(
Invocation.method(
#addWorkout,
[workout],
@@ -316,8 +309,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<_i5.WorkoutPlan>);
@override
_i12.Future<void> editWorkout(_i5.WorkoutPlan? workout) =>
(super.noSuchMethod(
_i12.Future<void> editWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod(
Invocation.method(
#editWorkout,
[workout],
@@ -349,8 +341,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
base,
],
),
returnValue:
_i12.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i12.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i12.Future<Map<String, dynamic>>);
@override
@@ -470,8 +461,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<List<_i7.Set>>);
@override
_i12.Future<void> fetchComputedSettings(_i7.Set? workoutSet) =>
(super.noSuchMethod(
_i12.Future<void> fetchComputedSettings(_i7.Set? workoutSet) => (super.noSuchMethod(
Invocation.method(
#fetchComputedSettings,
[workoutSet],
@@ -516,8 +506,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<void>);
@override
_i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) =>
(super.noSuchMethod(
_i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => (super.noSuchMethod(
Invocation.method(
#addSetting,
[workoutSetting],
@@ -541,14 +530,12 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<dynamic>);
@override
_i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) =>
(super.noSuchMethod(
_i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => (super.noSuchMethod(
Invocation.method(
#addSession,
[session],
),
returnValue:
_i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7(
returnValue: _i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7(
this,
Invocation.method(
#addSession,

View File

@@ -34,8 +34,7 @@ import 'package:wger/providers/workout_plans.dart' as _i11;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
implements _i2.WgerBaseProvider {
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
_FakeWgerBaseProvider_0(
Object parent,
Invocation parentInvocation,
@@ -55,8 +54,7 @@ class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit {
);
}
class _FakeRepetitionUnit_2 extends _i1.SmartFake
implements _i4.RepetitionUnit {
class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit {
_FakeRepetitionUnit_2(
Object parent,
Invocation parentInvocation,
@@ -106,8 +104,7 @@ class _FakeSetting_6 extends _i1.SmartFake implements _i8.Setting {
);
}
class _FakeWorkoutSession_7 extends _i1.SmartFake
implements _i9.WorkoutSession {
class _FakeWorkoutSession_7 extends _i1.SmartFake implements _i9.WorkoutSession {
_FakeWorkoutSession_7(
Object parent,
Invocation parentInvocation,
@@ -130,8 +127,7 @@ class _FakeLog_8 extends _i1.SmartFake implements _i10.Log {
/// A class which mocks [WorkoutPlansProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockWorkoutPlansProvider extends _i1.Mock
implements _i11.WorkoutPlansProvider {
class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProvider {
MockWorkoutPlansProvider() {
_i1.throwOnMissingStub(this);
}
@@ -268,8 +264,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<void>);
@override
_i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) =>
(super.noSuchMethod(
_i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanSparse,
[planId],
@@ -284,8 +279,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<_i5.WorkoutPlan>);
@override
_i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) =>
(super.noSuchMethod(
_i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetWorkoutPlanFull,
[workoutId],
@@ -300,8 +294,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<_i5.WorkoutPlan>);
@override
_i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) =>
(super.noSuchMethod(
_i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod(
Invocation.method(
#addWorkout,
[workout],
@@ -316,8 +309,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<_i5.WorkoutPlan>);
@override
_i12.Future<void> editWorkout(_i5.WorkoutPlan? workout) =>
(super.noSuchMethod(
_i12.Future<void> editWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod(
Invocation.method(
#editWorkout,
[workout],
@@ -349,8 +341,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
base,
],
),
returnValue:
_i12.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i12.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i12.Future<Map<String, dynamic>>);
@override
@@ -470,8 +461,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<List<_i7.Set>>);
@override
_i12.Future<void> fetchComputedSettings(_i7.Set? workoutSet) =>
(super.noSuchMethod(
_i12.Future<void> fetchComputedSettings(_i7.Set? workoutSet) => (super.noSuchMethod(
Invocation.method(
#fetchComputedSettings,
[workoutSet],
@@ -516,8 +506,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<void>);
@override
_i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) =>
(super.noSuchMethod(
_i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => (super.noSuchMethod(
Invocation.method(
#addSetting,
[workoutSetting],
@@ -541,14 +530,12 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i12.Future<dynamic>);
@override
_i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) =>
(super.noSuchMethod(
_i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => (super.noSuchMethod(
Invocation.method(
#addSession,
[session],
),
returnValue:
_i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7(
returnValue: _i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7(
this,
Invocation.method(
#addSession,

View File

@@ -108,8 +108,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
);
@override
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
(super.noSuchMethod(
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -155,8 +154,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
#fetch,
[uri],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -181,8 +179,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -198,8 +195,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override

View File

@@ -108,8 +108,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
);
@override
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
(super.noSuchMethod(
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -155,8 +154,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
#fetch,
[uri],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -181,8 +179,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -198,8 +195,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override

View File

@@ -108,8 +108,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
);
@override
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
(super.noSuchMethod(
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -155,8 +154,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
#fetch,
[uri],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -181,8 +179,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override
@@ -198,8 +195,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
uri,
],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
@override

View File

@@ -42,8 +42,7 @@ import 'package:wger/providers/workout_plans.dart' as _i22;
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeWgerBaseProvider_0 extends _i1.SmartFake
implements _i2.WgerBaseProvider {
class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider {
_FakeWgerBaseProvider_0(
Object parent,
Invocation parentInvocation,
@@ -53,8 +52,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake
);
}
class _FakeExerciseDatabase_1 extends _i1.SmartFake
implements _i3.ExerciseDatabase {
class _FakeExerciseDatabase_1 extends _i1.SmartFake implements _i3.ExerciseDatabase {
_FakeExerciseDatabase_1(
Object parent,
Invocation parentInvocation,
@@ -74,8 +72,7 @@ class _FakeExercise_2 extends _i1.SmartFake implements _i4.Exercise {
);
}
class _FakeExerciseCategory_3 extends _i1.SmartFake
implements _i5.ExerciseCategory {
class _FakeExerciseCategory_3 extends _i1.SmartFake implements _i5.ExerciseCategory {
_FakeExerciseCategory_3(
Object parent,
Invocation parentInvocation,
@@ -165,8 +162,7 @@ class _FakeWeightUnit_11 extends _i1.SmartFake implements _i11.WeightUnit {
);
}
class _FakeRepetitionUnit_12 extends _i1.SmartFake
implements _i12.RepetitionUnit {
class _FakeRepetitionUnit_12 extends _i1.SmartFake implements _i12.RepetitionUnit {
_FakeRepetitionUnit_12(
Object parent,
Invocation parentInvocation,
@@ -216,8 +212,7 @@ class _FakeSetting_16 extends _i1.SmartFake implements _i16.Setting {
);
}
class _FakeWorkoutSession_17 extends _i1.SmartFake
implements _i17.WorkoutSession {
class _FakeWorkoutSession_17 extends _i1.SmartFake implements _i17.WorkoutSession {
_FakeWorkoutSession_17(
Object parent,
Invocation parentInvocation,
@@ -294,8 +289,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
) as List<_i4.Exercise>);
@override
set filteredExercises(List<_i4.Exercise>? newFilteredExercises) =>
super.noSuchMethod(
set filteredExercises(List<_i4.Exercise>? newFilteredExercises) => super.noSuchMethod(
Invocation.setter(
#filteredExercises,
newFilteredExercises,
@@ -304,8 +298,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
);
@override
Map<int, List<_i4.Exercise>> get exerciseBasesByVariation =>
(super.noSuchMethod(
Map<int, List<_i4.Exercise>> get exerciseBasesByVariation => (super.noSuchMethod(
Invocation.getter(#exerciseBasesByVariation),
returnValue: <int, List<_i4.Exercise>>{},
) as Map<int, List<_i4.Exercise>>);
@@ -517,8 +510,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
) as _i20.Future<void>);
@override
_i20.Future<_i4.Exercise> fetchAndSetExercise(int? exerciseId) =>
(super.noSuchMethod(
_i20.Future<_i4.Exercise> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetExercise,
[exerciseId],
@@ -558,8 +550,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
) as _i20.Future<_i4.Exercise>);
@override
_i20.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) =>
(super.noSuchMethod(
_i20.Future<void> initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod(
Invocation.method(
#initCacheTimesLocalPrefs,
[],
@@ -605,8 +596,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
) as _i20.Future<void>);
@override
_i20.Future<void> updateExerciseCache(_i3.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i20.Future<void> updateExerciseCache(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#updateExerciseCache,
[database],
@@ -616,8 +606,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
) as _i20.Future<void>);
@override
_i20.Future<void> fetchAndSetMuscles(_i3.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i20.Future<void> fetchAndSetMuscles(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetMuscles,
[database],
@@ -627,8 +616,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
) as _i20.Future<void>);
@override
_i20.Future<void> fetchAndSetCategories(_i3.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i20.Future<void> fetchAndSetCategories(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetCategories,
[database],
@@ -638,8 +626,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
) as _i20.Future<void>);
@override
_i20.Future<void> fetchAndSetLanguages(_i3.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i20.Future<void> fetchAndSetLanguages(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetLanguages,
[database],
@@ -649,8 +636,7 @@ class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider {
) as _i20.Future<void>);
@override
_i20.Future<void> fetchAndSetEquipments(_i3.ExerciseDatabase? database) =>
(super.noSuchMethod(
_i20.Future<void> fetchAndSetEquipments(_i3.ExerciseDatabase? database) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetEquipments,
[database],
@@ -759,8 +745,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
);
@override
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
(super.noSuchMethod(
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -806,8 +791,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
#fetch,
[uri],
),
returnValue:
_i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i20.Future<Map<String, dynamic>>);
@override
@@ -832,8 +816,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
uri,
],
),
returnValue:
_i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i20.Future<Map<String, dynamic>>);
@override
@@ -849,8 +832,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
uri,
],
),
returnValue:
_i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i20.Future<Map<String, dynamic>>);
@override
@@ -882,8 +864,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
/// A class which mocks [WorkoutPlansProvider].
///
/// See the documentation for Mockito's code generation for more information.
class MockWorkoutPlansProvider extends _i1.Mock
implements _i22.WorkoutPlansProvider {
class MockWorkoutPlansProvider extends _i1.Mock implements _i22.WorkoutPlansProvider {
MockWorkoutPlansProvider() {
_i1.throwOnMissingStub(this);
}
@@ -1020,8 +1001,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i20.Future<void>);
@override
_i20.Future<_i13.WorkoutPlan> fetchAndSetPlanSparse(int? planId) =>
(super.noSuchMethod(
_i20.Future<_i13.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetPlanSparse,
[planId],
@@ -1036,8 +1016,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i20.Future<_i13.WorkoutPlan>);
@override
_i20.Future<_i13.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) =>
(super.noSuchMethod(
_i20.Future<_i13.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod(
Invocation.method(
#fetchAndSetWorkoutPlanFull,
[workoutId],
@@ -1052,8 +1031,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i20.Future<_i13.WorkoutPlan>);
@override
_i20.Future<_i13.WorkoutPlan> addWorkout(_i13.WorkoutPlan? workout) =>
(super.noSuchMethod(
_i20.Future<_i13.WorkoutPlan> addWorkout(_i13.WorkoutPlan? workout) => (super.noSuchMethod(
Invocation.method(
#addWorkout,
[workout],
@@ -1068,8 +1046,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i20.Future<_i13.WorkoutPlan>);
@override
_i20.Future<void> editWorkout(_i13.WorkoutPlan? workout) =>
(super.noSuchMethod(
_i20.Future<void> editWorkout(_i13.WorkoutPlan? workout) => (super.noSuchMethod(
Invocation.method(
#editWorkout,
[workout],
@@ -1101,8 +1078,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
base,
],
),
returnValue:
_i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
returnValue: _i20.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i20.Future<Map<String, dynamic>>);
@override
@@ -1222,8 +1198,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i20.Future<List<_i15.Set>>);
@override
_i20.Future<void> fetchComputedSettings(_i15.Set? workoutSet) =>
(super.noSuchMethod(
_i20.Future<void> fetchComputedSettings(_i15.Set? workoutSet) => (super.noSuchMethod(
Invocation.method(
#fetchComputedSettings,
[workoutSet],
@@ -1268,8 +1243,7 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i20.Future<void>);
@override
_i20.Future<_i16.Setting> addSetting(_i16.Setting? workoutSetting) =>
(super.noSuchMethod(
_i20.Future<_i16.Setting> addSetting(_i16.Setting? workoutSetting) => (super.noSuchMethod(
Invocation.method(
#addSetting,
[workoutSetting],
@@ -1293,14 +1267,12 @@ class MockWorkoutPlansProvider extends _i1.Mock
) as _i20.Future<dynamic>);
@override
_i20.Future<_i17.WorkoutSession> addSession(_i17.WorkoutSession? session) =>
(super.noSuchMethod(
_i20.Future<_i17.WorkoutSession> addSession(_i17.WorkoutSession? session) => (super.noSuchMethod(
Invocation.method(
#addSession,
[session],
),
returnValue:
_i20.Future<_i17.WorkoutSession>.value(_FakeWorkoutSession_17(
returnValue: _i20.Future<_i17.WorkoutSession>.value(_FakeWorkoutSession_17(
this,
Invocation.method(
#addSession,