mirror of
https://github.com/wger-project/flutter.git
synced 2026-12-06 07:54:02 +01:00
Merge branch 'master' into feature/material-3
# Conflicts: # lib/theme/theme.dart # lib/widgets/dashboard/widgets.dart # lib/widgets/nutrition/nutritional_plan_detail.dart
This commit is contained in:
commit
81ed85c2f2
78 files changed
+2460
-1198
No files matched your search
+18
-18
@@ -5,32 +5,32 @@ on:
|
||||
- '**.dart'
|
||||
- 'pubspec.yaml'
|
||||
pull_request:
|
||||
branches: [ pull_request, master ]
|
||||
branches: [ master, ]
|
||||
paths:
|
||||
- '**.dart'
|
||||
- 'pubspec.yaml'
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v1
|
||||
with:
|
||||
channel: 'stable'
|
||||
flutter-version: '3.7.x'
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v1
|
||||
with:
|
||||
channel: 'stable'
|
||||
flutter-version: '3.13.x'
|
||||
|
||||
- run: dart --version
|
||||
- run: flutter --version
|
||||
- run: dart --version
|
||||
- run: flutter --version
|
||||
|
||||
- name: Install app dependencies
|
||||
run: flutter pub get
|
||||
- name: Install app dependencies
|
||||
run: flutter pub get
|
||||
|
||||
- name: Test app
|
||||
run: flutter test --coverage
|
||||
- name: Test app
|
||||
run: flutter test --coverage
|
||||
|
||||
- name: Coveralls
|
||||
uses: coverallsapp/github-action@master
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Coveralls
|
||||
uses: coverallsapp/github-action@master
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
uses: subosito/flutter-action@v1
|
||||
with:
|
||||
channel: 'stable'
|
||||
flutter-version: '3.7.x'
|
||||
flutter-version: '3.13.x'
|
||||
|
||||
- name: Get dependencies
|
||||
run: flutter pub get
|
||||
|
||||
@@ -38,13 +38,12 @@ Alternatively, you can use the test server (the db is reset every day):
|
||||
* password: `flutteruser`
|
||||
* API key: `31e2ea0322c07b9df583a9b6d1e794f7139e78d4`
|
||||
|
||||
|
||||
### 2
|
||||
|
||||
Install Flutter, and all its dependencies, and create a new virtual device:
|
||||
<https://flutter.dev/docs/get-started/install>.
|
||||
|
||||
The app currently uses flutter 3.7
|
||||
The app currently uses flutter 3.13
|
||||
|
||||
### 3
|
||||
|
||||
|
||||
@@ -26,6 +26,6 @@ subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
@@ -8,9 +8,9 @@ Razvili smo 100 % besplatan program za digitalno praćenje zdravlja i fitnessa,
|
||||
|
||||
wger je projekt otvorenog koda za:
|
||||
* Tvoje tijelo
|
||||
* Tvoje treninge
|
||||
* Tvoji treninzi
|
||||
* Tvoj napredak
|
||||
* Tvoje podatke
|
||||
* Tvoji podaci
|
||||
|
||||
Tvoje tijelo:
|
||||
Nema potrebe za guglanjem sastojaka omiljenih poslastica – odaberi dnevne obroke od više od 78.000 proizvoda i pogledaj nutritivne vrijednosti. Dodaj obroke u plan prehrane i čuvaj pregled svoje prehrane u kalendaru.
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ SPEC CHECKSUMS:
|
||||
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
|
||||
integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5
|
||||
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
||||
rive_common: 60ae7896ab40f9513974f36f015de33f70d2c5c5
|
||||
rive_common: b5b1aa30c63b8f0f00f32cddc9ea394d3d3473b5
|
||||
shared_preferences_foundation: 986fc17f3d3251412d18b0265f9c64113a8c2472
|
||||
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
|
||||
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
|
||||
|
||||
@@ -29,12 +29,11 @@ class WgerHttpException implements Exception {
|
||||
errors = {'unknown_error': 'An unknown error occurred, no further information available'};
|
||||
} else {
|
||||
try {
|
||||
errors = json.decode(responseBody);
|
||||
errors = {'unknown_error': json.decode(responseBody)};
|
||||
} catch (e) {
|
||||
errors = responseBody;
|
||||
errors = {'unknown_error': responseBody};
|
||||
}
|
||||
}
|
||||
errors = errors;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
double chartGetInterval(DateTime first, DateTime last, {divider = 3}) {
|
||||
final dayDiff = last.difference(first);
|
||||
|
||||
return dayDiff.inMilliseconds == 0 ? 1000 : dayDiff.inMilliseconds.abs() / divider;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import 'dart:math';
|
||||
import 'dart:ui';
|
||||
|
||||
const LIST_OF_COLORS8 = [
|
||||
Color(0xFF2A4C7D),
|
||||
Color(0xFF5B5291),
|
||||
Color(0xFF8E5298),
|
||||
Color(0xFFBF5092),
|
||||
Color(0xFFE7537E),
|
||||
Color(0xFFFF6461),
|
||||
Color(0xFFFF813D),
|
||||
Color(0xFFFFA600),
|
||||
];
|
||||
|
||||
const LIST_OF_COLORS5 = [
|
||||
Color(0xFF2A4C7D),
|
||||
Color(0xFF825298),
|
||||
Color(0xFFD45089),
|
||||
Color(0xFFFF6A59),
|
||||
Color(0xFFFFA600),
|
||||
];
|
||||
|
||||
const LIST_OF_COLORS3 = [
|
||||
Color(0xFF2A4C7D),
|
||||
Color(0xFFD45089),
|
||||
Color(0xFFFFA600),
|
||||
];
|
||||
|
||||
Iterable<Color> generateChartColors(int nrOfItems) sync* {
|
||||
final List<Color> colors;
|
||||
|
||||
if (nrOfItems <= 3) {
|
||||
colors = LIST_OF_COLORS3;
|
||||
} else if (nrOfItems <= 5) {
|
||||
colors = LIST_OF_COLORS5;
|
||||
} else {
|
||||
colors = LIST_OF_COLORS8;
|
||||
}
|
||||
|
||||
for (final color in colors) {
|
||||
yield color;
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,8 @@ 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),
|
||||
|
||||
@@ -24,18 +24,26 @@ ExerciseBase _$ExerciseBaseFromJson(Map<String, dynamic> json) {
|
||||
return ExerciseBase(
|
||||
id: json['id'] as int?,
|
||||
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),
|
||||
variationId: json['variations'] as int?,
|
||||
)
|
||||
..categoryId = json['category'] as int
|
||||
..musclesIds = (json['muscles'] as List<dynamic>).map((e) => e as int).toList()
|
||||
..musclesSecondaryIds =
|
||||
(json['muscles_secondary'] as List<dynamic>).map((e) => e as int).toList()
|
||||
..equipmentIds = (json['equipment'] as List<dynamic>).map((e) => e as int).toList();
|
||||
..musclesIds =
|
||||
(json['muscles'] as List<dynamic>).map((e) => e as int).toList()
|
||||
..musclesSecondaryIds = (json['muscles_secondary'] as List<dynamic>)
|
||||
.map((e) => e as int)
|
||||
.toList()
|
||||
..equipmentIds =
|
||||
(json['equipment'] as List<dynamic>).map((e) => e as int).toList();
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$ExerciseBaseToJson(ExerciseBase instance) => <String, dynamic>{
|
||||
Map<String, dynamic> _$ExerciseBaseToJson(ExerciseBase instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'uuid': instance.uuid,
|
||||
'variations': instance.variationId,
|
||||
|
||||
@@ -17,7 +17,8 @@ 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,
|
||||
};
|
||||
@@ -20,7 +20,8 @@ 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,
|
||||
|
||||
@@ -22,14 +22,17 @@ Translation _$TranslationFromJson(Map<String, dynamic> json) {
|
||||
return Translation(
|
||||
id: json['id'] as int?,
|
||||
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,
|
||||
baseId: json['exercise_base'] as int?,
|
||||
)..languageId = json['language'] as int;
|
||||
}
|
||||
|
||||
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,
|
||||
|
||||
@@ -22,7 +22,9 @@ 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,
|
||||
|
||||
@@ -20,7 +20,8 @@ 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),
|
||||
|
||||
@@ -38,7 +38,8 @@ 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,
|
||||
|
||||
@@ -43,7 +43,8 @@ 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,
|
||||
'code': instance.code,
|
||||
'name': instance.name,
|
||||
|
||||
@@ -13,14 +13,16 @@ IngredientWeightUnit _$IngredientWeightUnitFromJson(Map<String, dynamic> json) {
|
||||
);
|
||||
return IngredientWeightUnit(
|
||||
id: json['id'] as int,
|
||||
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 int,
|
||||
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,
|
||||
|
||||
@@ -9,7 +9,14 @@ 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 int?,
|
||||
|
||||
@@ -82,6 +82,30 @@ class NutritionalPlan {
|
||||
return out;
|
||||
}
|
||||
|
||||
NutritionalValues get nutritionalValuesToday {
|
||||
final now = DateTime.now();
|
||||
final today = DateTime(now.year, now.month, now.day);
|
||||
|
||||
return logEntriesValues.containsKey(today) ? logEntriesValues[today]! : NutritionalValues();
|
||||
}
|
||||
|
||||
NutritionalValues get nutritionalValues7DayAvg {
|
||||
final currentDate = DateTime.now();
|
||||
final sevenDaysAgo = currentDate.subtract(Duration(days: 7));
|
||||
|
||||
final entries = logs.where((obj) {
|
||||
DateTime objDate = obj.datetime;
|
||||
return objDate.isAfter(sevenDaysAgo) && objDate.isBefore(currentDate);
|
||||
}).toList();
|
||||
|
||||
var out = NutritionalValues();
|
||||
entries.forEach((log) {
|
||||
out = out + log.nutritionalValues;
|
||||
});
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
/// Calculates the percentage each macro nutrient adds to the total energy
|
||||
BaseNutritionalValues energyPercentage(NutritionalValues values) {
|
||||
return BaseNutritionalValues(
|
||||
|
||||
@@ -18,7 +18,8 @@ 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),
|
||||
|
||||
@@ -17,7 +17,8 @@ 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,
|
||||
};
|
||||
@@ -9,7 +9,12 @@ part of 'profile.dart';
|
||||
Profile _$ProfileFromJson(Map<String, dynamic> json) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const ['username', 'email_verified', 'is_trustworthy', 'email'],
|
||||
requiredKeys: const [
|
||||
'username',
|
||||
'email_verified',
|
||||
'is_trustworthy',
|
||||
'email'
|
||||
],
|
||||
);
|
||||
return Profile(
|
||||
username: json['username'] as String,
|
||||
|
||||
@@ -17,7 +17,8 @@ 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,
|
||||
};
|
||||
@@ -9,7 +9,14 @@ 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 int?
|
||||
@@ -21,7 +28,8 @@ 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),
|
||||
|
||||
@@ -17,7 +17,8 @@ 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,
|
||||
};
|
||||
@@ -19,7 +19,8 @@ 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,
|
||||
|
||||
@@ -415,7 +415,7 @@ class NutritionPlansProvider with ChangeNotifier {
|
||||
final data = await baseProvider.fetchPaginated(
|
||||
baseProvider.makeUrl(
|
||||
_nutritionDiaryPath,
|
||||
query: {'plan': plan.id.toString(), 'limit': '999'},
|
||||
query: {'plan': plan.id.toString(), 'limit': '999', 'ordering': 'datetime'},
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
import 'dart:convert';
|
||||
import 'dart:developer' as dev;
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
import 'package:flex_seed_scheme/flex_seed_scheme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:table_calendar/table_calendar.dart';
|
||||
@@ -61,8 +60,6 @@ final ColorScheme schemeDarkHc = SeedColorScheme.fromSeeds(
|
||||
tones: FlexTones.ultraContrast(Brightness.dark),
|
||||
);
|
||||
|
||||
// Chart colors
|
||||
const charts.Color wgerChartSecondaryColor = charts.Color(r: 0xe6, g: 0x39, b: 0x46);
|
||||
|
||||
final wgerLightTheme = ThemeData.from(
|
||||
colorScheme: schemeLight,
|
||||
|
||||
@@ -29,7 +29,7 @@ import 'package:wger/screens/form_screen.dart';
|
||||
import 'package:wger/widgets/core/about.dart';
|
||||
import 'package:wger/widgets/user/forms.dart';
|
||||
|
||||
class MainAppBar extends StatelessWidget with PreferredSizeWidget {
|
||||
class MainAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
final String _title;
|
||||
|
||||
MainAppBar(this._title);
|
||||
@@ -113,7 +113,7 @@ class MainAppBar extends StatelessWidget with PreferredSizeWidget {
|
||||
}
|
||||
|
||||
/// App bar that only displays a title
|
||||
class EmptyAppBar extends StatelessWidget with PreferredSizeWidget {
|
||||
class EmptyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
final String _title;
|
||||
|
||||
EmptyAppBar(this._title);
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* This file is part of wger Workout Manager <https://github.com/wger-project>.
|
||||
* Copyright (C) 2020, 2021 wger Team
|
||||
*
|
||||
* wger Workout Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wger Workout Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
|
||||
class MeasurementChartEntry {
|
||||
num value;
|
||||
DateTime date;
|
||||
|
||||
MeasurementChartEntry(this.value, this.date);
|
||||
}
|
||||
|
||||
/// Weight chart widget
|
||||
class MeasurementChartWidget extends StatelessWidget {
|
||||
final List<MeasurementChartEntry> _entries;
|
||||
final String unit;
|
||||
|
||||
/// [_entries] is a list of [MeasurementChartEntry]
|
||||
const MeasurementChartWidget(this._entries, {this.unit = 'kg'});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final unitTickFormatter = charts.BasicNumericTickFormatterSpec((num? value) => '$value $unit');
|
||||
|
||||
return charts.TimeSeriesChart(
|
||||
[
|
||||
charts.Series<MeasurementChartEntry, DateTime>(
|
||||
id: 'Measurement',
|
||||
colorFn: (_, __) => wgerChartSecondaryColor,
|
||||
domainFn: (MeasurementChartEntry entry, _) => entry.date,
|
||||
measureFn: (MeasurementChartEntry entry, _) => entry.value,
|
||||
data: _entries,
|
||||
)
|
||||
],
|
||||
defaultRenderer: charts.LineRendererConfig(includePoints: true),
|
||||
primaryMeasureAxis: charts.NumericAxisSpec(
|
||||
tickProviderSpec: const charts.BasicNumericTickProviderSpec(zeroBound: false),
|
||||
tickFormatterSpec: unitTickFormatter,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ import 'package:wger/screens/nutritional_plan_screen.dart';
|
||||
import 'package:wger/screens/weight_screen.dart';
|
||||
import 'package:wger/screens/workout_plan_screen.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
import 'package:wger/widgets/core/charts.dart';
|
||||
import 'package:wger/widgets/measurements/charts.dart';
|
||||
import 'package:wger/widgets/core/core.dart';
|
||||
import 'package:wger/widgets/measurements/categories_card.dart';
|
||||
import 'package:wger/widgets/measurements/forms.dart';
|
||||
@@ -182,18 +182,15 @@ class _DashboardNutritionWidgetState extends State<DashboardNutritionWidget> {
|
||||
},
|
||||
),
|
||||
if (_hasContent)
|
||||
Container(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
...getContent(),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
height: 180,
|
||||
child: NutritionalPlanPieChartWidget(_plan!.nutritionalValues),
|
||||
)
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
...getContent(),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
height: 180,
|
||||
child: FlNutritionalPlanPieChartWidget(_plan!.nutritionalValues),
|
||||
)
|
||||
],
|
||||
)
|
||||
else
|
||||
NothingFound(
|
||||
@@ -267,9 +264,8 @@ class _DashboardWeightWidgetState extends State<DashboardWeightWidget> {
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
height: 180,
|
||||
child: MeasurementChartWidget(weightEntriesData.items
|
||||
height: 200,
|
||||
child: MeasurementChartWidgetFl(weightEntriesData.items
|
||||
.map((e) => MeasurementChartEntry(e.weight, e.date))
|
||||
.toList()),
|
||||
),
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import '../../models/measurements/measurement_category.dart';
|
||||
import '../../screens/form_screen.dart';
|
||||
import '../../screens/measurement_entries_screen.dart';
|
||||
import '../core/charts.dart';
|
||||
import 'charts.dart';
|
||||
import 'forms.dart';
|
||||
|
||||
class CategoriesCard extends StatelessWidget {
|
||||
@@ -29,7 +29,7 @@ class CategoriesCard extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
height: 220,
|
||||
child: MeasurementChartWidget(
|
||||
child: MeasurementChartWidgetFl(
|
||||
currentCategory.entries.map((e) => MeasurementChartEntry(e.value, e.date)).toList(),
|
||||
unit: currentCategory.unit,
|
||||
),
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
/*
|
||||
* This file is part of wger Workout Manager <https://github.com/wger-project>.
|
||||
* Copyright (C) 2020, 2021 wger Team
|
||||
*
|
||||
* wger Workout Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wger Workout Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:wger/helpers/charts.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
|
||||
class MeasurementChartWidgetFl extends StatefulWidget {
|
||||
final List<MeasurementChartEntry> _entries;
|
||||
final String unit;
|
||||
|
||||
const MeasurementChartWidgetFl(this._entries, {this.unit = 'kg'});
|
||||
|
||||
@override
|
||||
State<MeasurementChartWidgetFl> createState() => _MeasurementChartWidgetFlState();
|
||||
}
|
||||
|
||||
class _MeasurementChartWidgetFlState extends State<MeasurementChartWidgetFl> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AspectRatio(
|
||||
aspectRatio: 1.70,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 18,
|
||||
left: 12,
|
||||
top: 24,
|
||||
bottom: 12,
|
||||
),
|
||||
child: LineChart(
|
||||
mainData(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
LineTouchData tooltipData() {
|
||||
return LineTouchData(touchTooltipData: LineTouchTooltipData(getTooltipItems: (touchedSpots) {
|
||||
return touchedSpots.map((touchedSpot) {
|
||||
return LineTooltipItem(
|
||||
'${touchedSpot.y} kg',
|
||||
const TextStyle(color: Colors.red, fontWeight: FontWeight.bold),
|
||||
);
|
||||
}).toList();
|
||||
}));
|
||||
}
|
||||
|
||||
LineChartData mainData() {
|
||||
return LineChartData(
|
||||
lineTouchData: tooltipData(),
|
||||
gridData: FlGridData(
|
||||
show: true,
|
||||
drawVerticalLine: true,
|
||||
//horizontalInterval: 1,
|
||||
//verticalInterval: interval,
|
||||
getDrawingHorizontalLine: (value) {
|
||||
return FlLine(
|
||||
color: Colors.grey,
|
||||
strokeWidth: 1,
|
||||
);
|
||||
},
|
||||
getDrawingVerticalLine: (value) {
|
||||
return FlLine(
|
||||
color: Colors.grey,
|
||||
strokeWidth: 1,
|
||||
);
|
||||
},
|
||||
),
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
rightTitles: AxisTitles(
|
||||
sideTitles: SideTitles(showTitles: false),
|
||||
),
|
||||
topTitles: AxisTitles(
|
||||
sideTitles: SideTitles(showTitles: false),
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
sideTitles: SideTitles(
|
||||
showTitles: true,
|
||||
getTitlesWidget: (value, meta) {
|
||||
// Don't show the first and last entries, otherwise they'll overlap with the
|
||||
// calculated interval
|
||||
if (value == meta.min || value == meta.max) {
|
||||
return const Text('');
|
||||
}
|
||||
final DateTime date = DateTime.fromMillisecondsSinceEpoch(value.toInt());
|
||||
return Text(
|
||||
DateFormat.yMd(Localizations.localeOf(context).languageCode).format(date),
|
||||
);
|
||||
},
|
||||
interval: widget._entries.isNotEmpty
|
||||
? chartGetInterval(widget._entries.last.date, widget._entries.first.date)
|
||||
: 1000,
|
||||
),
|
||||
),
|
||||
leftTitles: AxisTitles(
|
||||
sideTitles: SideTitles(
|
||||
showTitles: true,
|
||||
reservedSize: 65,
|
||||
getTitlesWidget: (value, meta) {
|
||||
return Text(
|
||||
'$value ${widget.unit}',
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: Border.all(color: const Color(0xff37434d)),
|
||||
),
|
||||
lineBarsData: [
|
||||
LineChartBarData(
|
||||
spots: [
|
||||
...widget._entries
|
||||
.map((e) => FlSpot(e.date.millisecondsSinceEpoch.toDouble(), e.value.toDouble()))
|
||||
],
|
||||
isCurved: false,
|
||||
color: wgerSecondaryColor,
|
||||
barWidth: 2,
|
||||
isStrokeCapRound: true,
|
||||
dotData: FlDotData(
|
||||
show: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MeasurementChartEntry {
|
||||
num value;
|
||||
DateTime date;
|
||||
|
||||
MeasurementChartEntry(this.value, this.date);
|
||||
}
|
||||
|
||||
class Indicator extends StatelessWidget {
|
||||
const Indicator({
|
||||
super.key,
|
||||
required this.color,
|
||||
required this.text,
|
||||
required this.isSquare,
|
||||
this.size = 16,
|
||||
this.marginRight = 15,
|
||||
this.textColor,
|
||||
});
|
||||
|
||||
final Color color;
|
||||
final String text;
|
||||
final bool isSquare;
|
||||
final double size;
|
||||
final double marginRight;
|
||||
final Color? textColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: size,
|
||||
height: size,
|
||||
decoration: BoxDecoration(
|
||||
shape: isSquare ? BoxShape.rectangle : BoxShape.circle,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 4,
|
||||
),
|
||||
Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
color: textColor,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: marginRight,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ import 'package:wger/models/measurements/measurement_category.dart';
|
||||
import 'package:wger/providers/measurement.dart';
|
||||
import 'package:wger/screens/form_screen.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
import 'package:wger/widgets/core/charts.dart';
|
||||
import 'package:wger/widgets/measurements/charts.dart';
|
||||
|
||||
import 'forms.dart';
|
||||
|
||||
@@ -39,7 +39,7 @@ class EntriesList extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
height: 220,
|
||||
child: MeasurementChartWidget(
|
||||
child: MeasurementChartWidgetFl(
|
||||
_category.entries.map((e) => MeasurementChartEntry(e.value, e.date)).toList(),
|
||||
unit: _category.unit,
|
||||
),
|
||||
|
||||
+520
-366
@@ -16,13 +16,14 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:wger/helpers/colors.dart';
|
||||
import 'package:wger/models/nutrition/nutritional_plan.dart';
|
||||
import 'package:wger/models/nutrition/nutritional_values.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
import 'package:wger/widgets/measurements/charts.dart';
|
||||
|
||||
class NutritionData {
|
||||
final String name;
|
||||
@@ -31,61 +32,130 @@ class NutritionData {
|
||||
NutritionData(this.name, this.value);
|
||||
}
|
||||
|
||||
/// Nutritional plan pie chart widget
|
||||
class NutritionalPlanPieChartWidget extends StatelessWidget {
|
||||
final NutritionalValues _nutritionalValues;
|
||||
class FlNutritionalPlanPieChartWidget extends StatefulWidget {
|
||||
final NutritionalValues nutritionalValues;
|
||||
|
||||
/// [_nutritionalValues] are the calculated [NutritionalValues] for the wanted
|
||||
/// plan.
|
||||
const NutritionalPlanPieChartWidget(this._nutritionalValues);
|
||||
const FlNutritionalPlanPieChartWidget(this.nutritionalValues);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => FlNutritionalPlanPieChartState();
|
||||
}
|
||||
|
||||
class FlNutritionalPlanPieChartState extends State<FlNutritionalPlanPieChartWidget> {
|
||||
int touchedIndex = -1;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (_nutritionalValues.energy == 0) {
|
||||
return Container();
|
||||
}
|
||||
return Row(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 18,
|
||||
),
|
||||
Expanded(
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: PieChart(
|
||||
PieChartData(
|
||||
pieTouchData: PieTouchData(
|
||||
touchCallback: (FlTouchEvent event, pieTouchResponse) {
|
||||
setState(() {
|
||||
if (!event.isInterestedForInteractions ||
|
||||
pieTouchResponse == null ||
|
||||
pieTouchResponse.touchedSection == null) {
|
||||
touchedIndex = -1;
|
||||
return;
|
||||
}
|
||||
touchedIndex = pieTouchResponse.touchedSection!.touchedSectionIndex;
|
||||
});
|
||||
},
|
||||
),
|
||||
borderData: FlBorderData(
|
||||
show: false,
|
||||
),
|
||||
sectionsSpace: 0,
|
||||
centerSpaceRadius: 0,
|
||||
sections: showingSections(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Indicator(
|
||||
color: LIST_OF_COLORS3[0],
|
||||
text: AppLocalizations.of(context).fat,
|
||||
isSquare: true,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Indicator(
|
||||
color: LIST_OF_COLORS3[1],
|
||||
text: AppLocalizations.of(context).protein,
|
||||
isSquare: true,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Indicator(
|
||||
color: LIST_OF_COLORS3[2],
|
||||
text: AppLocalizations.of(context).carbohydrates,
|
||||
isSquare: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 28,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return charts.PieChart<String>([
|
||||
charts.Series<NutritionData, String>(
|
||||
id: 'NutritionalValues',
|
||||
domainFn: (nutritionEntry, index) => nutritionEntry.name,
|
||||
measureFn: (nutritionEntry, index) => nutritionEntry.value,
|
||||
data: [
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).protein,
|
||||
_nutritionalValues.protein,
|
||||
),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).fat,
|
||||
_nutritionalValues.fat,
|
||||
),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).carbohydrates,
|
||||
_nutritionalValues.carbohydrates,
|
||||
),
|
||||
],
|
||||
labelAccessorFn: (NutritionData row, _) =>
|
||||
'${row.name}\n${row.value.toStringAsFixed(0)}${AppLocalizations.of(context).g}',
|
||||
)
|
||||
],
|
||||
defaultRenderer: charts.ArcRendererConfig(arcWidth: 60, arcRendererDecorators: [
|
||||
charts.ArcLabelDecorator(
|
||||
labelPosition: charts.ArcLabelPosition.outside,
|
||||
)
|
||||
])
|
||||
/*
|
||||
defaultRenderer: new charts.ArcRendererConfig(
|
||||
arcWidth: 60,
|
||||
arcRendererDecorators: [new charts.ArcLabelDecorator()],
|
||||
),
|
||||
List<PieChartSectionData> showingSections() {
|
||||
final colors = generateChartColors(3).iterator;
|
||||
|
||||
*/
|
||||
);
|
||||
return List.generate(3, (i) {
|
||||
final isTouched = i == touchedIndex;
|
||||
final radius = isTouched ? 92.0 : 80.0;
|
||||
colors.moveNext();
|
||||
|
||||
switch (i) {
|
||||
case 0:
|
||||
return PieChartSectionData(
|
||||
color: colors.current,
|
||||
value: widget.nutritionalValues.fat,
|
||||
title: '${widget.nutritionalValues.fat.toStringAsFixed(0)}g',
|
||||
titlePositionPercentageOffset: 0.5,
|
||||
radius: radius,
|
||||
titleStyle: const TextStyle(color: Colors.white70));
|
||||
case 1:
|
||||
return PieChartSectionData(
|
||||
color: colors.current,
|
||||
value: widget.nutritionalValues.protein,
|
||||
title: '${widget.nutritionalValues.protein.toStringAsFixed(0)}g',
|
||||
titlePositionPercentageOffset: 0.5,
|
||||
radius: radius,
|
||||
);
|
||||
case 2:
|
||||
return PieChartSectionData(
|
||||
color: colors.current,
|
||||
value: widget.nutritionalValues.carbohydrates,
|
||||
title: '${widget.nutritionalValues.carbohydrates.toStringAsFixed(0)}g',
|
||||
titlePositionPercentageOffset: 0.5,
|
||||
radius: radius,
|
||||
);
|
||||
|
||||
default:
|
||||
throw Error();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class NutritionalDiaryChartWidget extends StatelessWidget {
|
||||
const NutritionalDiaryChartWidget({
|
||||
class NutritionalDiaryChartWidgetFl extends StatefulWidget {
|
||||
const NutritionalDiaryChartWidgetFl({
|
||||
Key? key,
|
||||
required NutritionalPlan nutritionalPlan,
|
||||
}) : _nutritionalPlan = nutritionalPlan,
|
||||
@@ -93,338 +163,422 @@ class NutritionalDiaryChartWidget extends StatelessWidget {
|
||||
|
||||
final NutritionalPlan _nutritionalPlan;
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => NutritionalDiaryChartWidgetFlState();
|
||||
}
|
||||
|
||||
class NutritionalDiaryChartWidgetFlState extends State<NutritionalDiaryChartWidgetFl> {
|
||||
Widget bottomTitles(double value, TitleMeta meta) {
|
||||
const style = TextStyle(fontSize: 10);
|
||||
String text;
|
||||
switch (value.toInt()) {
|
||||
case 0:
|
||||
text = AppLocalizations.of(context).protein;
|
||||
break;
|
||||
case 1:
|
||||
text = AppLocalizations.of(context).carbohydrates;
|
||||
break;
|
||||
case 2:
|
||||
text = AppLocalizations.of(context).sugars;
|
||||
break;
|
||||
case 3:
|
||||
text = AppLocalizations.of(context).fat;
|
||||
break;
|
||||
case 4:
|
||||
text = AppLocalizations.of(context).saturatedFat;
|
||||
break;
|
||||
|
||||
default:
|
||||
text = '';
|
||||
break;
|
||||
}
|
||||
return SideTitleWidget(
|
||||
axisSide: meta.axisSide,
|
||||
child: Text(text, style: style),
|
||||
);
|
||||
}
|
||||
|
||||
Widget leftTitles(double value, TitleMeta meta) {
|
||||
if (value == meta.max) {
|
||||
return Container();
|
||||
}
|
||||
const style = TextStyle(
|
||||
fontSize: 10,
|
||||
);
|
||||
return SideTitleWidget(
|
||||
axisSide: meta.axisSide,
|
||||
child: Text(
|
||||
meta.formattedValue,
|
||||
style: style,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return charts.TimeSeriesChart(
|
||||
[
|
||||
charts.Series<List<dynamic>, DateTime>(
|
||||
id: 'NutritionDiary',
|
||||
colorFn: (datum, index) => wgerChartSecondaryColor,
|
||||
domainFn: (datum, index) => datum[1],
|
||||
measureFn: (datum, index) => datum[0].energy,
|
||||
data: _nutritionalPlan.logEntriesValues.keys
|
||||
.map((e) => [_nutritionalPlan.logEntriesValues[e], e])
|
||||
.toList(),
|
||||
)
|
||||
],
|
||||
defaultRenderer: charts.BarRendererConfig<DateTime>(),
|
||||
behaviors: [
|
||||
charts.RangeAnnotation([
|
||||
charts.LineAnnotationSegment(
|
||||
_nutritionalPlan.nutritionalValues.energy,
|
||||
charts.RangeAnnotationAxisType.measure,
|
||||
strokeWidthPx: 2,
|
||||
color: charts.MaterialPalette.gray.shade600,
|
||||
),
|
||||
]),
|
||||
],
|
||||
final planned = widget._nutritionalPlan.nutritionalValues;
|
||||
final loggedToday = widget._nutritionalPlan.nutritionalValuesToday;
|
||||
final logged7DayAvg = widget._nutritionalPlan.nutritionalValues7DayAvg;
|
||||
|
||||
final colorPlanned = LIST_OF_COLORS3[0];
|
||||
final colorLoggedToday = LIST_OF_COLORS3[1];
|
||||
final colorLogged7Day = LIST_OF_COLORS3[2];
|
||||
|
||||
return AspectRatio(
|
||||
aspectRatio: 1.66,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 16),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final barsSpace = 4.0 * constraints.maxWidth / 400;
|
||||
final barsWidth = 8.0 * constraints.maxWidth / 400;
|
||||
return BarChart(
|
||||
BarChartData(
|
||||
alignment: BarChartAlignment.center,
|
||||
barTouchData: BarTouchData(
|
||||
enabled: false,
|
||||
),
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
bottomTitles: AxisTitles(
|
||||
sideTitles: SideTitles(
|
||||
showTitles: true,
|
||||
reservedSize: 48,
|
||||
getTitlesWidget: bottomTitles,
|
||||
),
|
||||
),
|
||||
leftTitles: AxisTitles(
|
||||
sideTitles: SideTitles(
|
||||
showTitles: true,
|
||||
reservedSize: 40,
|
||||
getTitlesWidget: leftTitles,
|
||||
),
|
||||
),
|
||||
topTitles: AxisTitles(
|
||||
sideTitles: SideTitles(showTitles: false),
|
||||
),
|
||||
rightTitles: AxisTitles(
|
||||
sideTitles: SideTitles(showTitles: false),
|
||||
),
|
||||
),
|
||||
gridData: FlGridData(
|
||||
show: true,
|
||||
checkToShowHorizontalLine: (value) => value % 10 == 0,
|
||||
getDrawingHorizontalLine: (value) => FlLine(
|
||||
color: Colors.black,
|
||||
strokeWidth: 1,
|
||||
),
|
||||
drawVerticalLine: false,
|
||||
),
|
||||
borderData: FlBorderData(
|
||||
show: false,
|
||||
),
|
||||
groupsSpace: 30,
|
||||
// groupsSpace: barsSpace,
|
||||
barGroups: [
|
||||
BarChartGroupData(
|
||||
x: 0,
|
||||
barsSpace: barsSpace,
|
||||
barRods: [
|
||||
BarChartRodData(
|
||||
toY: planned.protein,
|
||||
color: colorPlanned,
|
||||
width: barsWidth,
|
||||
),
|
||||
BarChartRodData(
|
||||
toY: loggedToday.protein,
|
||||
color: colorLoggedToday,
|
||||
width: barsWidth,
|
||||
),
|
||||
BarChartRodData(
|
||||
toY: logged7DayAvg.protein,
|
||||
color: colorLogged7Day,
|
||||
width: barsWidth,
|
||||
),
|
||||
],
|
||||
),
|
||||
BarChartGroupData(
|
||||
x: 1,
|
||||
barsSpace: barsSpace,
|
||||
barRods: [
|
||||
BarChartRodData(
|
||||
toY: planned.carbohydrates,
|
||||
color: colorPlanned,
|
||||
width: barsWidth,
|
||||
),
|
||||
BarChartRodData(
|
||||
toY: loggedToday.carbohydrates,
|
||||
color: colorLoggedToday,
|
||||
width: barsWidth,
|
||||
),
|
||||
BarChartRodData(
|
||||
toY: logged7DayAvg.carbohydrates,
|
||||
color: colorLogged7Day,
|
||||
width: barsWidth,
|
||||
),
|
||||
],
|
||||
),
|
||||
BarChartGroupData(
|
||||
x: 2,
|
||||
barsSpace: barsSpace,
|
||||
barRods: [
|
||||
BarChartRodData(
|
||||
toY: planned.carbohydratesSugar,
|
||||
color: colorPlanned,
|
||||
width: barsWidth,
|
||||
),
|
||||
BarChartRodData(
|
||||
toY: loggedToday.carbohydratesSugar,
|
||||
color: colorLoggedToday,
|
||||
width: barsWidth,
|
||||
),
|
||||
BarChartRodData(
|
||||
toY: logged7DayAvg.carbohydratesSugar,
|
||||
color: colorLogged7Day,
|
||||
width: barsWidth,
|
||||
),
|
||||
],
|
||||
),
|
||||
BarChartGroupData(
|
||||
x: 3,
|
||||
barsSpace: barsSpace,
|
||||
barRods: [
|
||||
BarChartRodData(
|
||||
toY: planned.fat,
|
||||
color: colorPlanned,
|
||||
width: barsWidth,
|
||||
),
|
||||
BarChartRodData(
|
||||
toY: loggedToday.fat,
|
||||
color: colorLoggedToday,
|
||||
width: barsWidth,
|
||||
),
|
||||
BarChartRodData(
|
||||
toY: logged7DayAvg.fat,
|
||||
color: colorLogged7Day,
|
||||
width: barsWidth,
|
||||
),
|
||||
],
|
||||
),
|
||||
BarChartGroupData(
|
||||
x: 4,
|
||||
barsSpace: barsSpace,
|
||||
barRods: [
|
||||
BarChartRodData(
|
||||
toY: planned.fatSaturated,
|
||||
color: colorPlanned,
|
||||
width: barsWidth,
|
||||
),
|
||||
BarChartRodData(
|
||||
toY: loggedToday.fatSaturated,
|
||||
color: colorLoggedToday,
|
||||
width: barsWidth,
|
||||
),
|
||||
BarChartRodData(
|
||||
toY: logged7DayAvg.fatSaturated,
|
||||
color: colorLogged7Day,
|
||||
width: barsWidth,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
// barGroups: getData(barsWidth, barsSpace),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Nutritional plan hatch bar chart widget
|
||||
class NutritionalPlanHatchBarChartWidget extends StatelessWidget {
|
||||
class FlNutritionalDiaryChartWidget extends StatefulWidget {
|
||||
final NutritionalPlan _nutritionalPlan;
|
||||
|
||||
/// [_nutritionalPlan] is current opened nutrition plan as plan detail.
|
||||
const NutritionalPlanHatchBarChartWidget(this._nutritionalPlan);
|
||||
const FlNutritionalDiaryChartWidget({
|
||||
Key? key,
|
||||
required NutritionalPlan nutritionalPlan,
|
||||
}) : _nutritionalPlan = nutritionalPlan,
|
||||
super(key: key);
|
||||
|
||||
NutritionalValues nutritionalValuesFromPlanLogsSevenDayAvg() {
|
||||
NutritionalValues sevenDaysAvg = NutritionalValues();
|
||||
int count = 0;
|
||||
final Color barBackgroundColor = Colors.black12;
|
||||
final Color barColor = Colors.red;
|
||||
final Color touchedBarColor = Colors.deepOrange;
|
||||
|
||||
final now = DateTime.now();
|
||||
final today = DateTime(now.year, now.month, now.day);
|
||||
@override
|
||||
State<StatefulWidget> createState() => FlNutritionalDiaryChartWidgetState();
|
||||
}
|
||||
|
||||
_nutritionalPlan.logEntriesValues.forEach((key, value) {
|
||||
if (key.difference(today).inDays >= -7) {
|
||||
sevenDaysAvg += value;
|
||||
count++;
|
||||
}
|
||||
});
|
||||
class FlNutritionalDiaryChartWidgetState extends State<FlNutritionalDiaryChartWidget> {
|
||||
final Duration animDuration = const Duration(milliseconds: 250);
|
||||
|
||||
if (count != 0) {
|
||||
sevenDaysAvg.energy = sevenDaysAvg.energy / count;
|
||||
sevenDaysAvg.protein = sevenDaysAvg.protein / count;
|
||||
sevenDaysAvg.carbohydrates = sevenDaysAvg.carbohydrates / count;
|
||||
sevenDaysAvg.carbohydratesSugar = sevenDaysAvg.carbohydratesSugar / count;
|
||||
sevenDaysAvg.fat = sevenDaysAvg.fat / count;
|
||||
sevenDaysAvg.fatSaturated = sevenDaysAvg.fatSaturated / count;
|
||||
sevenDaysAvg.fibres = sevenDaysAvg.fibres / count;
|
||||
sevenDaysAvg.sodium = sevenDaysAvg.sodium / count;
|
||||
}
|
||||
|
||||
return sevenDaysAvg;
|
||||
}
|
||||
|
||||
NutritionalValues nutritionalValuesFromPlanLogsToday() {
|
||||
final now = DateTime.now();
|
||||
final today = DateTime(now.year, now.month, now.day);
|
||||
|
||||
return _nutritionalPlan.logEntriesValues[_nutritionalPlan.logEntriesValues.keys
|
||||
.firstWhereOrNull((d) => d.difference(today).inDays == 0)] ??
|
||||
NutritionalValues();
|
||||
}
|
||||
int touchedIndex = -1;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final NutritionalValues loggedNutritionalValues = nutritionalValuesFromPlanLogsToday();
|
||||
final NutritionalValues sevenDayAvg = nutritionalValuesFromPlanLogsSevenDayAvg();
|
||||
|
||||
if (_nutritionalPlan.nutritionalValues.energy == 0) {
|
||||
return Container();
|
||||
}
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
height: 220,
|
||||
child: charts.BarChart(
|
||||
[
|
||||
charts.Series<NutritionData, String>(
|
||||
id: 'Planned',
|
||||
domainFn: (nutritionEntry, index) => nutritionEntry.name,
|
||||
measureFn: (nutritionEntry, index) => nutritionEntry.value,
|
||||
data: [
|
||||
NutritionData(AppLocalizations.of(context).energy,
|
||||
_nutritionalPlan.nutritionalValues.energy),
|
||||
],
|
||||
),
|
||||
charts.Series<NutritionData, String>(
|
||||
id: 'Logged',
|
||||
domainFn: (nutritionEntry, index) => nutritionEntry.name,
|
||||
measureFn: (nutritionEntry, index) => nutritionEntry.value,
|
||||
fillPatternFn: (nutritionEntry, index) => charts.FillPatternType.forwardHatch,
|
||||
data: [
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).energy, loggedNutritionalValues.energy),
|
||||
],
|
||||
),
|
||||
charts.Series<NutritionData, String>(
|
||||
id: 'Avg',
|
||||
domainFn: (nutritionEntry, index) => nutritionEntry.name,
|
||||
measureFn: (nutritionEntry, index) => nutritionEntry.value,
|
||||
data: [
|
||||
NutritionData(AppLocalizations.of(context).energy, sevenDayAvg.energy),
|
||||
],
|
||||
),
|
||||
],
|
||||
animate: true,
|
||||
domainAxis: const charts.OrdinalAxisSpec(
|
||||
///labelRotation was added to rotate text of X Axis. Without that,
|
||||
///titles would overlap each other
|
||||
renderSpec: charts.SmallTickRendererSpec(labelRotation: 60),
|
||||
),
|
||||
barGroupingType: charts.BarGroupingType.grouped,
|
||||
defaultRenderer: charts.BarRendererConfig(
|
||||
groupingType: charts.BarGroupingType.grouped, strokeWidthPx: 0.0, maxBarWidthPx: 8),
|
||||
primaryMeasureAxis: const charts.NumericAxisSpec(
|
||||
tickProviderSpec: charts.BasicNumericTickProviderSpec(desiredTickCount: 5),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
height: 300,
|
||||
child: charts.BarChart(
|
||||
[
|
||||
charts.Series<NutritionData, String>(
|
||||
id: 'Planned',
|
||||
domainFn: (nutritionEntry, index) => nutritionEntry.name,
|
||||
measureFn: (nutritionEntry, index) => nutritionEntry.value,
|
||||
data: [
|
||||
// NutritionData(
|
||||
// AppLocalizations.of(context).energy,
|
||||
// _nutritionalPlan.nutritionalValues.energy,
|
||||
// ),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).protein,
|
||||
_nutritionalPlan.nutritionalValues.protein,
|
||||
),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).carbohydrates,
|
||||
_nutritionalPlan.nutritionalValues.carbohydrates,
|
||||
),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).sugars,
|
||||
_nutritionalPlan.nutritionalValues.carbohydratesSugar,
|
||||
),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).fat,
|
||||
_nutritionalPlan.nutritionalValues.fat,
|
||||
),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).saturatedFat,
|
||||
_nutritionalPlan.nutritionalValues.fatSaturated,
|
||||
),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).fibres,
|
||||
_nutritionalPlan.nutritionalValues.fibres,
|
||||
),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).sodium,
|
||||
_nutritionalPlan.nutritionalValues.sodium,
|
||||
),
|
||||
],
|
||||
),
|
||||
charts.Series<NutritionData, String>(
|
||||
id: 'Logged',
|
||||
domainFn: (nutritionEntry, index) => nutritionEntry.name,
|
||||
measureFn: (nutritionEntry, index) => nutritionEntry.value,
|
||||
fillPatternFn: (nutritionEntry, index) => charts.FillPatternType.forwardHatch,
|
||||
data: [
|
||||
// NutritionData(
|
||||
// AppLocalizations.of(context).energy,
|
||||
// loggedNutritionalValues.energy
|
||||
// ),
|
||||
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).protein, loggedNutritionalValues.protein),
|
||||
NutritionData(AppLocalizations.of(context).carbohydrates,
|
||||
loggedNutritionalValues.carbohydrates),
|
||||
NutritionData(AppLocalizations.of(context).sugars,
|
||||
loggedNutritionalValues.carbohydratesSugar),
|
||||
NutritionData(AppLocalizations.of(context).fat, loggedNutritionalValues.fat),
|
||||
NutritionData(AppLocalizations.of(context).saturatedFat,
|
||||
loggedNutritionalValues.fatSaturated),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).fibres, loggedNutritionalValues.fibres),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).sodium, loggedNutritionalValues.sodium),
|
||||
],
|
||||
),
|
||||
charts.Series<NutritionData, String>(
|
||||
id: 'Avg',
|
||||
domainFn: (nutritionEntry, index) => nutritionEntry.name,
|
||||
measureFn: (nutritionEntry, index) => nutritionEntry.value,
|
||||
data: [
|
||||
// NutritionData(AppLocalizations.of(context).energy, sevenDayAvg.energy),
|
||||
NutritionData(AppLocalizations.of(context).protein, sevenDayAvg.protein),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).carbohydrates, sevenDayAvg.carbohydrates),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).sugars, sevenDayAvg.carbohydratesSugar),
|
||||
NutritionData(AppLocalizations.of(context).fat, sevenDayAvg.fat),
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).saturatedFat, sevenDayAvg.fatSaturated),
|
||||
NutritionData(AppLocalizations.of(context).fibres, sevenDayAvg.fibres),
|
||||
NutritionData(AppLocalizations.of(context).sodium, sevenDayAvg.sodium),
|
||||
],
|
||||
),
|
||||
],
|
||||
animate: true,
|
||||
domainAxis: const charts.OrdinalAxisSpec(
|
||||
///labelRotation was added to rotate text of X Axis. Without that,
|
||||
///titles would overlap each other
|
||||
renderSpec: charts.SmallTickRendererSpec(labelRotation: 60),
|
||||
),
|
||||
barGroupingType: charts.BarGroupingType.grouped,
|
||||
primaryMeasureAxis: const charts.NumericAxisSpec(
|
||||
tickProviderSpec: charts.BasicNumericTickProviderSpec(
|
||||
desiredTickCount: 5,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//creating a seperate chart for energy as the energy value and other nutrient's value is not compatable to show in one graph
|
||||
class EnergyChart extends StatelessWidget {
|
||||
const EnergyChart({Key? key, required this.nutritionalPlan}) : super(key: key);
|
||||
final NutritionalPlan nutritionalPlan;
|
||||
NutritionalValues nutritionalValuesFromPlanLogsSevenDayAvg() {
|
||||
NutritionalValues sevenDaysAvg = NutritionalValues();
|
||||
int count = 0;
|
||||
|
||||
final now = DateTime.now();
|
||||
final today = DateTime(now.year, now.month, now.day);
|
||||
|
||||
nutritionalPlan.logEntriesValues.forEach((key, value) {
|
||||
if (key.difference(today).inDays >= -7) {
|
||||
sevenDaysAvg += value;
|
||||
count++;
|
||||
}
|
||||
});
|
||||
|
||||
if (count != 0) {
|
||||
sevenDaysAvg.energy = sevenDaysAvg.energy / count;
|
||||
sevenDaysAvg.protein = sevenDaysAvg.protein / count;
|
||||
sevenDaysAvg.carbohydrates = sevenDaysAvg.carbohydrates / count;
|
||||
sevenDaysAvg.carbohydratesSugar = sevenDaysAvg.carbohydratesSugar / count;
|
||||
sevenDaysAvg.fat = sevenDaysAvg.fat / count;
|
||||
sevenDaysAvg.fatSaturated = sevenDaysAvg.fatSaturated / count;
|
||||
sevenDaysAvg.fibres = sevenDaysAvg.fibres / count;
|
||||
sevenDaysAvg.sodium = sevenDaysAvg.sodium / count;
|
||||
}
|
||||
|
||||
return sevenDaysAvg;
|
||||
}
|
||||
|
||||
NutritionalValues nutritionalValuesFromPlanLogsToday() {
|
||||
final now = DateTime.now();
|
||||
final today = DateTime(now.year, now.month, now.day);
|
||||
|
||||
return nutritionalPlan.logEntriesValues[nutritionalPlan.logEntriesValues.keys
|
||||
.firstWhereOrNull((d) => d.difference(today).inDays == 0)] ??
|
||||
NutritionalValues();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final NutritionalValues loggedNutritionalValues = nutritionalValuesFromPlanLogsToday();
|
||||
final NutritionalValues sevenDayAvg = nutritionalValuesFromPlanLogsSevenDayAvg();
|
||||
|
||||
if (nutritionalPlan.nutritionalValues.energy == 0) {
|
||||
return Container();
|
||||
}
|
||||
|
||||
return charts.BarChart(
|
||||
[
|
||||
charts.Series<NutritionData, String>(
|
||||
id: 'Planned',
|
||||
domainFn: (nutritionEntry, index) => nutritionEntry.name,
|
||||
measureFn: (nutritionEntry, index) => nutritionEntry.value,
|
||||
data: [
|
||||
NutritionData(
|
||||
AppLocalizations.of(context).energy,
|
||||
nutritionalPlan.nutritionalValues.energy,
|
||||
),
|
||||
],
|
||||
),
|
||||
charts.Series<NutritionData, String>(
|
||||
id: 'Logged',
|
||||
domainFn: (nutritionEntry, index) => nutritionEntry.name,
|
||||
measureFn: (nutritionEntry, index) => nutritionEntry.value,
|
||||
fillPatternFn: (nutritionEntry, index) => charts.FillPatternType.forwardHatch,
|
||||
data: [
|
||||
NutritionData(AppLocalizations.of(context).energy, loggedNutritionalValues.energy),
|
||||
],
|
||||
),
|
||||
charts.Series<NutritionData, String>(
|
||||
id: 'Avg',
|
||||
domainFn: (nutritionEntry, index) => nutritionEntry.name,
|
||||
measureFn: (nutritionEntry, index) => nutritionEntry.value,
|
||||
data: [
|
||||
NutritionData(AppLocalizations.of(context).energy, sevenDayAvg.energy),
|
||||
],
|
||||
),
|
||||
],
|
||||
animate: true,
|
||||
domainAxis: const charts.OrdinalAxisSpec(
|
||||
///labelRotation was added to rotate text of X Axis. Without that,
|
||||
///titles would overlap each other
|
||||
renderSpec: charts.SmallTickRendererSpec(labelRotation: 60),
|
||||
),
|
||||
barGroupingType: charts.BarGroupingType.grouped,
|
||||
defaultRenderer: charts.BarRendererConfig(
|
||||
groupingType: charts.BarGroupingType.grouped, strokeWidthPx: 0.0, maxBarWidthPx: 8),
|
||||
primaryMeasureAxis: const charts.NumericAxisSpec(
|
||||
tickProviderSpec: charts.BasicNumericTickProviderSpec(desiredTickCount: 5),
|
||||
return AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: BarChart(
|
||||
mainBarData(),
|
||||
swapAnimationDuration: animDuration,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<DateTime> getDatesBetween(DateTime startDate, DateTime endDate) {
|
||||
final List<DateTime> dateList = [];
|
||||
DateTime currentDate = startDate;
|
||||
|
||||
while (currentDate.isBefore(endDate) || currentDate.isAtSameMomentAs(endDate)) {
|
||||
dateList.add(currentDate);
|
||||
currentDate = currentDate.add(const Duration(days: 1));
|
||||
}
|
||||
|
||||
return dateList;
|
||||
}
|
||||
|
||||
BarChartGroupData makeGroupData(
|
||||
int x,
|
||||
double y, {
|
||||
bool isTouched = false,
|
||||
Color? barColor,
|
||||
double width = 1.5,
|
||||
List<int> showTooltips = const [],
|
||||
}) {
|
||||
barColor ??= widget.barColor;
|
||||
return BarChartGroupData(
|
||||
x: x,
|
||||
barRods: [
|
||||
BarChartRodData(
|
||||
toY: isTouched ? y + 1 : y,
|
||||
color: isTouched ? widget.touchedBarColor : barColor,
|
||||
width: width,
|
||||
borderSide: isTouched
|
||||
? const BorderSide(color: Colors.black54)
|
||||
: const BorderSide(color: Colors.white, width: 0),
|
||||
backDrawRodData: BackgroundBarChartRodData(
|
||||
show: true,
|
||||
toY: 20,
|
||||
color: widget.barBackgroundColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
showingTooltipIndicators: showTooltips,
|
||||
);
|
||||
}
|
||||
|
||||
List<BarChartGroupData> showingGroups() {
|
||||
final logEntries = widget._nutritionalPlan.logEntriesValues;
|
||||
final List<BarChartGroupData> out = [];
|
||||
final dateList = getDatesBetween(logEntries.keys.first, logEntries.keys.last);
|
||||
|
||||
for (final date in dateList.reversed) {
|
||||
out.add(
|
||||
makeGroupData(
|
||||
date.millisecondsSinceEpoch,
|
||||
logEntries.containsKey(date) ? logEntries[date]!.energy : 0,
|
||||
isTouched: date.millisecondsSinceEpoch == touchedIndex,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
Widget leftTitles(double value, TitleMeta meta) {
|
||||
if (value == meta.max) {
|
||||
return Container();
|
||||
}
|
||||
const style = TextStyle(
|
||||
fontSize: 10,
|
||||
);
|
||||
return SideTitleWidget(
|
||||
axisSide: meta.axisSide,
|
||||
child: Text(
|
||||
'${meta.formattedValue} kcal',
|
||||
style: style,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
BarChartData mainBarData() {
|
||||
return BarChartData(
|
||||
barTouchData: BarTouchData(
|
||||
touchTooltipData: BarTouchTooltipData(
|
||||
tooltipBgColor: Colors.blueGrey,
|
||||
tooltipHorizontalAlignment: FLHorizontalAlignment.right,
|
||||
tooltipMargin: -10,
|
||||
getTooltipItem: (group, groupIndex, rod, rodIndex) {
|
||||
final date = DateTime.fromMillisecondsSinceEpoch(group.x);
|
||||
|
||||
return BarTooltipItem(
|
||||
'${DateFormat.yMMMd(Localizations.localeOf(context).languageCode).format(date)}\n',
|
||||
const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: '${(rod.toY - 1).toStringAsFixed(0)} kcal',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
touchCallback: (FlTouchEvent event, barTouchResponse) {
|
||||
setState(() {
|
||||
if (!event.isInterestedForInteractions ||
|
||||
barTouchResponse == null ||
|
||||
barTouchResponse.spot == null) {
|
||||
touchedIndex = -1;
|
||||
return;
|
||||
}
|
||||
touchedIndex = barTouchResponse.spot!.touchedBarGroupIndex;
|
||||
});
|
||||
},
|
||||
),
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
rightTitles: AxisTitles(
|
||||
sideTitles: SideTitles(showTitles: false),
|
||||
),
|
||||
topTitles: AxisTitles(
|
||||
sideTitles: SideTitles(showTitles: false),
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
sideTitles: SideTitles(showTitles: false),
|
||||
),
|
||||
leftTitles: AxisTitles(
|
||||
sideTitles: SideTitles(
|
||||
showTitles: true,
|
||||
reservedSize: 60,
|
||||
getTitlesWidget: leftTitles,
|
||||
),
|
||||
),
|
||||
),
|
||||
borderData: FlBorderData(
|
||||
show: false,
|
||||
),
|
||||
gridData: FlGridData(
|
||||
show: true,
|
||||
getDrawingHorizontalLine: (value) => FlLine(
|
||||
color: Colors.grey,
|
||||
strokeWidth: 1,
|
||||
),
|
||||
drawVerticalLine: false,
|
||||
),
|
||||
barGroups: showingGroups(),
|
||||
);
|
||||
}
|
||||
|
||||
Future<dynamic> refreshState() async {
|
||||
setState(() {});
|
||||
await Future<dynamic>.delayed(
|
||||
animDuration + const Duration(milliseconds: 50),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ class NutritionalDiaryDetailWidget extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
height: 220,
|
||||
child: NutritionalPlanPieChartWidget(valuesDate),
|
||||
child: FlNutritionalPlanPieChartWidget(valuesDate),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
|
||||
@@ -20,20 +20,20 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:wger/helpers/colors.dart';
|
||||
import 'package:wger/models/nutrition/nutritional_plan.dart';
|
||||
import 'package:wger/models/nutrition/nutritional_values.dart';
|
||||
import 'package:wger/providers/body_weight.dart';
|
||||
import 'package:wger/screens/form_screen.dart';
|
||||
import 'package:wger/screens/nutritional_diary_screen.dart';
|
||||
import 'package:wger/widgets/measurements/charts.dart';
|
||||
import 'package:wger/widgets/nutrition/charts.dart';
|
||||
import 'package:wger/widgets/nutrition/forms.dart';
|
||||
import 'package:wger/widgets/nutrition/meal.dart';
|
||||
|
||||
class NutritionalPlanDetailWidget extends StatelessWidget {
|
||||
final NutritionalPlan _nutritionalPlan;
|
||||
|
||||
const NutritionalPlanDetailWidget(this._nutritionalPlan);
|
||||
|
||||
static const double tablePadding = 7;
|
||||
|
||||
@override
|
||||
@@ -71,7 +71,7 @@ class NutritionalPlanDetailWidget extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
height: 220,
|
||||
child: NutritionalPlanPieChartWidget(nutritionalValues), // chart
|
||||
child: FlNutritionalPlanPieChartWidget(nutritionalValues), // chart
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
@@ -214,53 +214,82 @@ class NutritionalPlanDetailWidget extends StatelessWidget {
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
|
||||
NutritionalPlanHatchBarChartWidget(_nutritionalPlan),
|
||||
// Container(
|
||||
// padding: const EdgeInsets.all(15),
|
||||
// height: 300,
|
||||
// child: NutritionalPlanHatchBarChartWidget(_nutritionalPlan), // chart
|
||||
// ),
|
||||
const Padding(padding: EdgeInsets.all(8.0)),
|
||||
Text(
|
||||
AppLocalizations.of(context).nutritionalDiary,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
height: 220,
|
||||
child: NutritionalDiaryChartWidget(nutritionalPlan: _nutritionalPlan), // chart
|
||||
padding: const EdgeInsets.only(top: 15, left: 15, right: 15),
|
||||
height: 300,
|
||||
child: NutritionalDiaryChartWidgetFl(nutritionalPlan: _nutritionalPlan), // chart
|
||||
),
|
||||
SizedBox(
|
||||
height: 200,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 40, left: 25, right: 25),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
TextButton(onPressed: () {}, child: const Text('')),
|
||||
Text(
|
||||
'${AppLocalizations.of(context).energyShort} (${AppLocalizations.of(context).kcal})'),
|
||||
Text(
|
||||
'${AppLocalizations.of(context).proteinShort} (${AppLocalizations.of(context).g})'),
|
||||
Text(
|
||||
'${AppLocalizations.of(context).carbohydratesShort} (${AppLocalizations.of(context).g})'),
|
||||
Text(
|
||||
'${AppLocalizations.of(context).fatShort} (${AppLocalizations.of(context).g})'),
|
||||
],
|
||||
),
|
||||
Indicator(
|
||||
color: LIST_OF_COLORS3[0],
|
||||
text: AppLocalizations.of(context).planned,
|
||||
isSquare: true,
|
||||
marginRight: 0,
|
||||
),
|
||||
Indicator(
|
||||
color: LIST_OF_COLORS3[1],
|
||||
text: AppLocalizations.of(context).logged,
|
||||
isSquare: true,
|
||||
marginRight: 0,
|
||||
),
|
||||
Indicator(
|
||||
color: LIST_OF_COLORS3[2],
|
||||
text: AppLocalizations.of(context).weekAverage,
|
||||
isSquare: true,
|
||||
marginRight: 0,
|
||||
),
|
||||
..._nutritionalPlan.logEntriesValues.entries
|
||||
.map((entry) => NutritionDiaryEntry(entry.key, entry.value, _nutritionalPlan))
|
||||
.toList()
|
||||
.reversed,
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
if (_nutritionalPlan.logEntriesValues.isNotEmpty)
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context).nutritionalDiary,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
height: 220,
|
||||
child: FlNutritionalDiaryChartWidget(nutritionalPlan: _nutritionalPlan), // chart
|
||||
),
|
||||
SizedBox(
|
||||
height: 200,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
TextButton(onPressed: () {}, child: const Text('')),
|
||||
Text(
|
||||
'${AppLocalizations.of(context).energyShort} (${AppLocalizations.of(context).kcal})'),
|
||||
Text(
|
||||
'${AppLocalizations.of(context).proteinShort} (${AppLocalizations.of(context).g})'),
|
||||
Text(
|
||||
'${AppLocalizations.of(context).carbohydratesShort} (${AppLocalizations.of(context).g})'),
|
||||
Text(
|
||||
'${AppLocalizations.of(context).fatShort} (${AppLocalizations.of(context).g})'),
|
||||
],
|
||||
),
|
||||
),
|
||||
..._nutritionalPlan.logEntriesValues.entries
|
||||
.map((entry) =>
|
||||
NutritionDiaryEntry(entry.key, entry.value, _nutritionalPlan))
|
||||
.toList()
|
||||
.reversed,
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -24,7 +24,7 @@ import 'package:wger/providers/body_weight.dart';
|
||||
import 'package:wger/screens/form_screen.dart';
|
||||
import 'package:wger/screens/measurement_categories_screen.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
import 'package:wger/widgets/core/charts.dart';
|
||||
import 'package:wger/widgets/measurements/charts.dart';
|
||||
import 'package:wger/widgets/weight/forms.dart';
|
||||
|
||||
class WeightEntriesList extends StatelessWidget {
|
||||
@@ -38,7 +38,7 @@ class WeightEntriesList extends StatelessWidget {
|
||||
color: Theme.of(context).cardColor,
|
||||
padding: const EdgeInsets.all(15),
|
||||
height: 220,
|
||||
child: MeasurementChartWidget(
|
||||
child: MeasurementChartWidgetFl(
|
||||
_weightProvider.items.map((e) => MeasurementChartEntry(e.weight, e.date)).toList()),
|
||||
),
|
||||
TextButton(
|
||||
|
||||
@@ -26,7 +26,7 @@ enum _WorkoutAppBarOptions {
|
||||
contribute,
|
||||
}
|
||||
|
||||
class WorkoutOverviewAppBar extends StatelessWidget with PreferredSizeWidget {
|
||||
class WorkoutOverviewAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppBar(
|
||||
|
||||
@@ -16,66 +16,148 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:wger/helpers/charts.dart';
|
||||
import 'package:wger/helpers/colors.dart';
|
||||
|
||||
/// Sample time series data type.
|
||||
class TimeSeriesLog {
|
||||
final DateTime time;
|
||||
final double weight;
|
||||
|
||||
TimeSeriesLog(this.time, this.weight);
|
||||
}
|
||||
|
||||
class LogChartWidget extends StatelessWidget {
|
||||
class LogChartWidgetFl extends StatefulWidget {
|
||||
final Map _data;
|
||||
final DateTime _currentDate;
|
||||
const LogChartWidget(this._data, this._currentDate);
|
||||
|
||||
const LogChartWidgetFl(this._data, this._currentDate);
|
||||
|
||||
@override
|
||||
State<LogChartWidgetFl> createState() => _LogChartWidgetFlState();
|
||||
}
|
||||
|
||||
class _LogChartWidgetFlState extends State<LogChartWidgetFl> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return _data.containsKey('chart_data') && _data['chart_data'].length > 0
|
||||
? charts.TimeSeriesChart(
|
||||
[
|
||||
..._data['chart_data'].map((e) {
|
||||
return charts.Series<TimeSeriesLog, DateTime>(
|
||||
id: '${e.first['reps']} ${AppLocalizations.of(context).reps}',
|
||||
domainFn: (datum, index) => datum.time,
|
||||
measureFn: (datum, index) => datum.weight,
|
||||
data: [
|
||||
...e.map(
|
||||
(entry) => TimeSeriesLog(
|
||||
DateTime.parse(entry['date']),
|
||||
double.parse(entry['weight']),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
primaryMeasureAxis: const charts.NumericAxisSpec(
|
||||
tickProviderSpec: charts.BasicNumericTickProviderSpec(zeroBound: false),
|
||||
return AspectRatio(
|
||||
aspectRatio: 1.70,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 24,
|
||||
bottom: 12,
|
||||
),
|
||||
child: LineChart(
|
||||
mainData(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
LineTouchData tooltipData() {
|
||||
return LineTouchData(
|
||||
touchTooltipData: LineTouchTooltipData(
|
||||
getTooltipItems: (touchedSpots) {
|
||||
return touchedSpots.map((touchedSpot) {
|
||||
final reps = widget._data['chart_data'][touchedSpot.barIndex].first['reps'];
|
||||
|
||||
return LineTooltipItem(
|
||||
'$reps × ${touchedSpot.y} kg',
|
||||
const TextStyle(color: Colors.white),
|
||||
);
|
||||
}).toList();
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
LineChartData mainData() {
|
||||
final colors = generateChartColors(widget._data['chart_data'].length).iterator;
|
||||
|
||||
return LineChartData(
|
||||
lineTouchData: tooltipData(),
|
||||
gridData: FlGridData(
|
||||
show: true,
|
||||
drawVerticalLine: true,
|
||||
getDrawingHorizontalLine: (value) {
|
||||
return FlLine(
|
||||
color: Colors.grey,
|
||||
strokeWidth: 1,
|
||||
);
|
||||
},
|
||||
getDrawingVerticalLine: (value) {
|
||||
return FlLine(
|
||||
color: Colors.grey,
|
||||
strokeWidth: 1,
|
||||
);
|
||||
},
|
||||
),
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
rightTitles: AxisTitles(
|
||||
sideTitles: SideTitles(showTitles: false),
|
||||
),
|
||||
topTitles: AxisTitles(
|
||||
sideTitles: SideTitles(showTitles: false),
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
sideTitles: SideTitles(
|
||||
showTitles: true,
|
||||
getTitlesWidget: (value, meta) {
|
||||
// Don't show the first and last entries, otherwise they'll overlap with the
|
||||
// calculated interval
|
||||
if (value == meta.min || value == meta.max) {
|
||||
return const Text('');
|
||||
}
|
||||
|
||||
final DateTime date = DateTime.fromMillisecondsSinceEpoch(value.toInt());
|
||||
return Text(
|
||||
DateFormat.yMd(Localizations.localeOf(context).languageCode).format(date),
|
||||
);
|
||||
},
|
||||
interval: chartGetInterval(
|
||||
DateTime.parse(widget._data['logs'].keys.first),
|
||||
DateTime.parse(widget._data['logs'].keys.last),
|
||||
),
|
||||
behaviors: [
|
||||
charts.SeriesLegend(
|
||||
position: charts.BehaviorPosition.bottom,
|
||||
desiredMaxColumns: 4,
|
||||
),
|
||||
charts.RangeAnnotation([
|
||||
charts.LineAnnotationSegment(
|
||||
_currentDate, charts.RangeAnnotationAxisType.domain,
|
||||
strokeWidthPx: 2,
|
||||
labelPosition: charts.AnnotationLabelPosition.margin,
|
||||
color: charts.Color.black,
|
||||
dashPattern: [0, 1, 1, 1],
|
||||
//startLabel: DateFormat.yMd(Localizations.localeOf(context).languageCode)
|
||||
// .format(_currentDate),
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
leftTitles: AxisTitles(
|
||||
sideTitles: SideTitles(
|
||||
showTitles: true,
|
||||
reservedSize: 70,
|
||||
getTitlesWidget: (value, meta) {
|
||||
return Text('$value ${AppLocalizations.of(context).kg}');
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: Border.all(color: const Color(0xff37434d)),
|
||||
),
|
||||
lineBarsData: [
|
||||
...widget._data['chart_data'].map((e) {
|
||||
colors.moveNext();
|
||||
return LineChartBarData(
|
||||
spots: [
|
||||
...e.map(
|
||||
(entry) => FlSpot(
|
||||
DateTime.parse(entry['date']).millisecondsSinceEpoch.toDouble(),
|
||||
double.parse(entry['weight']),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
: Container();
|
||||
isCurved: true,
|
||||
color: colors.current,
|
||||
barWidth: 2,
|
||||
isStrokeCapRound: true,
|
||||
dotData: FlDotData(
|
||||
show: true,
|
||||
getDotPainter: (p0, p1, p2, p3) => FlDotCirclePainter(
|
||||
radius: 2,
|
||||
color: Colors.black,
|
||||
strokeWidth: 0,
|
||||
),
|
||||
),
|
||||
);
|
||||
})
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -19,11 +19,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:wger/helpers/colors.dart';
|
||||
import 'package:wger/helpers/ui.dart';
|
||||
import 'package:wger/models/exercises/base.dart';
|
||||
import 'package:wger/models/workouts/log.dart';
|
||||
import 'package:wger/models/workouts/session.dart';
|
||||
import 'package:wger/providers/workout_plans.dart';
|
||||
import 'package:wger/widgets/measurements/charts.dart';
|
||||
import 'package:wger/widgets/workouts/charts.dart';
|
||||
|
||||
class ExerciseLogChart extends StatelessWidget {
|
||||
@@ -36,20 +38,51 @@ class ExerciseLogChart extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final workoutPlansData = Provider.of<WorkoutPlansProvider>(context, listen: false);
|
||||
final workout = workoutPlansData.currentPlan;
|
||||
var colors = generateChartColors(1).iterator;
|
||||
|
||||
Future<Map<String, dynamic>> getChartEntries(BuildContext context) async {
|
||||
return workoutPlansData.fetchLogData(workout!, _base);
|
||||
}
|
||||
|
||||
return FutureBuilder(
|
||||
future: getChartEntries(context),
|
||||
builder: (context, AsyncSnapshot<Map<String, dynamic>> snapshot) => SizedBox(
|
||||
height: 150,
|
||||
child: snapshot.connectionState == ConnectionState.waiting
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: LogChartWidget(snapshot.data!, _currentDate),
|
||||
),
|
||||
);
|
||||
future: getChartEntries(context),
|
||||
builder: (context, AsyncSnapshot<Map<String, dynamic>> snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
colors = generateChartColors(snapshot.data!['chart_data'].length).iterator;
|
||||
}
|
||||
|
||||
return SizedBox(
|
||||
height: 260,
|
||||
child: snapshot.connectionState == ConnectionState.waiting
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
LogChartWidgetFl(snapshot.data!, _currentDate),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
...snapshot.data!['chart_data'].map((e) {
|
||||
// e is the list of logs with the same reps, so we can just take the
|
||||
// first entry and read the reps from it. Yes, this is an amazingly ugly hack
|
||||
final reps = e.first['reps'];
|
||||
|
||||
colors.moveNext();
|
||||
return Indicator(
|
||||
color: colors.current,
|
||||
text: reps.toString(),
|
||||
isSquare: false,
|
||||
);
|
||||
}).toList(),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,8 +141,10 @@ class _DayLogWidgetState extends State<DayLogWidget> {
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
ExerciseLogChart(base, widget._date),
|
||||
const SizedBox(height: 30),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||
child: ExerciseLogChart(base, widget._date),
|
||||
)
|
||||
],
|
||||
);
|
||||
}).toList()
|
||||
|
||||
@@ -10,6 +10,7 @@ import package_info_plus
|
||||
import rive_common
|
||||
import shared_preferences_foundation
|
||||
import url_launcher_macos
|
||||
import video_player_avfoundation
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
||||
@@ -17,4 +18,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin"))
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
|
||||
}
|
||||
+240
-328
File diff suppressed because it is too large.
Load diff
+8
-8
@@ -24,7 +24,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||
version: 1.5.6+34
|
||||
|
||||
environment:
|
||||
sdk: '>=2.17.0 <3.0.0'
|
||||
sdk: ">=2.17.0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
@@ -33,7 +33,6 @@ dependencies:
|
||||
sdk: flutter
|
||||
|
||||
android_metadata: ^0.2.1
|
||||
charts_flutter: ^0.12.0
|
||||
collection: ^1.17.0
|
||||
cupertino_icons: ^1.0.5
|
||||
equatable: ^2.0.5
|
||||
@@ -41,14 +40,14 @@ dependencies:
|
||||
flutter_html: ^3.0.0-beta.2
|
||||
flutter_typeahead: ^4.8.0
|
||||
font_awesome_flutter: ^10.4.0
|
||||
http: ^0.13.5
|
||||
image_picker: ^0.8.9
|
||||
intl: ^0.17.0
|
||||
http: ^1.1.0
|
||||
image_picker: ^1.0.4
|
||||
intl: ^0.18.1
|
||||
json_annotation: ^4.8.1
|
||||
version: ^3.0.2
|
||||
package_info_plus: ^4.2.0
|
||||
provider: ^6.0.5
|
||||
rive: ^0.11.4
|
||||
rive: ^0.12.2
|
||||
shared_preferences: ^2.2.2
|
||||
table_calendar: ^3.0.8
|
||||
url_launcher: ^6.1.11
|
||||
@@ -58,6 +57,7 @@ dependencies:
|
||||
carousel_slider: ^4.2.1
|
||||
multi_select_flutter: ^4.1.3
|
||||
flutter_svg: ^2.0.5
|
||||
fl_chart: ^0.64.0
|
||||
flutter_zxing: ^1.1.2
|
||||
flex_seed_scheme: ^1.4.0
|
||||
|
||||
@@ -71,8 +71,8 @@ dev_dependencies:
|
||||
json_serializable: ^6.6.2
|
||||
mockito: ^5.4.0
|
||||
network_image_mock: ^2.1.1
|
||||
flutter_lints: ^2.0.3
|
||||
cider: ^0.1.6
|
||||
flutter_lints: ^3.0.1
|
||||
cider: ^0.2.4
|
||||
|
||||
flutter_icons:
|
||||
android: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/exercises/contribute_exercise_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -32,7 +32,8 @@ 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,
|
||||
@@ -85,7 +86,8 @@ 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);
|
||||
}
|
||||
@@ -98,6 +100,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
set language(_i8.Language? _language) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -106,6 +109,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set category(_i9.ExerciseCategory? _category) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -114,11 +118,13 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i10.File> get exerciseImages => (super.noSuchMethod(
|
||||
Invocation.getter(#exerciseImages),
|
||||
returnValue: <_i10.File>[],
|
||||
) as List<_i10.File>);
|
||||
|
||||
@override
|
||||
set exerciseNameEn(String? name) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -127,6 +133,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set exerciseNameTrans(String? name) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -135,6 +142,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set descriptionEn(String? description) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -143,6 +151,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set descriptionTrans(String? description) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -151,6 +160,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set alternateNamesEn(List<String>? names) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -159,6 +169,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set alternateNamesTrans(List<String>? names) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -167,6 +178,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set equipment(List<_i11.Equipment>? equipment) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -175,16 +187,19 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i11.Equipment> get equipment => (super.noSuchMethod(
|
||||
Invocation.getter(#equipment),
|
||||
returnValue: <_i11.Equipment>[],
|
||||
) as List<_i11.Equipment>);
|
||||
|
||||
@override
|
||||
bool get newVariation => (super.noSuchMethod(
|
||||
Invocation.getter(#newVariation),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
set newVariationForExercise(int? value) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -193,6 +208,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set variationId(int? variation) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -201,6 +217,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.ExerciseBase get base => (super.noSuchMethod(
|
||||
Invocation.getter(#base),
|
||||
@@ -209,6 +226,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
Invocation.getter(#base),
|
||||
),
|
||||
) as _i3.ExerciseBase);
|
||||
|
||||
@override
|
||||
_i4.Translation get exerciseEn => (super.noSuchMethod(
|
||||
Invocation.getter(#exerciseEn),
|
||||
@@ -217,6 +235,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
Invocation.getter(#exerciseEn),
|
||||
),
|
||||
) as _i4.Translation);
|
||||
|
||||
@override
|
||||
_i4.Translation get exerciseTranslation => (super.noSuchMethod(
|
||||
Invocation.getter(#exerciseTranslation),
|
||||
@@ -225,6 +244,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
Invocation.getter(#exerciseTranslation),
|
||||
),
|
||||
) as _i4.Translation);
|
||||
|
||||
@override
|
||||
_i5.Variation get variation => (super.noSuchMethod(
|
||||
Invocation.getter(#variation),
|
||||
@@ -233,11 +253,13 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
Invocation.getter(#variation),
|
||||
),
|
||||
) as _i5.Variation);
|
||||
|
||||
@override
|
||||
List<_i12.Muscle> get primaryMuscles => (super.noSuchMethod(
|
||||
Invocation.getter(#primaryMuscles),
|
||||
returnValue: <_i12.Muscle>[],
|
||||
) as List<_i12.Muscle>);
|
||||
|
||||
@override
|
||||
set primaryMuscles(List<_i12.Muscle>? muscles) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -246,11 +268,13 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i12.Muscle> get secondaryMuscles => (super.noSuchMethod(
|
||||
Invocation.getter(#secondaryMuscles),
|
||||
returnValue: <_i12.Muscle>[],
|
||||
) as List<_i12.Muscle>);
|
||||
|
||||
@override
|
||||
set secondaryMuscles(List<_i12.Muscle>? muscles) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -259,11 +283,13 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -272,6 +298,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void addExerciseImages(List<_i10.File>? exercises) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -280,6 +307,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeExercise(String? path) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -288,6 +316,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void printValues() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -296,6 +325,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i13.Future<int> addExercise() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -304,6 +334,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValue: _i13.Future<int>.value(0),
|
||||
) as _i13.Future<int>);
|
||||
|
||||
@override
|
||||
_i13.Future<_i3.ExerciseBase> addExerciseBase() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -318,6 +349,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
)),
|
||||
) as _i13.Future<_i3.ExerciseBase>);
|
||||
|
||||
@override
|
||||
_i13.Future<_i5.Variation> addVariation() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -332,6 +364,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
)),
|
||||
) as _i13.Future<_i5.Variation>);
|
||||
|
||||
@override
|
||||
_i13.Future<void> addImages(_i3.ExerciseBase? base) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -341,8 +374,10 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
returnValue: _i13.Future<void>.value(),
|
||||
returnValueForMissingStub: _i13.Future<void>.value(),
|
||||
) 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,
|
||||
@@ -356,6 +391,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
)),
|
||||
) as _i13.Future<_i4.Translation>);
|
||||
|
||||
@override
|
||||
_i13.Future<_i6.Alias> addExerciseAlias(
|
||||
String? name,
|
||||
@@ -380,6 +416,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
)),
|
||||
) as _i13.Future<_i6.Alias>);
|
||||
|
||||
@override
|
||||
void addListener(_i14.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -388,6 +425,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -396,6 +434,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -404,6 +443,7 @@ class MockAddExerciseProvider extends _i1.Mock implements _i7.AddExerciseProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -430,6 +470,7 @@ class MockUserProvider extends _i1.Mock implements _i15.UserProvider {
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
set profile(_i16.Profile? _profile) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -438,11 +479,13 @@ class MockUserProvider extends _i1.Mock implements _i15.UserProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -451,6 +494,7 @@ class MockUserProvider extends _i1.Mock implements _i15.UserProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i13.Future<void> fetchAndSetProfile() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -460,6 +504,7 @@ class MockUserProvider extends _i1.Mock implements _i15.UserProvider {
|
||||
returnValue: _i13.Future<void>.value(),
|
||||
returnValueForMissingStub: _i13.Future<void>.value(),
|
||||
) as _i13.Future<void>);
|
||||
|
||||
@override
|
||||
_i13.Future<void> saveProfile() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -469,6 +514,7 @@ class MockUserProvider extends _i1.Mock implements _i15.UserProvider {
|
||||
returnValue: _i13.Future<void>.value(),
|
||||
returnValueForMissingStub: _i13.Future<void>.value(),
|
||||
) as _i13.Future<void>);
|
||||
|
||||
@override
|
||||
_i13.Future<void> verifyEmail() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -478,6 +524,7 @@ class MockUserProvider extends _i1.Mock implements _i15.UserProvider {
|
||||
returnValue: _i13.Future<void>.value(),
|
||||
returnValueForMissingStub: _i13.Future<void>.value(),
|
||||
) as _i13.Future<void>);
|
||||
|
||||
@override
|
||||
void addListener(_i14.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -486,6 +533,7 @@ class MockUserProvider extends _i1.Mock implements _i15.UserProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -494,6 +542,7 @@ class MockUserProvider extends _i1.Mock implements _i15.UserProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -502,6 +551,7 @@ class MockUserProvider extends _i1.Mock implements _i15.UserProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/gallery/gallery_form_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -77,6 +77,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
Invocation.getter(#images),
|
||||
returnValue: <_i5.Image>[],
|
||||
) as List<_i5.Image>);
|
||||
|
||||
@override
|
||||
set images(List<_i5.Image>? _images) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -85,6 +86,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i2.AuthProvider get auth => (super.noSuchMethod(
|
||||
Invocation.getter(#auth),
|
||||
@@ -93,6 +95,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
set auth(_i2.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -101,6 +104,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -109,6 +113,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -117,11 +122,13 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -130,6 +137,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i6.Future<void> fetchAndSetGallery() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -139,6 +147,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
|
||||
@override
|
||||
_i6.Future<void> addImage(
|
||||
_i5.Image? image,
|
||||
@@ -155,6 +164,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
|
||||
@override
|
||||
_i6.Future<void> editImage(
|
||||
_i5.Image? image,
|
||||
@@ -171,6 +181,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
|
||||
@override
|
||||
_i6.Future<void> deleteImage(_i5.Image? image) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -180,8 +191,10 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -189,6 +202,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
@@ -219,14 +233,17 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
|
||||
@override
|
||||
_i6.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#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
|
||||
_i6.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -235,6 +252,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValue: _i6.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i6.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i6.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -248,8 +266,10 @@ 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
|
||||
_i6.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -263,8 +283,10 @@ 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
|
||||
_i6.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
@@ -289,6 +311,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i3.Response>);
|
||||
|
||||
@override
|
||||
void addListener(_i8.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -297,6 +320,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i8.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -305,6 +329,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -313,6 +338,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/gallery/gallery_screen_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -77,6 +77,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
Invocation.getter(#images),
|
||||
returnValue: <_i5.Image>[],
|
||||
) as List<_i5.Image>);
|
||||
|
||||
@override
|
||||
set images(List<_i5.Image>? _images) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -85,6 +86,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i2.AuthProvider get auth => (super.noSuchMethod(
|
||||
Invocation.getter(#auth),
|
||||
@@ -93,6 +95,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
set auth(_i2.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -101,6 +104,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -109,6 +113,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -117,11 +122,13 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -130,6 +137,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i6.Future<void> fetchAndSetGallery() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -139,6 +147,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
|
||||
@override
|
||||
_i6.Future<void> addImage(
|
||||
_i5.Image? image,
|
||||
@@ -155,6 +164,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
|
||||
@override
|
||||
_i6.Future<void> editImage(
|
||||
_i5.Image? image,
|
||||
@@ -171,6 +181,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
|
||||
@override
|
||||
_i6.Future<void> deleteImage(_i5.Image? image) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -180,8 +191,10 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -189,6 +202,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
@@ -219,14 +233,17 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
|
||||
@override
|
||||
_i6.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#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
|
||||
_i6.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -235,6 +252,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValue: _i6.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i6.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i6.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -248,8 +266,10 @@ 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
|
||||
_i6.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -263,8 +283,10 @@ 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
|
||||
_i6.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
@@ -289,6 +311,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i3.Response>);
|
||||
|
||||
@override
|
||||
void addListener(_i8.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -297,6 +320,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i8.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -305,6 +329,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -313,6 +338,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -26,7 +26,7 @@ import 'package:wger/models/measurements/measurement_category.dart';
|
||||
import 'package:wger/models/measurements/measurement_entry.dart';
|
||||
import 'package:wger/providers/measurement.dart';
|
||||
import 'package:wger/screens/measurement_categories_screen.dart';
|
||||
import 'package:wger/widgets/core/charts.dart';
|
||||
import 'package:wger/widgets/measurements/charts.dart';
|
||||
|
||||
import 'measurement_categories_screen_test.mocks.dart';
|
||||
|
||||
@@ -68,6 +68,6 @@ void main() {
|
||||
expect(find.text('body fat'), findsOneWidget);
|
||||
expect(find.text('biceps'), findsOneWidget);
|
||||
expect(find.byType(Card), findsNWidgets(2));
|
||||
expect(find.byType(MeasurementChartWidget), findsNWidgets(2));
|
||||
expect(find.byType(MeasurementChartWidgetFl), findsNWidgets(2));
|
||||
});
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/measurements/measurement_categories_screen_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -23,7 +23,8 @@ 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,
|
||||
@@ -33,7 +34,8 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvi
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMeasurementCategory_1 extends _i1.SmartFake implements _i3.MeasurementCategory {
|
||||
class _FakeMeasurementCategory_1 extends _i1.SmartFake
|
||||
implements _i3.MeasurementCategory {
|
||||
_FakeMeasurementCategory_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -46,7 +48,8 @@ class _FakeMeasurementCategory_1 extends _i1.SmartFake implements _i3.Measuremen
|
||||
/// 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);
|
||||
}
|
||||
@@ -59,16 +62,19 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i3.MeasurementCategory> get categories => (super.noSuchMethod(
|
||||
Invocation.getter(#categories),
|
||||
returnValue: <_i3.MeasurementCategory>[],
|
||||
) as List<_i3.MeasurementCategory>);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -77,6 +83,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.MeasurementCategory findCategoryById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -91,6 +98,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
),
|
||||
),
|
||||
) as _i3.MeasurementCategory);
|
||||
|
||||
@override
|
||||
_i5.Future<void> fetchAndSetCategories() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -100,6 +108,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> fetchAndSetCategoryEntries(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -109,6 +118,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> fetchAndSetAllCategoriesAndEntries() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -118,8 +128,10 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) 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],
|
||||
@@ -127,6 +139,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> deleteCategory(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -136,6 +149,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> editCategory(
|
||||
int? id,
|
||||
@@ -154,6 +168,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> addEntry(_i6.MeasurementEntry? entry) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -163,6 +178,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> deleteEntry(
|
||||
int? id,
|
||||
@@ -179,6 +195,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> editEntry(
|
||||
int? id,
|
||||
@@ -201,6 +218,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
void addListener(_i7.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -209,6 +227,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -217,6 +236,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -225,6 +245,7 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -73,8 +73,8 @@ void main() {
|
||||
expect(find.text('body fat'), findsOneWidget);
|
||||
|
||||
// Entries
|
||||
expect(find.text('10.2 %'), findsOneWidget);
|
||||
expect(find.text('18.1 %'), findsOneWidget);
|
||||
expect(find.text('10.2 %'), findsNWidgets(2));
|
||||
expect(find.text('18.1 %'), findsNWidgets(2));
|
||||
});
|
||||
|
||||
testWidgets('Tests the localization of dates - EN', (WidgetTester tester) async {
|
||||
@@ -82,8 +82,9 @@ void main() {
|
||||
await tester.tap(find.byType(TextButton));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('8/1/2021'), findsOneWidget);
|
||||
expect(find.text('8/10/2021'), findsOneWidget);
|
||||
// From the entries list and from the chart
|
||||
expect(find.text('8/1/2021'), findsWidgets);
|
||||
expect(find.text('8/10/2021'), findsWidgets);
|
||||
});
|
||||
|
||||
testWidgets('Tests the localization of dates - DE', (WidgetTester tester) async {
|
||||
@@ -91,7 +92,7 @@ void main() {
|
||||
await tester.tap(find.byType(TextButton));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('1.8.2021'), findsOneWidget);
|
||||
expect(find.text('10.8.2021'), findsOneWidget);
|
||||
expect(find.text('1.8.2021'), findsWidgets);
|
||||
expect(find.text('10.8.2021'), findsWidgets);
|
||||
});
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/measurements/measurement_provider_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -77,6 +77,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
set auth(_i2.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -85,6 +86,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -93,6 +95,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -101,8 +104,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -110,6 +115,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
@@ -140,14 +146,17 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -156,6 +165,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -169,8 +179,10 @@ 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
|
||||
_i5.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -184,8 +196,10 @@ 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
|
||||
_i5.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
|
||||
@@ -41,7 +41,7 @@ void main() {
|
||||
testWidgets('Test the detail view for the nutritional plan', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(getWidget());
|
||||
|
||||
expect(find.byType(NutritionalPlanPieChartWidget), findsOneWidget);
|
||||
expect(find.byType(FlNutritionalPlanPieChartWidget), findsOneWidget);
|
||||
expect(find.byType(Table), findsOneWidget);
|
||||
|
||||
expect(find.text('519kcal'), findsOneWidget, reason: 'find total energy');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/nutrition/nutritional_meal_form_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -25,7 +25,8 @@ import 'package:wger/providers/nutrition.dart' as _i7;
|
||||
// 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,
|
||||
@@ -35,7 +36,8 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvi
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeNutritionalPlan_1 extends _i1.SmartFake implements _i3.NutritionalPlan {
|
||||
class _FakeNutritionalPlan_1 extends _i1.SmartFake
|
||||
implements _i3.NutritionalPlan {
|
||||
_FakeNutritionalPlan_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -78,7 +80,8 @@ class _FakeIngredient_4 extends _i1.SmartFake implements _i6.Ingredient {
|
||||
/// A class which mocks [NutritionPlansProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansProvider {
|
||||
class MockNutritionPlansProvider extends _i1.Mock
|
||||
implements _i7.NutritionPlansProvider {
|
||||
MockNutritionPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -91,11 +94,13 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i3.NutritionalPlan> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i3.NutritionalPlan>[],
|
||||
) as List<_i3.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
set ingredients(dynamic items) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -104,11 +109,13 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -117,6 +124,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.NutritionalPlan findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -131,11 +139,13 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
),
|
||||
) as _i3.NutritionalPlan);
|
||||
|
||||
@override
|
||||
_i4.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(
|
||||
#findMealById,
|
||||
[id],
|
||||
)) as _i4.Meal?);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -145,6 +155,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -154,13 +165,16 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
returnValue:
|
||||
_i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
@@ -168,13 +182,16 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
[planId],
|
||||
),
|
||||
returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
returnValue:
|
||||
_i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
@@ -182,13 +199,16 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i3.NutritionalPlan> addPlan(_i3.NutritionalPlan? planData) => (super.noSuchMethod(
|
||||
_i8.Future<_i3.NutritionalPlan> addPlan(_i3.NutritionalPlan? planData) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
[planData],
|
||||
),
|
||||
returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
returnValue:
|
||||
_i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
@@ -196,6 +216,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> editPlan(_i3.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -205,6 +226,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deletePlan(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -214,6 +236,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i4.Meal> addMeal(
|
||||
_i4.Meal? meal,
|
||||
@@ -238,6 +261,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i4.Meal>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i4.Meal> editMeal(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -252,6 +276,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i4.Meal>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deleteMeal(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -261,6 +286,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i5.MealItem> addMealItem(
|
||||
_i5.MealItem? mealItem,
|
||||
@@ -285,8 +311,10 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i5.MealItem>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deleteMealItem(_i5.MealItem? mealItem) => (super.noSuchMethod(
|
||||
_i8.Future<void> deleteMealItem(_i5.MealItem? mealItem) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteMealItem,
|
||||
[mealItem],
|
||||
@@ -294,8 +322,10 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i6.Ingredient> fetchIngredient(int? ingredientId) => (super.noSuchMethod(
|
||||
_i8.Future<_i6.Ingredient> fetchIngredient(int? ingredientId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchIngredient,
|
||||
[ingredientId],
|
||||
@@ -308,6 +338,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i6.Ingredient>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchIngredientsFromCache() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -317,6 +348,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<List<dynamic>> searchIngredient(
|
||||
String? name, {
|
||||
@@ -334,14 +366,17 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
returnValue: _i8.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i8.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i6.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod(
|
||||
_i8.Future<_i6.Ingredient?> searchIngredientWithCode(String? code) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchIngredientWithCode,
|
||||
[code],
|
||||
),
|
||||
returnValue: _i8.Future<_i6.Ingredient?>.value(),
|
||||
) as _i8.Future<_i6.Ingredient?>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> logMealToDiary(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -351,6 +386,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> logIngredientToDiary(
|
||||
_i5.MealItem? mealItem,
|
||||
@@ -369,6 +405,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deleteLog(
|
||||
int? logId,
|
||||
@@ -385,8 +422,10 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchAndSetLogs(_i3.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
_i8.Future<void> fetchAndSetLogs(_i3.NutritionalPlan? plan) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLogs,
|
||||
[plan],
|
||||
@@ -394,6 +433,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
void addListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -402,6 +442,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -410,6 +451,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -418,6 +460,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/nutrition/nutritional_plan_form_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -25,7 +25,8 @@ import 'package:wger/providers/nutrition.dart' as _i7;
|
||||
// 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,
|
||||
@@ -35,7 +36,8 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvi
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeNutritionalPlan_1 extends _i1.SmartFake implements _i3.NutritionalPlan {
|
||||
class _FakeNutritionalPlan_1 extends _i1.SmartFake
|
||||
implements _i3.NutritionalPlan {
|
||||
_FakeNutritionalPlan_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -78,7 +80,8 @@ class _FakeIngredient_4 extends _i1.SmartFake implements _i6.Ingredient {
|
||||
/// A class which mocks [NutritionPlansProvider].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansProvider {
|
||||
class MockNutritionPlansProvider extends _i1.Mock
|
||||
implements _i7.NutritionPlansProvider {
|
||||
MockNutritionPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -91,11 +94,13 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i3.NutritionalPlan> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i3.NutritionalPlan>[],
|
||||
) as List<_i3.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
set ingredients(dynamic items) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -104,11 +109,13 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -117,6 +124,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.NutritionalPlan findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -131,11 +139,13 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
),
|
||||
) as _i3.NutritionalPlan);
|
||||
|
||||
@override
|
||||
_i4.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(
|
||||
#findMealById,
|
||||
[id],
|
||||
)) as _i4.Meal?);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -145,6 +155,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -154,13 +165,16 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
),
|
||||
returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
returnValue:
|
||||
_i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
@@ -168,13 +182,16 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(
|
||||
_i8.Future<_i3.NutritionalPlan> fetchAndSetPlanFull(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
[planId],
|
||||
),
|
||||
returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
returnValue:
|
||||
_i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanFull,
|
||||
@@ -182,13 +199,16 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i3.NutritionalPlan> addPlan(_i3.NutritionalPlan? planData) => (super.noSuchMethod(
|
||||
_i8.Future<_i3.NutritionalPlan> addPlan(_i3.NutritionalPlan? planData) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
[planData],
|
||||
),
|
||||
returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
returnValue:
|
||||
_i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addPlan,
|
||||
@@ -196,6 +216,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i3.NutritionalPlan>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> editPlan(_i3.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -205,6 +226,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deletePlan(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -214,6 +236,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i4.Meal> addMeal(
|
||||
_i4.Meal? meal,
|
||||
@@ -238,6 +261,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i4.Meal>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i4.Meal> editMeal(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -252,6 +276,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i4.Meal>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deleteMeal(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -261,6 +286,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i5.MealItem> addMealItem(
|
||||
_i5.MealItem? mealItem,
|
||||
@@ -285,8 +311,10 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i5.MealItem>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deleteMealItem(_i5.MealItem? mealItem) => (super.noSuchMethod(
|
||||
_i8.Future<void> deleteMealItem(_i5.MealItem? mealItem) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteMealItem,
|
||||
[mealItem],
|
||||
@@ -294,8 +322,10 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i6.Ingredient> fetchIngredient(int? ingredientId) => (super.noSuchMethod(
|
||||
_i8.Future<_i6.Ingredient> fetchIngredient(int? ingredientId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchIngredient,
|
||||
[ingredientId],
|
||||
@@ -308,6 +338,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i6.Ingredient>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchIngredientsFromCache() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -317,6 +348,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<List<dynamic>> searchIngredient(
|
||||
String? name, {
|
||||
@@ -334,14 +366,17 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
returnValue: _i8.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i8.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i8.Future<_i6.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod(
|
||||
_i8.Future<_i6.Ingredient?> searchIngredientWithCode(String? code) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchIngredientWithCode,
|
||||
[code],
|
||||
),
|
||||
returnValue: _i8.Future<_i6.Ingredient?>.value(),
|
||||
) as _i8.Future<_i6.Ingredient?>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> logMealToDiary(_i4.Meal? meal) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -351,6 +386,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> logIngredientToDiary(
|
||||
_i5.MealItem? mealItem,
|
||||
@@ -369,6 +405,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> deleteLog(
|
||||
int? logId,
|
||||
@@ -385,8 +422,10 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
_i8.Future<void> fetchAndSetLogs(_i3.NutritionalPlan? plan) => (super.noSuchMethod(
|
||||
_i8.Future<void> fetchAndSetLogs(_i3.NutritionalPlan? plan) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetLogs,
|
||||
[plan],
|
||||
@@ -394,6 +433,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
returnValue: _i8.Future<void>.value(),
|
||||
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||
) as _i8.Future<void>);
|
||||
|
||||
@override
|
||||
void addListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -402,6 +442,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -410,6 +451,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -418,6 +460,7 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansP
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -81,7 +81,7 @@ void main() {
|
||||
expect(find.text('300g Broccoli cake'), findsOneWidget);
|
||||
|
||||
expect(find.byType(Dismissible), findsNWidgets(2));
|
||||
expect(find.byType(NutritionalDiaryChartWidget), findsNothing);
|
||||
expect(find.byType(FlNutritionalDiaryChartWidget), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('Tests the localization of times - EN', (WidgetTester tester) async {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/nutrition/nutritional_plan_screen_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -65,7 +65,8 @@ 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,
|
||||
@@ -91,6 +92,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
set auth(_i2.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -99,6 +101,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -107,6 +110,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -115,8 +119,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -124,6 +130,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
@@ -154,14 +161,17 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -170,6 +180,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -183,8 +194,10 @@ 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
|
||||
_i5.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -198,8 +211,10 @@ 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
|
||||
_i5.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
@@ -242,6 +257,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set serverUrl(String? _serverUrl) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -250,6 +266,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set serverVersion(String? _serverVersion) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -258,19 +275,23 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set applicationVersion(_i6.PackageInfo? _applicationVersion) => super.noSuchMethod(
|
||||
set applicationVersion(_i6.PackageInfo? _applicationVersion) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#applicationVersion,
|
||||
_applicationVersion,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> get metadata => (super.noSuchMethod(
|
||||
Invocation.getter(#metadata),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
set metadata(Map<String, String>? _metadata) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -279,6 +300,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -287,6 +309,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -295,11 +318,13 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get dataInit => (super.noSuchMethod(
|
||||
Invocation.getter(#dataInit),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
set dataInit(bool? _dataInit) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -308,16 +333,19 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get isAuth => (super.noSuchMethod(
|
||||
Invocation.getter(#isAuth),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
_i5.Future<void> setServerVersion() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -327,6 +355,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> initData(String? serverUrl) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -336,6 +365,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> setApplicationVersion() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -345,6 +375,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<bool> applicationUpdateRequired([
|
||||
String? version,
|
||||
@@ -360,6 +391,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, _i2.LoginActions>> register({
|
||||
required String? username,
|
||||
@@ -378,8 +410,10 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
#serverUrl: 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
|
||||
_i5.Future<Map<String, _i2.LoginActions>> login(
|
||||
String? username,
|
||||
@@ -395,8 +429,10 @@ 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
|
||||
_i5.Future<String> getServerUrlFromPrefs() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -405,6 +441,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValue: _i5.Future<String>.value(''),
|
||||
) as _i5.Future<String>);
|
||||
|
||||
@override
|
||||
_i5.Future<bool> tryAutoLogin() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -413,6 +450,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> logout({bool? shouldNotify = true}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -423,6 +461,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
String getAppNameHeader() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -431,6 +470,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValue: '',
|
||||
) as String);
|
||||
|
||||
@override
|
||||
void addListener(_i7.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -439,6 +479,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -447,6 +488,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -455,6 +497,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -493,6 +536,7 @@ class MockClient extends _i1.Mock implements _i3.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.Response> get(
|
||||
Uri? url, {
|
||||
@@ -513,6 +557,7 @@ class MockClient extends _i1.Mock implements _i3.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.Response> post(
|
||||
Uri? url, {
|
||||
@@ -543,6 +588,7 @@ class MockClient extends _i1.Mock implements _i3.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.Response> put(
|
||||
Uri? url, {
|
||||
@@ -573,6 +619,7 @@ class MockClient extends _i1.Mock implements _i3.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.Response> patch(
|
||||
Uri? url, {
|
||||
@@ -603,6 +650,7 @@ class MockClient extends _i1.Mock implements _i3.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.Response> delete(
|
||||
Uri? url, {
|
||||
@@ -633,6 +681,7 @@ class MockClient extends _i1.Mock implements _i3.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<String> read(
|
||||
Uri? url, {
|
||||
@@ -646,6 +695,7 @@ class MockClient extends _i1.Mock implements _i3.Client {
|
||||
),
|
||||
returnValue: _i5.Future<String>.value(''),
|
||||
) as _i5.Future<String>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i9.Uint8List> readBytes(
|
||||
Uri? url, {
|
||||
@@ -659,13 +709,16 @@ class MockClient extends _i1.Mock implements _i3.Client {
|
||||
),
|
||||
returnValue: _i5.Future<_i9.Uint8List>.value(_i9.Uint8List(0)),
|
||||
) as _i5.Future<_i9.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,
|
||||
@@ -673,6 +726,7 @@ class MockClient extends _i1.Mock implements _i3.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.StreamedResponse>);
|
||||
|
||||
@override
|
||||
void close() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/nutrition/nutritional_plans_screen_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -65,7 +65,8 @@ 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,
|
||||
@@ -91,6 +92,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set serverUrl(String? _serverUrl) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -99,6 +101,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set serverVersion(String? _serverVersion) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -107,19 +110,23 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
set applicationVersion(_i4.PackageInfo? _applicationVersion) => super.noSuchMethod(
|
||||
set applicationVersion(_i4.PackageInfo? _applicationVersion) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#applicationVersion,
|
||||
_applicationVersion,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> get metadata => (super.noSuchMethod(
|
||||
Invocation.getter(#metadata),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
set metadata(Map<String, String>? _metadata) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -128,6 +135,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i2.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -136,6 +144,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i2.Client);
|
||||
|
||||
@override
|
||||
set client(_i2.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -144,11 +153,13 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get dataInit => (super.noSuchMethod(
|
||||
Invocation.getter(#dataInit),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
set dataInit(bool? _dataInit) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -157,16 +168,19 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get isAuth => (super.noSuchMethod(
|
||||
Invocation.getter(#isAuth),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
_i5.Future<void> setServerVersion() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -176,6 +190,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> initData(String? serverUrl) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -185,6 +200,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> setApplicationVersion() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -194,6 +210,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<bool> applicationUpdateRequired([
|
||||
String? version,
|
||||
@@ -209,6 +226,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, _i3.LoginActions>> register({
|
||||
required String? username,
|
||||
@@ -227,8 +245,10 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
#serverUrl: 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
|
||||
_i5.Future<Map<String, _i3.LoginActions>> login(
|
||||
String? username,
|
||||
@@ -244,8 +264,10 @@ 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
|
||||
_i5.Future<String> getServerUrlFromPrefs() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -254,6 +276,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValue: _i5.Future<String>.value(''),
|
||||
) as _i5.Future<String>);
|
||||
|
||||
@override
|
||||
_i5.Future<bool> tryAutoLogin() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -262,6 +285,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> logout({bool? shouldNotify = true}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -272,6 +296,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
String getAppNameHeader() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -280,6 +305,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValue: '',
|
||||
) as String);
|
||||
|
||||
@override
|
||||
void addListener(_i6.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -288,6 +314,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i6.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -296,6 +323,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -304,6 +332,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -330,6 +359,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.WgerBaseProvider {
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i3.AuthProvider);
|
||||
|
||||
@override
|
||||
set auth(_i3.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -338,6 +368,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i2.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -346,6 +377,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.WgerBaseProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i2.Client);
|
||||
|
||||
@override
|
||||
set client(_i2.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -354,8 +386,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -363,6 +397,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.WgerBaseProvider {
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
@@ -393,14 +428,17 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.WgerBaseProvider {
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -409,6 +447,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.WgerBaseProvider {
|
||||
),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -422,8 +461,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.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
|
||||
_i5.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -437,8 +478,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.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
|
||||
_i5.Future<_i2.Response> deleteRequest(
|
||||
String? url,
|
||||
@@ -493,6 +536,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> get(
|
||||
Uri? url, {
|
||||
@@ -513,6 +557,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> post(
|
||||
Uri? url, {
|
||||
@@ -543,6 +588,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> put(
|
||||
Uri? url, {
|
||||
@@ -573,6 +619,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> patch(
|
||||
Uri? url, {
|
||||
@@ -603,6 +650,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.Response> delete(
|
||||
Uri? url, {
|
||||
@@ -633,6 +681,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i5.Future<String> read(
|
||||
Uri? url, {
|
||||
@@ -646,6 +695,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
returnValue: _i5.Future<String>.value(''),
|
||||
) as _i5.Future<String>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i9.Uint8List> readBytes(
|
||||
Uri? url, {
|
||||
@@ -659,13 +709,16 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
returnValue: _i5.Future<_i9.Uint8List>.value(_i9.Uint8List(0)),
|
||||
) as _i5.Future<_i9.Uint8List>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod(
|
||||
_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,
|
||||
@@ -673,6 +726,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.StreamedResponse>);
|
||||
|
||||
@override
|
||||
void close() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/other/base_provider_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -31,7 +31,8 @@ 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,
|
||||
@@ -69,6 +70,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i3.Future<_i2.Response> get(
|
||||
Uri? url, {
|
||||
@@ -89,6 +91,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i3.Future<_i2.Response> post(
|
||||
Uri? url, {
|
||||
@@ -119,6 +122,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i3.Future<_i2.Response> put(
|
||||
Uri? url, {
|
||||
@@ -149,6 +153,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i3.Future<_i2.Response> patch(
|
||||
Uri? url, {
|
||||
@@ -179,6 +184,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i3.Future<_i2.Response> delete(
|
||||
Uri? url, {
|
||||
@@ -209,6 +215,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.Response>);
|
||||
|
||||
@override
|
||||
_i3.Future<String> read(
|
||||
Uri? url, {
|
||||
@@ -222,6 +229,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
returnValue: _i3.Future<String>.value(''),
|
||||
) as _i3.Future<String>);
|
||||
|
||||
@override
|
||||
_i3.Future<_i5.Uint8List> readBytes(
|
||||
Uri? url, {
|
||||
@@ -235,13 +243,16 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
returnValue: _i3.Future<_i5.Uint8List>.value(_i5.Uint8List(0)),
|
||||
) as _i3.Future<_i5.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,
|
||||
@@ -249,6 +260,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.StreamedResponse>);
|
||||
|
||||
@override
|
||||
void close() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/user/provider_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -77,6 +77,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
set auth(_i2.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -85,6 +86,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -93,6 +95,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -101,8 +104,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -110,6 +115,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
@@ -140,14 +146,17 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -156,6 +165,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -169,8 +179,10 @@ 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
|
||||
_i5.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -184,8 +196,10 @@ 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
|
||||
_i5.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:wger/helpers/colors.dart';
|
||||
|
||||
void main() {
|
||||
group('test the color utility', () {
|
||||
test('3 items or less', () {
|
||||
final result = generateChartColors(2).iterator;
|
||||
expect(result.current, equals(const Color(0xFF2A4C7D)));
|
||||
result.moveNext();
|
||||
expect(result.current, equals(const Color(0xFFD45089)));
|
||||
});
|
||||
|
||||
test('5 items or less', () {
|
||||
final result = generateChartColors(5).iterator;
|
||||
expect(result.current, equals(const Color(0xFF2A4C7D)));
|
||||
result.moveNext();
|
||||
expect(result.current, equals(const Color(0xFF825298)));
|
||||
result.moveNext();
|
||||
expect(result.current, equals(const Color(0xFFD45089)));
|
||||
result.moveNext();
|
||||
expect(result.current, equals(const Color(0xFFFF6A59)));
|
||||
result.moveNext();
|
||||
expect(result.current, equals(const Color(0xFFFFA600)));
|
||||
});
|
||||
|
||||
test('8 items or more - last ones undefined', () {
|
||||
final result = generateChartColors(8).iterator;
|
||||
expect(result.current, equals(const Color(0xFF2A4C7D)));
|
||||
result.moveNext();
|
||||
expect(result.current, equals(const Color(0xFF5B5291)));
|
||||
result.moveNext();
|
||||
expect(result.current, equals(const Color(0xFF8E5298)));
|
||||
result.moveNext();
|
||||
expect(result.current, equals(const Color(0xFFBF5092)));
|
||||
result.moveNext();
|
||||
expect(result.current, equals(const Color(0xFFE7537E)));
|
||||
result.moveNext();
|
||||
expect(result.current, equals(const Color(0xFFFF6461)));
|
||||
result.moveNext();
|
||||
expect(result.current, equals(const Color(0xFFFF813D)));
|
||||
result.moveNext();
|
||||
expect(result.current, equals(const Color(0xFFFFA600)));
|
||||
result.moveNext();
|
||||
expect(result.current, isNull);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/weight/weight_provider_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -77,6 +77,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
set auth(_i2.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -85,6 +86,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -93,6 +95,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -101,8 +104,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -110,6 +115,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
@@ -140,14 +146,17 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -156,6 +165,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -169,8 +179,10 @@ 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
|
||||
_i5.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -184,8 +196,10 @@ 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
|
||||
_i5.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
|
||||
@@ -25,7 +25,7 @@ import 'package:provider/provider.dart';
|
||||
import 'package:wger/providers/body_weight.dart';
|
||||
import 'package:wger/screens/form_screen.dart';
|
||||
import 'package:wger/screens/weight_screen.dart';
|
||||
import 'package:wger/widgets/core/charts.dart';
|
||||
import 'package:wger/widgets/measurements/charts.dart';
|
||||
import 'package:wger/widgets/weight/forms.dart';
|
||||
|
||||
import '../../test_data/body_weight.dart';
|
||||
@@ -57,7 +57,7 @@ void main() {
|
||||
await tester.pumpWidget(createWeightScreen());
|
||||
|
||||
expect(find.text('Weight'), findsOneWidget);
|
||||
expect(find.byType(MeasurementChartWidget), findsOneWidget);
|
||||
expect(find.byType(MeasurementChartWidgetFl), findsOneWidget);
|
||||
expect(find.byType(Dismissible), findsNWidgets(2));
|
||||
expect(find.byType(ListTile), findsNWidgets(2));
|
||||
});
|
||||
@@ -83,6 +83,7 @@ void main() {
|
||||
testWidgets('Tests the localization of dates - EN', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(createWeightScreen());
|
||||
|
||||
// One in the entries list, one in the chart
|
||||
expect(find.text('1/1/2021'), findsOneWidget);
|
||||
expect(find.text('1/10/2021'), findsOneWidget);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/weight/weight_screen_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -22,7 +22,8 @@ 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,
|
||||
@@ -45,7 +46,8 @@ 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);
|
||||
}
|
||||
@@ -58,11 +60,13 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i3.WeightEntry> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i3.WeightEntry>[],
|
||||
) as List<_i3.WeightEntry>);
|
||||
|
||||
@override
|
||||
set items(List<_i3.WeightEntry>? entries) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -71,11 +75,13 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -84,6 +90,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.WeightEntry findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -98,21 +105,27 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
),
|
||||
) 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
|
||||
_i5.Future<List<_i3.WeightEntry>> fetchAndSetEntries() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#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],
|
||||
@@ -125,6 +138,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.WeightEntry>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> editEntry(_i3.WeightEntry? entry) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -134,6 +148,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> deleteEntry(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -143,6 +158,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
void addListener(_i6.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -151,6 +167,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i6.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -159,6 +176,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -167,6 +185,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/workout/gym_mode_screen_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -68,7 +68,8 @@ 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,
|
||||
@@ -88,7 +89,8 @@ class _FakeExerciseBase_5 extends _i1.SmartFake implements _i5.ExerciseBase {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeExerciseCategory_6 extends _i1.SmartFake implements _i6.ExerciseCategory {
|
||||
class _FakeExerciseCategory_6 extends _i1.SmartFake
|
||||
implements _i6.ExerciseCategory {
|
||||
_FakeExerciseCategory_6(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -144,6 +146,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
set auth(_i2.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -152,6 +155,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -160,6 +164,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -168,8 +173,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -177,6 +184,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
@@ -207,14 +215,17 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
|
||||
@override
|
||||
_i10.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i10.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i10.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i10.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i10.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -223,6 +234,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: _i10.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i10.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i10.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -236,8 +248,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue: _i10.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i10.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i10.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i10.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -251,8 +265,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue: _i10.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i10.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i10.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i10.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
@@ -295,57 +311,70 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i4.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
set exerciseBases(List<_i5.ExerciseBase>? exercisesBases) => super.noSuchMethod(
|
||||
set exerciseBases(List<_i5.ExerciseBase>? exercisesBases) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#exerciseBases,
|
||||
exercisesBases,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i5.ExerciseBase> get filteredExerciseBases => (super.noSuchMethod(
|
||||
Invocation.getter(#filteredExerciseBases),
|
||||
returnValue: <_i5.ExerciseBase>[],
|
||||
) as List<_i5.ExerciseBase>);
|
||||
|
||||
@override
|
||||
set filteredExerciseBases(List<_i5.ExerciseBase>? newFilteredExercises) => super.noSuchMethod(
|
||||
set filteredExerciseBases(List<_i5.ExerciseBase>? newFilteredExercises) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#filteredExerciseBases,
|
||||
newFilteredExercises,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<int, List<_i5.ExerciseBase>> get exerciseBasesByVariation => (super.noSuchMethod(
|
||||
Map<int, List<_i5.ExerciseBase>> get exerciseBasesByVariation =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.getter(#exerciseBasesByVariation),
|
||||
returnValue: <int, List<_i5.ExerciseBase>>{},
|
||||
) as Map<int, List<_i5.ExerciseBase>>);
|
||||
|
||||
@override
|
||||
List<_i5.ExerciseBase> get bases => (super.noSuchMethod(
|
||||
Invocation.getter(#bases),
|
||||
returnValue: <_i5.ExerciseBase>[],
|
||||
) as List<_i5.ExerciseBase>);
|
||||
|
||||
@override
|
||||
List<_i6.ExerciseCategory> get categories => (super.noSuchMethod(
|
||||
Invocation.getter(#categories),
|
||||
returnValue: <_i6.ExerciseCategory>[],
|
||||
) as List<_i6.ExerciseCategory>);
|
||||
|
||||
@override
|
||||
List<_i8.Muscle> get muscles => (super.noSuchMethod(
|
||||
Invocation.getter(#muscles),
|
||||
returnValue: <_i8.Muscle>[],
|
||||
) as List<_i8.Muscle>);
|
||||
|
||||
@override
|
||||
List<_i7.Equipment> get equipment => (super.noSuchMethod(
|
||||
Invocation.getter(#equipment),
|
||||
returnValue: <_i7.Equipment>[],
|
||||
) as List<_i7.Equipment>);
|
||||
|
||||
@override
|
||||
List<_i9.Language> get languages => (super.noSuchMethod(
|
||||
Invocation.getter(#languages),
|
||||
returnValue: <_i9.Language>[],
|
||||
) as List<_i9.Language>);
|
||||
|
||||
@override
|
||||
set languages(List<_i9.Language>? languages) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -354,11 +383,13 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
_i10.Future<void> setFilters(_i11.Filters? newFilters) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -368,6 +399,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> findByFilters() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -377,6 +409,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -385,6 +418,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i5.ExerciseBase findExerciseBaseById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -399,6 +433,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
),
|
||||
) as _i5.ExerciseBase);
|
||||
|
||||
@override
|
||||
List<_i5.ExerciseBase> findExerciseBasesByVariationId(
|
||||
int? id, {
|
||||
@@ -412,6 +447,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
returnValue: <_i5.ExerciseBase>[],
|
||||
) as List<_i5.ExerciseBase>);
|
||||
|
||||
@override
|
||||
_i6.ExerciseCategory findCategoryById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -426,6 +462,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
),
|
||||
) as _i6.ExerciseCategory);
|
||||
|
||||
@override
|
||||
_i7.Equipment findEquipmentById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -440,6 +477,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
),
|
||||
) as _i7.Equipment);
|
||||
|
||||
@override
|
||||
_i8.Muscle findMuscleById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -454,6 +492,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
),
|
||||
) as _i8.Muscle);
|
||||
|
||||
@override
|
||||
_i9.Language findLanguageById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -468,6 +507,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
),
|
||||
) as _i9.Language);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetCategories() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -477,6 +517,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetVariations() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -486,6 +527,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetMuscles() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -495,6 +537,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetEquipment() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -504,6 +547,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetLanguages() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -513,8 +557,10 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<_i5.ExerciseBase> fetchAndSetExerciseBase(int? exerciseBaseId) => (super.noSuchMethod(
|
||||
_i10.Future<_i5.ExerciseBase> fetchAndSetExerciseBase(int? exerciseBaseId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetExerciseBase,
|
||||
[exerciseBaseId],
|
||||
@@ -527,8 +573,10 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
)),
|
||||
) as _i10.Future<_i5.ExerciseBase>);
|
||||
|
||||
@override
|
||||
_i5.ExerciseBase readExerciseBaseFromBaseInfo(dynamic baseData) => (super.noSuchMethod(
|
||||
_i5.ExerciseBase readExerciseBaseFromBaseInfo(dynamic baseData) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#readExerciseBaseFromBaseInfo,
|
||||
[baseData],
|
||||
@@ -541,6 +589,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
),
|
||||
) as _i5.ExerciseBase);
|
||||
|
||||
@override
|
||||
_i10.Future<void> checkExerciseCacheVersion() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -550,6 +599,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<void> fetchAndSetExercises() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -559,6 +609,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
returnValue: _i10.Future<void>.value(),
|
||||
returnValueForMissingStub: _i10.Future<void>.value(),
|
||||
) as _i10.Future<void>);
|
||||
|
||||
@override
|
||||
_i10.Future<List<_i5.ExerciseBase>> searchExercise(
|
||||
String? name, {
|
||||
@@ -574,8 +625,10 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
#searchEnglish: searchEnglish,
|
||||
},
|
||||
),
|
||||
returnValue: _i10.Future<List<_i5.ExerciseBase>>.value(<_i5.ExerciseBase>[]),
|
||||
returnValue:
|
||||
_i10.Future<List<_i5.ExerciseBase>>.value(<_i5.ExerciseBase>[]),
|
||||
) as _i10.Future<List<_i5.ExerciseBase>>);
|
||||
|
||||
@override
|
||||
void addListener(_i12.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -584,6 +637,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i12.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -592,6 +646,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -600,6 +655,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -76,29 +76,14 @@ void main() {
|
||||
|
||||
testWidgets('Test that the entries are shown', (WidgetTester tester) async {
|
||||
// arrange
|
||||
final key1 = find.byKey(const Key('1'));
|
||||
final key2 = find.byKey(const Key('2'));
|
||||
final key3 = find.byKey(const Key('3'));
|
||||
await tester.pumpWidget(createHomeScreen());
|
||||
await tester.tap(find.byKey(const Key('1')));
|
||||
await tester.pump();
|
||||
|
||||
// assert
|
||||
expect(key1, findsOneWidget);
|
||||
expect(
|
||||
(tester.widget(key1) as DropdownMenuItem<RepetitionUnit>).value!.name,
|
||||
equals('some rep unit'),
|
||||
);
|
||||
|
||||
expect(key2, findsOneWidget);
|
||||
expect(
|
||||
(tester.widget(key2) as DropdownMenuItem<RepetitionUnit>).value!.name,
|
||||
equals('another name'),
|
||||
);
|
||||
expect(key3, findsOneWidget);
|
||||
expect(
|
||||
(tester.widget(key3) as DropdownMenuItem<RepetitionUnit>).value!.name,
|
||||
equals('this is repetition number 3'),
|
||||
);
|
||||
expect(find.text('some rep unit'), findsWidgets);
|
||||
expect(find.text('another name'), findsWidgets);
|
||||
expect(find.text('this is repetition number 3'), findsWidgets);
|
||||
});
|
||||
|
||||
testWidgets('Test that the correct units are set after selection', (WidgetTester tester) async {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/workout/repetition_unit_form_widget_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -31,7 +31,8 @@ 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,
|
||||
@@ -51,7 +52,8 @@ 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,
|
||||
@@ -101,7 +103,8 @@ 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,
|
||||
@@ -124,7 +127,8 @@ 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);
|
||||
}
|
||||
@@ -137,16 +141,19 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i5.WorkoutPlan> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i5.WorkoutPlan>[],
|
||||
) as List<_i5.WorkoutPlan>);
|
||||
|
||||
@override
|
||||
List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod(
|
||||
Invocation.getter(#weightUnits),
|
||||
returnValue: <_i3.WeightUnit>[],
|
||||
) as List<_i3.WeightUnit>);
|
||||
|
||||
@override
|
||||
_i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod(
|
||||
Invocation.getter(#defaultWeightUnit),
|
||||
@@ -155,11 +162,13 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
Invocation.getter(#defaultWeightUnit),
|
||||
),
|
||||
) as _i3.WeightUnit);
|
||||
|
||||
@override
|
||||
List<_i4.RepetitionUnit> get repetitionUnits => (super.noSuchMethod(
|
||||
Invocation.getter(#repetitionUnits),
|
||||
returnValue: <_i4.RepetitionUnit>[],
|
||||
) as List<_i4.RepetitionUnit>);
|
||||
|
||||
@override
|
||||
_i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod(
|
||||
Invocation.getter(#defaultRepetitionUnit),
|
||||
@@ -168,11 +177,13 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
Invocation.getter(#defaultRepetitionUnit),
|
||||
),
|
||||
) as _i4.RepetitionUnit);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -181,6 +192,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i5.WorkoutPlan> getPlans() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -189,6 +201,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: <_i5.WorkoutPlan>[],
|
||||
) as List<_i5.WorkoutPlan>);
|
||||
|
||||
@override
|
||||
_i5.WorkoutPlan findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -203,6 +216,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
),
|
||||
) as _i5.WorkoutPlan);
|
||||
|
||||
@override
|
||||
int findIndexById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -211,6 +225,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: 0,
|
||||
) as int);
|
||||
|
||||
@override
|
||||
void setCurrentPlan(int? id) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -219,6 +234,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void resetCurrentPlan() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -227,6 +243,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -236,6 +253,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -245,8 +263,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) 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],
|
||||
@@ -259,8 +279,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) 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],
|
||||
@@ -273,8 +295,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) 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],
|
||||
@@ -287,8 +311,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) 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],
|
||||
@@ -296,6 +322,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> deleteWorkout(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -305,6 +332,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<Map<String, dynamic>> fetchLogData(
|
||||
_i5.WorkoutPlan? workout,
|
||||
@@ -318,8 +346,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
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
|
||||
_i12.Future<void> fetchAndSetRepetitionUnits() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -329,6 +359,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchAndSetWeightUnits() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -338,6 +369,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchAndSetUnits() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -347,6 +379,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i6.Day> addDay(
|
||||
_i6.Day? day,
|
||||
@@ -371,6 +404,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i6.Day>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> editDay(_i6.Day? day) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -380,6 +414,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> deleteDay(_i6.Day? day) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -389,6 +424,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i7.Set> addSet(_i7.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -403,6 +439,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i7.Set>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> editSet(_i7.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -412,6 +449,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<List<_i7.Set>> reorderSets(
|
||||
List<_i7.Set>? sets,
|
||||
@@ -427,8 +465,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: _i12.Future<List<_i7.Set>>.value(<_i7.Set>[]),
|
||||
) 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],
|
||||
@@ -436,6 +476,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<String> fetchSmartText(
|
||||
_i7.Set? workoutSet,
|
||||
@@ -451,6 +492,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: _i12.Future<String>.value(''),
|
||||
) as _i12.Future<String>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> deleteSet(_i7.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -460,8 +502,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) 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],
|
||||
@@ -474,6 +518,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i8.Setting>);
|
||||
|
||||
@override
|
||||
_i12.Future<dynamic> fetchSessionData() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -482,13 +527,16 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: _i12.Future<dynamic>.value(),
|
||||
) 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,
|
||||
@@ -496,6 +544,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i9.WorkoutSession>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i10.Log> addLog(_i10.Log? log) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -510,6 +559,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i10.Log>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> deleteLog(_i10.Log? log) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -519,6 +569,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
void addListener(_i15.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -527,6 +578,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i15.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -535,6 +587,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -543,6 +596,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -77,29 +77,14 @@ void main() {
|
||||
|
||||
testWidgets('Test that the entries are shown', (WidgetTester tester) async {
|
||||
// arrange
|
||||
final key1 = find.byKey(const Key('1'));
|
||||
final key2 = find.byKey(const Key('2'));
|
||||
final key3 = find.byKey(const Key('3'));
|
||||
await tester.pumpWidget(createHomeScreen());
|
||||
await tester.tap(find.byKey(const Key('1')));
|
||||
await tester.pump();
|
||||
|
||||
// assert
|
||||
expect(key1, findsOneWidget);
|
||||
expect(
|
||||
(tester.widget(key1) as DropdownMenuItem<WeightUnit>).value!.name,
|
||||
equals('kg'),
|
||||
);
|
||||
|
||||
expect(key2, findsOneWidget);
|
||||
expect(
|
||||
(tester.widget(key2) as DropdownMenuItem<WeightUnit>).value!.name,
|
||||
equals('donkeys'),
|
||||
);
|
||||
expect(key3, findsOneWidget);
|
||||
expect(
|
||||
(tester.widget(key3) as DropdownMenuItem<WeightUnit>).value!.name,
|
||||
equals('plates'),
|
||||
);
|
||||
expect(find.text('kg'), findsWidgets);
|
||||
expect(find.text('donkeys'), findsWidgets);
|
||||
expect(find.text('plates'), findsWidgets);
|
||||
});
|
||||
|
||||
testWidgets('Test that the correct units are set after selection', (WidgetTester tester) async {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/workout/weight_unit_form_widget_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -22,7 +22,8 @@ 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,
|
||||
@@ -45,7 +46,8 @@ 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);
|
||||
}
|
||||
@@ -58,11 +60,13 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i3.WeightEntry> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i3.WeightEntry>[],
|
||||
) as List<_i3.WeightEntry>);
|
||||
|
||||
@override
|
||||
set items(List<_i3.WeightEntry>? entries) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -71,11 +75,13 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -84,6 +90,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.WeightEntry findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -98,21 +105,27 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
),
|
||||
) 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
|
||||
_i5.Future<List<_i3.WeightEntry>> fetchAndSetEntries() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#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],
|
||||
@@ -125,6 +138,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.WeightEntry>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> editEntry(_i3.WeightEntry? entry) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -134,6 +148,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> deleteEntry(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -143,6 +158,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
void addListener(_i6.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -151,6 +167,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i6.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -159,6 +176,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -167,6 +185,7 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/workout/workout_day_form_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -31,7 +31,8 @@ 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,
|
||||
@@ -51,7 +52,8 @@ 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,
|
||||
@@ -101,7 +103,8 @@ 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,
|
||||
@@ -124,7 +127,8 @@ 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);
|
||||
}
|
||||
@@ -137,16 +141,19 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i5.WorkoutPlan> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i5.WorkoutPlan>[],
|
||||
) as List<_i5.WorkoutPlan>);
|
||||
|
||||
@override
|
||||
List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod(
|
||||
Invocation.getter(#weightUnits),
|
||||
returnValue: <_i3.WeightUnit>[],
|
||||
) as List<_i3.WeightUnit>);
|
||||
|
||||
@override
|
||||
_i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod(
|
||||
Invocation.getter(#defaultWeightUnit),
|
||||
@@ -155,11 +162,13 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
Invocation.getter(#defaultWeightUnit),
|
||||
),
|
||||
) as _i3.WeightUnit);
|
||||
|
||||
@override
|
||||
List<_i4.RepetitionUnit> get repetitionUnits => (super.noSuchMethod(
|
||||
Invocation.getter(#repetitionUnits),
|
||||
returnValue: <_i4.RepetitionUnit>[],
|
||||
) as List<_i4.RepetitionUnit>);
|
||||
|
||||
@override
|
||||
_i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod(
|
||||
Invocation.getter(#defaultRepetitionUnit),
|
||||
@@ -168,11 +177,13 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
Invocation.getter(#defaultRepetitionUnit),
|
||||
),
|
||||
) as _i4.RepetitionUnit);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -181,6 +192,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i5.WorkoutPlan> getPlans() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -189,6 +201,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: <_i5.WorkoutPlan>[],
|
||||
) as List<_i5.WorkoutPlan>);
|
||||
|
||||
@override
|
||||
_i5.WorkoutPlan findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -203,6 +216,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
),
|
||||
) as _i5.WorkoutPlan);
|
||||
|
||||
@override
|
||||
int findIndexById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -211,6 +225,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: 0,
|
||||
) as int);
|
||||
|
||||
@override
|
||||
void setCurrentPlan(int? id) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -219,6 +234,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void resetCurrentPlan() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -227,6 +243,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -236,6 +253,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -245,8 +263,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) 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],
|
||||
@@ -259,8 +279,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) 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],
|
||||
@@ -273,8 +295,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) 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],
|
||||
@@ -287,8 +311,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) 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],
|
||||
@@ -296,6 +322,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> deleteWorkout(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -305,6 +332,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<Map<String, dynamic>> fetchLogData(
|
||||
_i5.WorkoutPlan? workout,
|
||||
@@ -318,8 +346,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
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
|
||||
_i12.Future<void> fetchAndSetRepetitionUnits() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -329,6 +359,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchAndSetWeightUnits() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -338,6 +369,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchAndSetUnits() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -347,6 +379,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i6.Day> addDay(
|
||||
_i6.Day? day,
|
||||
@@ -371,6 +404,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i6.Day>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> editDay(_i6.Day? day) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -380,6 +414,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> deleteDay(_i6.Day? day) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -389,6 +424,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i7.Set> addSet(_i7.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -403,6 +439,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i7.Set>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> editSet(_i7.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -412,6 +449,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<List<_i7.Set>> reorderSets(
|
||||
List<_i7.Set>? sets,
|
||||
@@ -427,8 +465,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: _i12.Future<List<_i7.Set>>.value(<_i7.Set>[]),
|
||||
) 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],
|
||||
@@ -436,6 +476,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<String> fetchSmartText(
|
||||
_i7.Set? workoutSet,
|
||||
@@ -451,6 +492,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: _i12.Future<String>.value(''),
|
||||
) as _i12.Future<String>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> deleteSet(_i7.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -460,8 +502,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) 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],
|
||||
@@ -474,6 +518,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i8.Setting>);
|
||||
|
||||
@override
|
||||
_i12.Future<dynamic> fetchSessionData() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -482,13 +527,16 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: _i12.Future<dynamic>.value(),
|
||||
) 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,
|
||||
@@ -496,6 +544,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i9.WorkoutSession>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i10.Log> addLog(_i10.Log? log) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -510,6 +559,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i10.Log>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> deleteLog(_i10.Log? log) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -519,6 +569,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
void addListener(_i15.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -527,6 +578,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i15.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -535,6 +587,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -543,6 +596,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/workout/workout_form_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -31,7 +31,8 @@ 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,
|
||||
@@ -51,7 +52,8 @@ 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,
|
||||
@@ -101,7 +103,8 @@ 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,
|
||||
@@ -124,7 +127,8 @@ 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);
|
||||
}
|
||||
@@ -137,16 +141,19 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i5.WorkoutPlan> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i5.WorkoutPlan>[],
|
||||
) as List<_i5.WorkoutPlan>);
|
||||
|
||||
@override
|
||||
List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod(
|
||||
Invocation.getter(#weightUnits),
|
||||
returnValue: <_i3.WeightUnit>[],
|
||||
) as List<_i3.WeightUnit>);
|
||||
|
||||
@override
|
||||
_i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod(
|
||||
Invocation.getter(#defaultWeightUnit),
|
||||
@@ -155,11 +162,13 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
Invocation.getter(#defaultWeightUnit),
|
||||
),
|
||||
) as _i3.WeightUnit);
|
||||
|
||||
@override
|
||||
List<_i4.RepetitionUnit> get repetitionUnits => (super.noSuchMethod(
|
||||
Invocation.getter(#repetitionUnits),
|
||||
returnValue: <_i4.RepetitionUnit>[],
|
||||
) as List<_i4.RepetitionUnit>);
|
||||
|
||||
@override
|
||||
_i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod(
|
||||
Invocation.getter(#defaultRepetitionUnit),
|
||||
@@ -168,11 +177,13 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
Invocation.getter(#defaultRepetitionUnit),
|
||||
),
|
||||
) as _i4.RepetitionUnit);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -181,6 +192,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i5.WorkoutPlan> getPlans() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -189,6 +201,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: <_i5.WorkoutPlan>[],
|
||||
) as List<_i5.WorkoutPlan>);
|
||||
|
||||
@override
|
||||
_i5.WorkoutPlan findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -203,6 +216,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
),
|
||||
) as _i5.WorkoutPlan);
|
||||
|
||||
@override
|
||||
int findIndexById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -211,6 +225,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: 0,
|
||||
) as int);
|
||||
|
||||
@override
|
||||
void setCurrentPlan(int? id) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -219,6 +234,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void resetCurrentPlan() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -227,6 +243,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -236,6 +253,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -245,8 +263,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) 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],
|
||||
@@ -259,8 +279,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) 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],
|
||||
@@ -273,8 +295,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) 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],
|
||||
@@ -287,8 +311,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) 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],
|
||||
@@ -296,6 +322,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> deleteWorkout(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -305,6 +332,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<Map<String, dynamic>> fetchLogData(
|
||||
_i5.WorkoutPlan? workout,
|
||||
@@ -318,8 +346,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
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
|
||||
_i12.Future<void> fetchAndSetRepetitionUnits() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -329,6 +359,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchAndSetWeightUnits() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -338,6 +369,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> fetchAndSetUnits() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -347,6 +379,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i6.Day> addDay(
|
||||
_i6.Day? day,
|
||||
@@ -371,6 +404,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i6.Day>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> editDay(_i6.Day? day) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -380,6 +414,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> deleteDay(_i6.Day? day) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -389,6 +424,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i7.Set> addSet(_i7.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -403,6 +439,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i7.Set>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> editSet(_i7.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -412,6 +449,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<List<_i7.Set>> reorderSets(
|
||||
List<_i7.Set>? sets,
|
||||
@@ -427,8 +465,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: _i12.Future<List<_i7.Set>>.value(<_i7.Set>[]),
|
||||
) 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],
|
||||
@@ -436,6 +476,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
_i12.Future<String> fetchSmartText(
|
||||
_i7.Set? workoutSet,
|
||||
@@ -451,6 +492,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: _i12.Future<String>.value(''),
|
||||
) as _i12.Future<String>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> deleteSet(_i7.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -460,8 +502,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) 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],
|
||||
@@ -474,6 +518,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i8.Setting>);
|
||||
|
||||
@override
|
||||
_i12.Future<dynamic> fetchSessionData() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -482,13 +527,16 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValue: _i12.Future<dynamic>.value(),
|
||||
) 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,
|
||||
@@ -496,6 +544,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i9.WorkoutSession>);
|
||||
|
||||
@override
|
||||
_i12.Future<_i10.Log> addLog(_i10.Log? log) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -510,6 +559,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i12.Future<_i10.Log>);
|
||||
|
||||
@override
|
||||
_i12.Future<void> deleteLog(_i10.Log? log) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -519,6 +569,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
|
||||
@override
|
||||
void addListener(_i15.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -527,6 +578,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i15.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -535,6 +587,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -543,6 +596,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/workout/workout_plan_screen_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -77,6 +77,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
set auth(_i2.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -85,6 +86,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -93,6 +95,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -101,8 +104,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -110,6 +115,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
@@ -140,14 +146,17 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -156,6 +165,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -169,8 +179,10 @@ 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
|
||||
_i5.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -184,8 +196,10 @@ 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
|
||||
_i5.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/workout/workout_plans_screen_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -77,6 +77,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
set auth(_i2.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -85,6 +86,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -93,6 +95,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -101,8 +104,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -110,6 +115,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
@@ -140,14 +146,17 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -156,6 +165,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -169,8 +179,10 @@ 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
|
||||
_i5.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -184,8 +196,10 @@ 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
|
||||
_i5.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/workout/workout_provider_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -77,6 +77,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i2.AuthProvider);
|
||||
|
||||
@override
|
||||
set auth(_i2.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -85,6 +86,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -93,6 +95,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i3.Client);
|
||||
|
||||
@override
|
||||
set client(_i3.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -101,8 +104,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -110,6 +115,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
@@ -140,14 +146,17 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -156,6 +165,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider {
|
||||
),
|
||||
returnValue: _i5.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i5.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -169,8 +179,10 @@ 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
|
||||
_i5.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -184,8 +196,10 @@ 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
|
||||
_i5.Future<_i3.Response> deleteRequest(
|
||||
String? url,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.2 from annotations
|
||||
// in wger/test/workout/workout_set_form_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
@@ -38,7 +38,8 @@ import 'package:wger/providers/workout_plans.dart' as _i21;
|
||||
// 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,
|
||||
@@ -58,7 +59,8 @@ class _FakeExerciseBase_1 extends _i1.SmartFake implements _i3.ExerciseBase {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeExerciseCategory_2 extends _i1.SmartFake implements _i4.ExerciseCategory {
|
||||
class _FakeExerciseCategory_2 extends _i1.SmartFake
|
||||
implements _i4.ExerciseCategory {
|
||||
_FakeExerciseCategory_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -148,7 +150,8 @@ class _FakeWeightUnit_10 extends _i1.SmartFake implements _i10.WeightUnit {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeRepetitionUnit_11 extends _i1.SmartFake implements _i11.RepetitionUnit {
|
||||
class _FakeRepetitionUnit_11 extends _i1.SmartFake
|
||||
implements _i11.RepetitionUnit {
|
||||
_FakeRepetitionUnit_11(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -198,7 +201,8 @@ class _FakeSetting_15 extends _i1.SmartFake implements _i15.Setting {
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeWorkoutSession_16 extends _i1.SmartFake implements _i16.WorkoutSession {
|
||||
class _FakeWorkoutSession_16 extends _i1.SmartFake
|
||||
implements _i16.WorkoutSession {
|
||||
_FakeWorkoutSession_16(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
@@ -234,57 +238,70 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
set exerciseBases(List<_i3.ExerciseBase>? exercisesBases) => super.noSuchMethod(
|
||||
set exerciseBases(List<_i3.ExerciseBase>? exercisesBases) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#exerciseBases,
|
||||
exercisesBases,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i3.ExerciseBase> get filteredExerciseBases => (super.noSuchMethod(
|
||||
Invocation.getter(#filteredExerciseBases),
|
||||
returnValue: <_i3.ExerciseBase>[],
|
||||
) as List<_i3.ExerciseBase>);
|
||||
|
||||
@override
|
||||
set filteredExerciseBases(List<_i3.ExerciseBase>? newFilteredExercises) => super.noSuchMethod(
|
||||
set filteredExerciseBases(List<_i3.ExerciseBase>? newFilteredExercises) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#filteredExerciseBases,
|
||||
newFilteredExercises,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<int, List<_i3.ExerciseBase>> get exerciseBasesByVariation => (super.noSuchMethod(
|
||||
Map<int, List<_i3.ExerciseBase>> get exerciseBasesByVariation =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.getter(#exerciseBasesByVariation),
|
||||
returnValue: <int, List<_i3.ExerciseBase>>{},
|
||||
) as Map<int, List<_i3.ExerciseBase>>);
|
||||
|
||||
@override
|
||||
List<_i3.ExerciseBase> get bases => (super.noSuchMethod(
|
||||
Invocation.getter(#bases),
|
||||
returnValue: <_i3.ExerciseBase>[],
|
||||
) as List<_i3.ExerciseBase>);
|
||||
|
||||
@override
|
||||
List<_i4.ExerciseCategory> get categories => (super.noSuchMethod(
|
||||
Invocation.getter(#categories),
|
||||
returnValue: <_i4.ExerciseCategory>[],
|
||||
) as List<_i4.ExerciseCategory>);
|
||||
|
||||
@override
|
||||
List<_i6.Muscle> get muscles => (super.noSuchMethod(
|
||||
Invocation.getter(#muscles),
|
||||
returnValue: <_i6.Muscle>[],
|
||||
) as List<_i6.Muscle>);
|
||||
|
||||
@override
|
||||
List<_i5.Equipment> get equipment => (super.noSuchMethod(
|
||||
Invocation.getter(#equipment),
|
||||
returnValue: <_i5.Equipment>[],
|
||||
) as List<_i5.Equipment>);
|
||||
|
||||
@override
|
||||
List<_i7.Language> get languages => (super.noSuchMethod(
|
||||
Invocation.getter(#languages),
|
||||
returnValue: <_i7.Language>[],
|
||||
) as List<_i7.Language>);
|
||||
|
||||
@override
|
||||
set languages(List<_i7.Language>? languages) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -293,11 +310,13 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
_i19.Future<void> setFilters(_i18.Filters? newFilters) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -307,6 +326,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> findByFilters() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -316,6 +336,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -324,6 +345,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i3.ExerciseBase findExerciseBaseById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -338,6 +360,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
),
|
||||
) as _i3.ExerciseBase);
|
||||
|
||||
@override
|
||||
List<_i3.ExerciseBase> findExerciseBasesByVariationId(
|
||||
int? id, {
|
||||
@@ -351,6 +374,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
returnValue: <_i3.ExerciseBase>[],
|
||||
) as List<_i3.ExerciseBase>);
|
||||
|
||||
@override
|
||||
_i4.ExerciseCategory findCategoryById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -365,6 +389,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
),
|
||||
) as _i4.ExerciseCategory);
|
||||
|
||||
@override
|
||||
_i5.Equipment findEquipmentById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -379,6 +404,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
),
|
||||
) as _i5.Equipment);
|
||||
|
||||
@override
|
||||
_i6.Muscle findMuscleById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -393,6 +419,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
),
|
||||
) as _i6.Muscle);
|
||||
|
||||
@override
|
||||
_i7.Language findLanguageById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -407,6 +434,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
),
|
||||
) as _i7.Language);
|
||||
|
||||
@override
|
||||
_i19.Future<void> fetchAndSetCategories() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -416,6 +444,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> fetchAndSetVariations() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -425,6 +454,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> fetchAndSetMuscles() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -434,6 +464,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> fetchAndSetEquipment() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -443,6 +474,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> fetchAndSetLanguages() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -452,8 +484,10 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<_i3.ExerciseBase> fetchAndSetExerciseBase(int? exerciseBaseId) => (super.noSuchMethod(
|
||||
_i19.Future<_i3.ExerciseBase> fetchAndSetExerciseBase(int? exerciseBaseId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetExerciseBase,
|
||||
[exerciseBaseId],
|
||||
@@ -466,8 +500,10 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
)),
|
||||
) as _i19.Future<_i3.ExerciseBase>);
|
||||
|
||||
@override
|
||||
_i3.ExerciseBase readExerciseBaseFromBaseInfo(dynamic baseData) => (super.noSuchMethod(
|
||||
_i3.ExerciseBase readExerciseBaseFromBaseInfo(dynamic baseData) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#readExerciseBaseFromBaseInfo,
|
||||
[baseData],
|
||||
@@ -480,6 +516,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
),
|
||||
) as _i3.ExerciseBase);
|
||||
|
||||
@override
|
||||
_i19.Future<void> checkExerciseCacheVersion() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -489,6 +526,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> fetchAndSetExercises() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -498,6 +536,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<List<_i3.ExerciseBase>> searchExercise(
|
||||
String? name, {
|
||||
@@ -513,8 +552,10 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
#searchEnglish: searchEnglish,
|
||||
},
|
||||
),
|
||||
returnValue: _i19.Future<List<_i3.ExerciseBase>>.value(<_i3.ExerciseBase>[]),
|
||||
returnValue:
|
||||
_i19.Future<List<_i3.ExerciseBase>>.value(<_i3.ExerciseBase>[]),
|
||||
) as _i19.Future<List<_i3.ExerciseBase>>);
|
||||
|
||||
@override
|
||||
void addListener(_i20.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -523,6 +564,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -531,6 +573,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -539,6 +582,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -565,6 +609,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
Invocation.getter(#auth),
|
||||
),
|
||||
) as _i8.AuthProvider);
|
||||
|
||||
@override
|
||||
set auth(_i8.AuthProvider? _auth) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -573,6 +618,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i9.Client get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
@@ -581,6 +627,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i9.Client);
|
||||
|
||||
@override
|
||||
set client(_i9.Client? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
@@ -589,8 +636,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
|
||||
Map<String, String> getDefaultHeaders({dynamic includeAuth = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getDefaultHeaders,
|
||||
[],
|
||||
@@ -598,6 +647,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
),
|
||||
returnValue: <String, String>{},
|
||||
) as Map<String, String>);
|
||||
|
||||
@override
|
||||
Uri makeUrl(
|
||||
String? path, {
|
||||
@@ -628,14 +678,17 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
),
|
||||
),
|
||||
) as Uri);
|
||||
|
||||
@override
|
||||
_i19.Future<Map<String, dynamic>> fetch(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetch,
|
||||
[uri],
|
||||
),
|
||||
returnValue: _i19.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i19.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i19.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i19.Future<List<dynamic>> fetchPaginated(Uri? uri) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -644,6 +697,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
),
|
||||
returnValue: _i19.Future<List<dynamic>>.value(<dynamic>[]),
|
||||
) as _i19.Future<List<dynamic>>);
|
||||
|
||||
@override
|
||||
_i19.Future<Map<String, dynamic>> post(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -657,8 +711,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue: _i19.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i19.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i19.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i19.Future<Map<String, dynamic>> patch(
|
||||
Map<String, dynamic>? data,
|
||||
@@ -672,8 +728,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
|
||||
uri,
|
||||
],
|
||||
),
|
||||
returnValue: _i19.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i19.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i19.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i19.Future<_i9.Response> deleteRequest(
|
||||
String? url,
|
||||
@@ -703,7 +761,8 @@ 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 _i21.WorkoutPlansProvider {
|
||||
class MockWorkoutPlansProvider extends _i1.Mock
|
||||
implements _i21.WorkoutPlansProvider {
|
||||
MockWorkoutPlansProvider() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@@ -716,16 +775,19 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
Invocation.getter(#baseProvider),
|
||||
),
|
||||
) as _i2.WgerBaseProvider);
|
||||
|
||||
@override
|
||||
List<_i12.WorkoutPlan> get items => (super.noSuchMethod(
|
||||
Invocation.getter(#items),
|
||||
returnValue: <_i12.WorkoutPlan>[],
|
||||
) as List<_i12.WorkoutPlan>);
|
||||
|
||||
@override
|
||||
List<_i10.WeightUnit> get weightUnits => (super.noSuchMethod(
|
||||
Invocation.getter(#weightUnits),
|
||||
returnValue: <_i10.WeightUnit>[],
|
||||
) as List<_i10.WeightUnit>);
|
||||
|
||||
@override
|
||||
_i10.WeightUnit get defaultWeightUnit => (super.noSuchMethod(
|
||||
Invocation.getter(#defaultWeightUnit),
|
||||
@@ -734,11 +796,13 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
Invocation.getter(#defaultWeightUnit),
|
||||
),
|
||||
) as _i10.WeightUnit);
|
||||
|
||||
@override
|
||||
List<_i11.RepetitionUnit> get repetitionUnits => (super.noSuchMethod(
|
||||
Invocation.getter(#repetitionUnits),
|
||||
returnValue: <_i11.RepetitionUnit>[],
|
||||
) as List<_i11.RepetitionUnit>);
|
||||
|
||||
@override
|
||||
_i11.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod(
|
||||
Invocation.getter(#defaultRepetitionUnit),
|
||||
@@ -747,11 +811,13 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
Invocation.getter(#defaultRepetitionUnit),
|
||||
),
|
||||
) as _i11.RepetitionUnit);
|
||||
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
|
||||
@override
|
||||
void clear() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -760,6 +826,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
List<_i12.WorkoutPlan> getPlans() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -768,6 +835,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
returnValue: <_i12.WorkoutPlan>[],
|
||||
) as List<_i12.WorkoutPlan>);
|
||||
|
||||
@override
|
||||
_i12.WorkoutPlan findById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -782,6 +850,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
),
|
||||
) as _i12.WorkoutPlan);
|
||||
|
||||
@override
|
||||
int findIndexById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -790,6 +859,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
returnValue: 0,
|
||||
) as int);
|
||||
|
||||
@override
|
||||
void setCurrentPlan(int? id) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -798,6 +868,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void resetCurrentPlan() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -806,6 +877,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
_i19.Future<void> fetchAndSetAllPlansFull() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -815,6 +887,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> fetchAndSetAllPlansSparse() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -824,8 +897,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<_i12.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(
|
||||
_i19.Future<_i12.WorkoutPlan> fetchAndSetPlanSparse(int? planId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetPlanSparse,
|
||||
[planId],
|
||||
@@ -838,8 +913,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i19.Future<_i12.WorkoutPlan>);
|
||||
|
||||
@override
|
||||
_i19.Future<_i12.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod(
|
||||
_i19.Future<_i12.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchAndSetWorkoutPlanFull,
|
||||
[workoutId],
|
||||
@@ -852,8 +929,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i19.Future<_i12.WorkoutPlan>);
|
||||
|
||||
@override
|
||||
_i19.Future<_i12.WorkoutPlan> addWorkout(_i12.WorkoutPlan? workout) => (super.noSuchMethod(
|
||||
_i19.Future<_i12.WorkoutPlan> addWorkout(_i12.WorkoutPlan? workout) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addWorkout,
|
||||
[workout],
|
||||
@@ -866,8 +945,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i19.Future<_i12.WorkoutPlan>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> editWorkout(_i12.WorkoutPlan? workout) => (super.noSuchMethod(
|
||||
_i19.Future<void> editWorkout(_i12.WorkoutPlan? workout) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#editWorkout,
|
||||
[workout],
|
||||
@@ -875,6 +956,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> deleteWorkout(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -884,6 +966,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<Map<String, dynamic>> fetchLogData(
|
||||
_i12.WorkoutPlan? workout,
|
||||
@@ -897,8 +980,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
base,
|
||||
],
|
||||
),
|
||||
returnValue: _i19.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
returnValue:
|
||||
_i19.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i19.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> fetchAndSetRepetitionUnits() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -908,6 +993,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> fetchAndSetWeightUnits() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -917,6 +1003,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> fetchAndSetUnits() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -926,6 +1013,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<_i13.Day> addDay(
|
||||
_i13.Day? day,
|
||||
@@ -950,6 +1038,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i19.Future<_i13.Day>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> editDay(_i13.Day? day) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -959,6 +1048,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> deleteDay(_i13.Day? day) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -968,6 +1058,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<_i14.Set> addSet(_i14.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -982,6 +1073,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i19.Future<_i14.Set>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> editSet(_i14.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -991,6 +1083,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<List<_i14.Set>> reorderSets(
|
||||
List<_i14.Set>? sets,
|
||||
@@ -1006,8 +1099,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
returnValue: _i19.Future<List<_i14.Set>>.value(<_i14.Set>[]),
|
||||
) as _i19.Future<List<_i14.Set>>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> fetchComputedSettings(_i14.Set? workoutSet) => (super.noSuchMethod(
|
||||
_i19.Future<void> fetchComputedSettings(_i14.Set? workoutSet) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchComputedSettings,
|
||||
[workoutSet],
|
||||
@@ -1015,6 +1110,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<String> fetchSmartText(
|
||||
_i14.Set? workoutSet,
|
||||
@@ -1030,6 +1126,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
returnValue: _i19.Future<String>.value(''),
|
||||
) as _i19.Future<String>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> deleteSet(_i14.Set? workoutSet) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -1039,8 +1136,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
_i19.Future<_i15.Setting> addSetting(_i15.Setting? workoutSetting) => (super.noSuchMethod(
|
||||
_i19.Future<_i15.Setting> addSetting(_i15.Setting? workoutSetting) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addSetting,
|
||||
[workoutSetting],
|
||||
@@ -1053,6 +1152,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i19.Future<_i15.Setting>);
|
||||
|
||||
@override
|
||||
_i19.Future<dynamic> fetchSessionData() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -1061,13 +1161,16 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
returnValue: _i19.Future<dynamic>.value(),
|
||||
) as _i19.Future<dynamic>);
|
||||
|
||||
@override
|
||||
_i19.Future<_i16.WorkoutSession> addSession(_i16.WorkoutSession? session) => (super.noSuchMethod(
|
||||
_i19.Future<_i16.WorkoutSession> addSession(_i16.WorkoutSession? session) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addSession,
|
||||
[session],
|
||||
),
|
||||
returnValue: _i19.Future<_i16.WorkoutSession>.value(_FakeWorkoutSession_16(
|
||||
returnValue:
|
||||
_i19.Future<_i16.WorkoutSession>.value(_FakeWorkoutSession_16(
|
||||
this,
|
||||
Invocation.method(
|
||||
#addSession,
|
||||
@@ -1075,6 +1178,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i19.Future<_i16.WorkoutSession>);
|
||||
|
||||
@override
|
||||
_i19.Future<_i17.Log> addLog(_i17.Log? log) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -1089,6 +1193,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
)),
|
||||
) as _i19.Future<_i17.Log>);
|
||||
|
||||
@override
|
||||
_i19.Future<void> deleteLog(_i17.Log? log) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -1098,6 +1203,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
returnValue: _i19.Future<void>.value(),
|
||||
returnValueForMissingStub: _i19.Future<void>.value(),
|
||||
) as _i19.Future<void>);
|
||||
|
||||
@override
|
||||
void addListener(_i20.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -1106,6 +1212,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -1114,6 +1221,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void dispose() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -1122,6 +1230,7 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProv
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
|
||||
@override
|
||||
void notifyListeners() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:integration_test/integration_test_driver_extended.dart';
|
||||
Future<void> main() async {
|
||||
try {
|
||||
await integrationDriver(
|
||||
onScreenshot: (String screenshotName, List<int> screenshotBytes) async {
|
||||
onScreenshot: (String screenshotName, List<int> screenshotBytes, [_]) async {
|
||||
final File image = await File(screenshotName).create(recursive: true);
|
||||
image.writeAsBytesSync(screenshotBytes);
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user