From 76ce31287f3932649f55ecfd3e0984b7c3a619bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Konko=C4=BE?= Date: Wed, 3 Nov 2021 09:45:55 +0100 Subject: [PATCH 01/49] Add custom ingredient --- lib/providers/nutrition.dart | 12 +++ lib/widgets/nutrition/forms.dart | 98 +++++++++++++++++++ .../nutrition/nutritional_plan_detail.dart | 16 +++ pubspec.lock | 12 +-- pubspec.yaml | 2 +- 5 files changed, 133 insertions(+), 7 deletions(-) diff --git a/lib/providers/nutrition.dart b/lib/providers/nutrition.dart index c7052c73..70fab715 100644 --- a/lib/providers/nutrition.dart +++ b/lib/providers/nutrition.dart @@ -339,6 +339,18 @@ class NutritionPlansProvider extends WgerBaseProvider with ChangeNotifier { notifyListeners(); } +// Log custom ingredient to nutrition diary + Future logIngredentToDiary(MealItem mealItem, int planId) async { + final plan = findById(planId); + mealItem.ingredientObj = await fetchIngredient(mealItem.ingredientId); + final Log log = Log.fromMealItem(mealItem, plan.id!, null); + + final data = await post(log.toJson(), makeUrl(_nutritionDiaryPath)); + log.id = data['id']; + plan.logs.add(log); + notifyListeners(); + } + /// Deletes a log entry Future deleteLog(int logId, int planId) async { await deleteRequest(_nutritionDiaryPath, logId); diff --git a/lib/widgets/nutrition/forms.dart b/lib/widgets/nutrition/forms.dart index 3a0815e6..afaf22c8 100644 --- a/lib/widgets/nutrition/forms.dart +++ b/lib/widgets/nutrition/forms.dart @@ -236,6 +236,104 @@ class MealItemForm extends StatelessWidget { } } +class IngredientForm extends StatelessWidget { + late MealItem _mealItem; + final int _planId; + + IngredientForm(this._planId) { + _mealItem = MealItem.empty(); + } + + final _form = GlobalKey(); + final _ingredientController = TextEditingController(); + final _amountController = TextEditingController(); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.all(20), + child: Form( + key: _form, + child: Column( + children: [ + TypeAheadFormField( + textFieldConfiguration: TextFieldConfiguration( + controller: _ingredientController, + decoration: InputDecoration( + labelText: AppLocalizations.of(context).ingredient), + ), + suggestionsCallback: (pattern) async { + return Provider.of(context, + listen: false) + .searchIngredient( + pattern, + Localizations.localeOf(context).languageCode, + ); + }, + itemBuilder: (context, dynamic suggestion) { + return ListTile( + title: Text(suggestion['value']), + subtitle: Text(suggestion['data']['id'].toString()), + ); + }, + transitionBuilder: (context, suggestionsBox, controller) { + return suggestionsBox; + }, + onSuggestionSelected: (dynamic suggestion) { + _mealItem.ingredientId = suggestion['data']['id']; + _ingredientController.text = suggestion['value']; + }, + validator: (value) { + if (value!.isEmpty) { + return AppLocalizations.of(context).selectIngredient; + } + return null; + }, + ), + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).weight), + controller: _amountController, + keyboardType: TextInputType.number, + onFieldSubmitted: (_) {}, + onSaved: (newValue) { + _mealItem.amount = double.parse(newValue!); + }, + validator: (value) { + try { + double.parse(value!); + } catch (error) { + return AppLocalizations.of(context).enterValidNumber; + } + return null; + }, + ), + ElevatedButton( + child: Text(AppLocalizations.of(context).save), + onPressed: () async { + if (!_form.currentState!.validate()) { + return; + } + _form.currentState!.save(); + + try { + Provider.of(context, listen: false) + .logIngredentToDiary(_mealItem, _planId); + } on WgerHttpException catch (error) { + showHttpExceptionErrorDialog(error, context); + } catch (error) { + showErrorDialog(error, context); + } + Navigator.of(context).pop(); + }, + ), + ], + ), + ), + ); + } +} + class PlanForm extends StatelessWidget { final _form = GlobalKey(); final _descriptionController = TextEditingController(); diff --git a/lib/widgets/nutrition/nutritional_plan_detail.dart b/lib/widgets/nutrition/nutritional_plan_detail.dart index bb7043a0..689a673f 100644 --- a/lib/widgets/nutrition/nutritional_plan_detail.dart +++ b/lib/widgets/nutrition/nutritional_plan_detail.dart @@ -67,6 +67,22 @@ class NutritionalPlanDetailWidget extends StatelessWidget { }, ), ), + Padding( + padding: const EdgeInsets.all(8.0), + child: ElevatedButton( + child: Text(AppLocalizations.of(context).addIngredient), + onPressed: () { + Navigator.pushNamed( + context, + FormScreen.routeName, + arguments: FormScreenArguments( + AppLocalizations.of(context).addIngredient, + IngredientForm(_nutritionalPlan.id!), + ), + ); + }, + ), + ), Container( padding: const EdgeInsets.all(15), height: 220, diff --git a/pubspec.lock b/pubspec.lock index f333a21c..d957b2c6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -14,7 +14,7 @@ packages: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "1.7.2" + version: "1.7.1" android_metadata: dependency: "direct main" description: @@ -42,7 +42,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.6.1" boolean_selector: dependency: transitive description: @@ -133,7 +133,7 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.2.0" charts_common: dependency: transitive description: @@ -524,7 +524,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.3.0" mime: dependency: transitive description: @@ -692,7 +692,7 @@ packages: name: rive url: "https://pub.dartlang.org" source: hosted - version: "0.7.33" + version: "0.7.28" shared_preferences: dependency: "direct main" description: @@ -823,7 +823,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.3.0" timing: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index ac73cd78..b97a1891 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -47,7 +47,7 @@ dependencies: version: ^2.0.0 package_info: ^2.0.2 provider: ^5.0.0 - rive: ^0.7.33 + rive: 0.7.28 shared_preferences: ^2.0.7 table_calendar: ^3.0.2 url_launcher: ^6.0.10 From 504e4ffaba64dfa3ce6a9439776ee43301ca41ec Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Wed, 3 Nov 2021 19:41:05 +0100 Subject: [PATCH 02/49] Refactor ingredient search widget --- lib/l10n/app_en.arb | 6 + lib/providers/nutrition.dart | 6 +- lib/screens/nutritional_plan_screen.dart | 14 +- lib/widgets/nutrition/forms.dart | 132 +++++++----------- .../nutrition/nutritional_plan_detail.dart | 16 --- lib/widgets/nutrition/widgets.dart | 74 ++++++++++ pubspec.lock | 2 +- pubspec.yaml | 2 +- 8 files changed, 148 insertions(+), 104 deletions(-) create mode 100644 lib/widgets/nutrition/widgets.dart diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 77c192e5..be62be29 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -242,6 +242,12 @@ "@logMeal": {}, "addIngredient": "Add ingredient", "@addIngredient": {}, + "logIngredient": "Save to nutrition diary", + "@logIngredient": {}, + "searchIngredient": "Search ingredient", + "@searchIngredient": { + "description": "Label on ingredient search form" + }, "nutritionalPlan": "Nutritional plan", "@nutritionalPlan": {}, "nutritionalDiary": "Nutritional diary", diff --git a/lib/providers/nutrition.dart b/lib/providers/nutrition.dart index 70fab715..a7228134 100644 --- a/lib/providers/nutrition.dart +++ b/lib/providers/nutrition.dart @@ -339,11 +339,11 @@ class NutritionPlansProvider extends WgerBaseProvider with ChangeNotifier { notifyListeners(); } -// Log custom ingredient to nutrition diary - Future logIngredentToDiary(MealItem mealItem, int planId) async { + /// Log custom ingredient to nutrition diary + Future logIngredentToDiary(MealItem mealItem, int planId, [DateTime? dateTime]) async { final plan = findById(planId); mealItem.ingredientObj = await fetchIngredient(mealItem.ingredientId); - final Log log = Log.fromMealItem(mealItem, plan.id!, null); + final Log log = Log.fromMealItem(mealItem, plan.id!, null, dateTime); final data = await post(log.toJson(), makeUrl(_nutritionDiaryPath)); log.id = data['id']; diff --git a/lib/screens/nutritional_plan_screen.dart b/lib/screens/nutritional_plan_screen.dart index eacf8d6a..172e8eb9 100644 --- a/lib/screens/nutritional_plan_screen.dart +++ b/lib/screens/nutritional_plan_screen.dart @@ -44,7 +44,19 @@ class NutritionalPlanScreen extends StatelessWidget { return Scaffold( //appBar: getAppBar(nutritionalPlan), - //drawer: AppDrawer(), + floatingActionButton: FloatingActionButton( + child: const Icon(Icons.history_edu), + onPressed: () { + Navigator.pushNamed( + context, + FormScreen.routeName, + arguments: FormScreenArguments( + AppLocalizations.of(context).logIngredient, + IngredientLogForm(_nutritionalPlan), + ), + ); + }, + ), body: CustomScrollView( slivers: [ SliverAppBar( diff --git a/lib/widgets/nutrition/forms.dart b/lib/widgets/nutrition/forms.dart index afaf22c8..6bff2a12 100644 --- a/lib/widgets/nutrition/forms.dart +++ b/lib/widgets/nutrition/forms.dart @@ -18,7 +18,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:provider/provider.dart'; import 'package:wger/exceptions/http_exception.dart'; import 'package:wger/helpers/consts.dart'; @@ -29,6 +28,7 @@ import 'package:wger/models/nutrition/meal_item.dart'; import 'package:wger/models/nutrition/nutritional_plan.dart'; import 'package:wger/providers/nutrition.dart'; import 'package:wger/screens/nutritional_plan_screen.dart'; +import 'package:wger/widgets/nutrition/widgets.dart'; class MealForm extends StatelessWidget { late final Meal _meal; @@ -115,18 +115,18 @@ class MealForm extends StatelessWidget { class MealItemForm extends StatelessWidget { final Meal _meal; late final MealItem _mealItem; - final List _listMealItems; + final _form = GlobalKey(); + final _ingredientIdController = TextEditingController(); + final _ingredientController = TextEditingController(); + final _amountController = TextEditingController(); + MealItemForm(this._meal, this._listMealItems, [mealItem]) { _mealItem = mealItem ?? MealItem.empty(); _mealItem.mealId = _meal.id!; } - final _form = GlobalKey(); - final _ingredientController = TextEditingController(); - final _amountController = TextEditingController(); - @override Widget build(BuildContext context) { final String unit = AppLocalizations.of(context).g; @@ -136,37 +136,7 @@ class MealItemForm extends StatelessWidget { key: _form, child: Column( children: [ - TypeAheadFormField( - textFieldConfiguration: TextFieldConfiguration( - controller: _ingredientController, - decoration: InputDecoration(labelText: AppLocalizations.of(context).ingredient), - ), - suggestionsCallback: (pattern) async { - return Provider.of(context, listen: false).searchIngredient( - pattern, - Localizations.localeOf(context).languageCode, - ); - }, - itemBuilder: (context, dynamic suggestion) { - return ListTile( - title: Text(suggestion['value']), - subtitle: Text(suggestion['data']['id'].toString()), - ); - }, - transitionBuilder: (context, suggestionsBox, controller) { - return suggestionsBox; - }, - onSuggestionSelected: (dynamic suggestion) { - _mealItem.ingredientId = suggestion['data']['id']; - _ingredientController.text = suggestion['value']; - }, - validator: (value) { - if (value!.isEmpty) { - return AppLocalizations.of(context).selectIngredient; - } - return null; - }, - ), + IngredientTypeahead(_ingredientIdController, _ingredientController), TextFormField( decoration: InputDecoration(labelText: AppLocalizations.of(context).weight), controller: _amountController, @@ -191,6 +161,7 @@ class MealItemForm extends StatelessWidget { return; } _form.currentState!.save(); + _mealItem.ingredientId = int.parse(_ingredientIdController.text); try { Provider.of(context, listen: false) @@ -217,6 +188,8 @@ class MealItemForm extends StatelessWidget { child: ListTile( onTap: () { _ingredientController.text = _listMealItems[index].ingredientObj.name; + _ingredientIdController.text = + _listMealItems[index].ingredientObj.id.toString(); _amountController.text = _listMealItems[index].amount.toStringAsFixed(0); _mealItem.ingredientId = _listMealItems[index].ingredientId; _mealItem.amount = _listMealItems[index].amount; @@ -236,63 +209,32 @@ class MealItemForm extends StatelessWidget { } } -class IngredientForm extends StatelessWidget { +class IngredientLogForm extends StatelessWidget { late MealItem _mealItem; - final int _planId; - - IngredientForm(this._planId) { - _mealItem = MealItem.empty(); - } + final NutritionalPlan _plan; final _form = GlobalKey(); final _ingredientController = TextEditingController(); + final _ingredientIdController = TextEditingController(); final _amountController = TextEditingController(); + final _dateController = TextEditingController(); + + IngredientLogForm(this._plan) { + _mealItem = MealItem.empty(); + _dateController.text = toDate(DateTime.now())!; + } @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.all(20), + margin: const EdgeInsets.all(20), child: Form( key: _form, child: Column( children: [ - TypeAheadFormField( - textFieldConfiguration: TextFieldConfiguration( - controller: _ingredientController, - decoration: InputDecoration( - labelText: AppLocalizations.of(context).ingredient), - ), - suggestionsCallback: (pattern) async { - return Provider.of(context, - listen: false) - .searchIngredient( - pattern, - Localizations.localeOf(context).languageCode, - ); - }, - itemBuilder: (context, dynamic suggestion) { - return ListTile( - title: Text(suggestion['value']), - subtitle: Text(suggestion['data']['id'].toString()), - ); - }, - transitionBuilder: (context, suggestionsBox, controller) { - return suggestionsBox; - }, - onSuggestionSelected: (dynamic suggestion) { - _mealItem.ingredientId = suggestion['data']['id']; - _ingredientController.text = suggestion['value']; - }, - validator: (value) { - if (value!.isEmpty) { - return AppLocalizations.of(context).selectIngredient; - } - return null; - }, - ), + IngredientTypeahead(_ingredientIdController, _ingredientController), TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).weight), + decoration: InputDecoration(labelText: AppLocalizations.of(context).weight), controller: _amountController, keyboardType: TextInputType.number, onFieldSubmitted: (_) {}, @@ -308,6 +250,31 @@ class IngredientForm extends StatelessWidget { return null; }, ), + TextFormField( + readOnly: true, // Stop keyboard from appearing + decoration: InputDecoration( + labelText: AppLocalizations.of(context).date, + suffixIcon: const Icon(Icons.calendar_today_outlined), + ), + enableInteractiveSelection: false, + controller: _dateController, + onTap: () async { + // Show Date Picker Here + final pickedDate = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(DateTime.now().year - 10), + lastDate: DateTime.now(), + ); + + if (pickedDate != null) { + _dateController.text = toDate(pickedDate)!; + } + }, + onSaved: (newValue) { + _dateController.text = newValue!; + }, + ), ElevatedButton( child: Text(AppLocalizations.of(context).save), onPressed: () async { @@ -315,10 +282,11 @@ class IngredientForm extends StatelessWidget { return; } _form.currentState!.save(); + _mealItem.ingredientId = int.parse(_ingredientIdController.text); try { - Provider.of(context, listen: false) - .logIngredentToDiary(_mealItem, _planId); + Provider.of(context, listen: false).logIngredentToDiary( + _mealItem, _plan.id!, DateTime.parse(_dateController.text)); } on WgerHttpException catch (error) { showHttpExceptionErrorDialog(error, context); } catch (error) { diff --git a/lib/widgets/nutrition/nutritional_plan_detail.dart b/lib/widgets/nutrition/nutritional_plan_detail.dart index 689a673f..bb7043a0 100644 --- a/lib/widgets/nutrition/nutritional_plan_detail.dart +++ b/lib/widgets/nutrition/nutritional_plan_detail.dart @@ -67,22 +67,6 @@ class NutritionalPlanDetailWidget extends StatelessWidget { }, ), ), - Padding( - padding: const EdgeInsets.all(8.0), - child: ElevatedButton( - child: Text(AppLocalizations.of(context).addIngredient), - onPressed: () { - Navigator.pushNamed( - context, - FormScreen.routeName, - arguments: FormScreenArguments( - AppLocalizations.of(context).addIngredient, - IngredientForm(_nutritionalPlan.id!), - ), - ); - }, - ), - ), Container( padding: const EdgeInsets.all(15), height: 220, diff --git a/lib/widgets/nutrition/widgets.dart b/lib/widgets/nutrition/widgets.dart new file mode 100644 index 00000000..5e4fb00e --- /dev/null +++ b/lib/widgets/nutrition/widgets.dart @@ -0,0 +1,74 @@ +/* + * This file is part of wger Workout Manager . + * 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 . + */ + +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_typeahead/flutter_typeahead.dart'; +import 'package:provider/provider.dart'; +import 'package:wger/providers/nutrition.dart'; + +class IngredientTypeahead extends StatefulWidget { + final TextEditingController _ingredientController; + final TextEditingController _ingredientIdController; + + IngredientTypeahead(this._ingredientIdController, this._ingredientController); + + @override + _IngredientTypeaheadState createState() => _IngredientTypeaheadState(); +} + +class _IngredientTypeaheadState extends State { + @override + Widget build(BuildContext context) { + return TypeAheadFormField( + textFieldConfiguration: TextFieldConfiguration( + controller: widget._ingredientController, + decoration: InputDecoration( + labelText: AppLocalizations.of(context).searchIngredient, + suffixIcon: const Icon(Icons.search), + ), + ), + suggestionsCallback: (pattern) async { + return Provider.of(context, listen: false).searchIngredient( + pattern, + Localizations.localeOf(context).languageCode, + ); + }, + itemBuilder: (context, dynamic suggestion) { + return ListTile( + title: Text(suggestion['value']), + subtitle: Text(suggestion['data']['id'].toString()), + ); + }, + transitionBuilder: (context, suggestionsBox, controller) { + return suggestionsBox; + }, + onSuggestionSelected: (dynamic suggestion) { + widget._ingredientIdController.text = suggestion['data']['id'].toString(); + widget._ingredientController.text = suggestion['value']; + }, + validator: (value) { + if (value!.isEmpty) { + return AppLocalizations.of(context).selectIngredient; + } + return null; + }, + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index d957b2c6..ed2de5b6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -692,7 +692,7 @@ packages: name: rive url: "https://pub.dartlang.org" source: hosted - version: "0.7.28" + version: "0.7.33" shared_preferences: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index b97a1891..ac73cd78 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -47,7 +47,7 @@ dependencies: version: ^2.0.0 package_info: ^2.0.2 provider: ^5.0.0 - rive: 0.7.28 + rive: ^0.7.33 shared_preferences: ^2.0.7 table_calendar: ^3.0.2 url_launcher: ^6.0.10 From 60273ebdc47335f840e94115d04c8c19692b226b Mon Sep 17 00:00:00 2001 From: Github-actions Date: Wed, 3 Nov 2021 18:43:02 +0000 Subject: [PATCH 03/49] Automatic linting --- pubspec.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index ed2de5b6..f333a21c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -14,7 +14,7 @@ packages: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "1.7.1" + version: "1.7.2" android_metadata: dependency: "direct main" description: @@ -42,7 +42,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.8.1" boolean_selector: dependency: transitive description: @@ -133,7 +133,7 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" charts_common: dependency: transitive description: @@ -524,7 +524,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.7.0" mime: dependency: transitive description: @@ -823,7 +823,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.4.2" timing: dependency: transitive description: From 3735d8d59d29422f5400b71422c4e580385a17f9 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Wed, 3 Nov 2021 19:49:11 +0100 Subject: [PATCH 04/49] Update to flutter 2.5 --- .github/workflows/android-release.yml | 2 +- README.md | 2 +- pubspec.lock | 72 +++++++++++++++++++-------- pubspec.yaml | 2 +- 4 files changed, 53 insertions(+), 25 deletions(-) diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index de6a948b..9ed81aa9 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -32,7 +32,7 @@ jobs: uses: subosito/flutter-action@v1 with: channel: 'stable' - flutter-version: '2.2.x' + flutter-version: '2.5.x' - run: dart --version - run: flutter --version diff --git a/README.md b/README.md index 5711fedb..f0d2ff5f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Alternatively, you can use one of our test servers, just ask us for access. Install Flutter, all its dependencies and create a new virtual device: . -The app currently uses flutter 2.2 +The app currently uses flutter 2.5 ### 3 Create a new file ``wger.properties`` in ``android/fastlane/envfiles``: diff --git a/pubspec.lock b/pubspec.lock index f333a21c..f83d717e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -56,7 +56,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" build_config: dependency: transitive description: @@ -70,7 +70,7 @@ packages: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" build_resolvers: dependency: transitive description: @@ -84,14 +84,14 @@ packages: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.4" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "7.2.2" built_collection: dependency: transitive description: @@ -112,7 +112,7 @@ packages: name: camera url: "https://pub.dartlang.org" source: hosted - version: "0.9.2+2" + version: "0.9.4+3" camera_platform_interface: dependency: transitive description: @@ -120,6 +120,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.1" + camera_web: + dependency: transitive + description: + name: camera_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+1" characters: dependency: transitive description: @@ -140,14 +147,14 @@ packages: name: charts_common url: "https://pub.dartlang.org" source: hosted - version: "0.11.0" + version: "0.12.0" charts_flutter: dependency: "direct main" description: name: charts_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.11.0" + version: "0.12.0" checked_yaml: dependency: transitive description: @@ -398,7 +405,7 @@ packages: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" graphs: dependency: transitive description: @@ -419,7 +426,7 @@ packages: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.13.3" + version: "0.13.4" http_multi_server: dependency: transitive description: @@ -447,7 +454,7 @@ packages: name: image_picker url: "https://pub.dartlang.org" source: hosted - version: "0.8.4+1" + version: "0.8.4+4" image_picker_for_web: dependency: transitive description: @@ -489,7 +496,7 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "4.1.0" json_serializable: dependency: "direct dev" description: @@ -629,7 +636,7 @@ packages: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.4.0" platform: dependency: transitive description: @@ -657,7 +664,7 @@ packages: name: process url: "https://pub.dartlang.org" source: hosted - version: "4.2.3" + version: "4.2.4" provider: dependency: "direct main" description: @@ -678,7 +685,7 @@ packages: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" quiver: dependency: transitive description: @@ -699,7 +706,7 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "2.0.8" shared_preferences_linux: dependency: transitive description: @@ -851,7 +858,7 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.10" + version: "6.0.12" url_launcher_linux: dependency: transitive description: @@ -907,7 +914,7 @@ packages: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "2.2.3" + version: "2.2.6" video_player_platform_interface: dependency: transitive description: @@ -963,7 +970,7 @@ packages: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" web_socket_channel: dependency: transitive description: @@ -977,7 +984,28 @@ packages: name: webview_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.0.13" + version: "2.1.2" + webview_flutter_android: + dependency: transitive + description: + name: webview_flutter_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + webview_flutter_platform_interface: + dependency: transitive + description: + name: webview_flutter_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + webview_flutter_wkwebview: + dependency: transitive + description: + name: webview_flutter_wkwebview + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" win32: dependency: transitive description: @@ -998,7 +1026,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.1.2" + version: "5.3.1" yaml: dependency: transitive description: @@ -1007,5 +1035,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.13.0 <3.0.0" - flutter: ">=2.2.0" + dart: ">=2.14.0 <3.0.0" + flutter: ">=2.5.0" diff --git a/pubspec.yaml b/pubspec.yaml index ac73cd78..3b9d3b2f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,7 +33,7 @@ dependencies: android_metadata: ^0.2.1 camera: ^0.9.2+2 - charts_flutter: ^0.11.0 + charts_flutter: ^0.12.0 collection: ^1.15.0-nullsafety.4 cupertino_icons: ^1.0.0 flutter_calendar_carousel: ^2.0.3 From 4c1bcd492875bfd2dfe73a75d230f8e4436b45b2 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Wed, 3 Nov 2021 19:55:15 +0100 Subject: [PATCH 05/49] Fix app bar color --- lib/theme/theme.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/theme/theme.dart b/lib/theme/theme.dart index 3ee49f51..19a9ae72 100644 --- a/lib/theme/theme.dart +++ b/lib/theme/theme.dart @@ -58,8 +58,8 @@ final ThemeData wgerTheme = ThemeData( // Show icons in the system's bar in light colors appBarTheme: const AppBarTheme( - brightness: Brightness.dark, systemOverlayStyle: SystemUiOverlayStyle.dark, + color: wgerPrimaryColor, ), /* From 9d6d3fcc259c145e87bd4c5ec0090cb236de51a3 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Wed, 3 Nov 2021 20:04:19 +0100 Subject: [PATCH 06/49] Add quick link to log to diary on dashboard --- lib/widgets/dashboard/widgets.dart | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/lib/widgets/dashboard/widgets.dart b/lib/widgets/dashboard/widgets.dart index 8b779376..993582a8 100644 --- a/lib/widgets/dashboard/widgets.dart +++ b/lib/widgets/dashboard/widgets.dart @@ -199,14 +199,28 @@ class _DashboardNutritionWidgetState extends State { ), if (_hasContent) Row( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ TextButton( - child: Text(AppLocalizations.of(context).goToDetailPage), - onPressed: () { - Navigator.of(context) - .pushNamed(NutritionalPlanScreen.routeName, arguments: _plan); - }), + child: Text(AppLocalizations.of(context).logIngredient), + onPressed: () { + Navigator.pushNamed( + context, + FormScreen.routeName, + arguments: FormScreenArguments( + AppLocalizations.of(context).logIngredient, + IngredientLogForm(_plan!), + ), + ); + }, + ), + TextButton( + child: Text(AppLocalizations.of(context).goToDetailPage), + onPressed: () { + Navigator.of(context) + .pushNamed(NutritionalPlanScreen.routeName, arguments: _plan); + }, + ), ], ), ], From 23fea5a46a1f5b8b3eb7b1bddeba03f5f831854e Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Wed, 3 Nov 2021 20:29:09 +0100 Subject: [PATCH 07/49] Test the app with flutter 2.5 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c840518..33c08a3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: uses: subosito/flutter-action@v1 with: channel: 'stable' - flutter-version: '2.2.x' + flutter-version: '2.5.x' - run: dart --version - run: flutter --version From 51fe2fcdc1e09470447f6e0be90c9c5d89971169 Mon Sep 17 00:00:00 2001 From: "J. Lavoie" Date: Fri, 5 Nov 2021 21:17:09 +0000 Subject: [PATCH 08/49] Translated using Weblate (French) Currently translated at 100.0% (152 of 152 strings) Translation: wger Workout Manager/Mobile App Translate-URL: https://hosted.weblate.org/projects/wger/mobile/fr/ --- lib/l10n/app_fr.arb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/l10n/app_fr.arb b/lib/l10n/app_fr.arb index 2dc2191e..647a0f75 100644 --- a/lib/l10n/app_fr.arb +++ b/lib/l10n/app_fr.arb @@ -526,5 +526,11 @@ "recentlyUsedIngredients": "Ingrédients récemment ajoutés", "@recentlyUsedIngredients": { "description": "A message when a user adds a new ingredient to a meal." - } + }, + "searchIngredient": "Rechercher un ingrédient", + "@searchIngredient": { + "description": "Label on ingredient search form" + }, + "logIngredient": "Sauvegarder dans le journal nutritionnel", + "@logIngredient": {} } From 942989997376b69fcfcd6b081aa73092b24ab675 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 4 Nov 2021 12:13:30 +0100 Subject: [PATCH 09/49] Organize tests in own folders --- test/{ => auth}/auth_screen_test.dart | 0 test/{ => gallery}/gallery_form_test.dart | 4 ++-- test/{ => gallery}/gallery_screen_test.dart | 4 ++-- test/{ => gallery}/gallery_screen_test.mocks.dart | 0 test/{ => nutrition}/nutritional_diary_test.dart | 2 +- test/{ => nutrition}/nutritional_meal_form_test.dart | 4 ++-- test/{ => nutrition}/nutritional_plan_form_test.dart | 2 +- .../nutritional_plan_form_test.mocks.dart | 0 test/{ => nutrition}/nutritional_plan_model_test.dart | 2 +- test/{ => nutrition}/nutritional_plan_screen_test.dart | 6 +++--- .../{ => nutrition}/nutritional_plans_screen_test.dart | 4 ++-- .../{ => nutrition}/nutritional_values_class_test.dart | 0 test/{ => other}/base_provider_test.dart | 2 +- test/{ => other}/base_provider_test.mocks.dart | 0 test/{ => other}/extensions_test.dart | 0 test/{ => weight}/weight_model_test.dart | 0 test/{ => weight}/weight_provider_test.dart | 4 ++-- test/{ => weight}/weight_screen_test.dart | 6 +++--- test/{ => workout}/gym_mode_screen_test.dart | 6 +++--- test/{ => workout}/plate_calculator_test.dart | 0 test/{ => workout}/set_model_test.dart | 2 +- test/{ => workout}/setting_model_test.dart | 0 test/{ => workout}/workout_day_form_test.dart | 4 ++-- test/{ => workout}/workout_form_test.dart | 2 +- test/{ => workout}/workout_form_test.mocks.dart | 0 test/{ => workout}/workout_log_model_test.dart | 0 test/{ => workout}/workout_plan_model_test.dart | 4 ++-- test/{ => workout}/workout_plan_screen_test.dart | 6 +++--- test/{ => workout}/workout_plans_screen_test.dart | 4 ++-- test/{ => workout}/workout_set_form_test.dart | 10 +++++----- test/{ => workout}/workout_set_form_test.mocks.dart | 0 31 files changed, 39 insertions(+), 39 deletions(-) rename test/{ => auth}/auth_screen_test.dart (100%) rename test/{ => gallery}/gallery_form_test.dart (97%) rename test/{ => gallery}/gallery_screen_test.dart (97%) rename test/{ => gallery}/gallery_screen_test.mocks.dart (100%) rename test/{ => nutrition}/nutritional_diary_test.dart (98%) rename test/{ => nutrition}/nutritional_meal_form_test.dart (97%) rename test/{ => nutrition}/nutritional_plan_form_test.dart (98%) rename test/{ => nutrition}/nutritional_plan_form_test.mocks.dart (100%) rename test/{ => nutrition}/nutritional_plan_model_test.dart (97%) rename test/{ => nutrition}/nutritional_plan_screen_test.dart (96%) rename test/{ => nutrition}/nutritional_plans_screen_test.dart (98%) rename test/{ => nutrition}/nutritional_values_class_test.dart (100%) rename test/{ => other}/base_provider_test.dart (98%) rename test/{ => other}/base_provider_test.mocks.dart (100%) rename test/{ => other}/extensions_test.dart (100%) rename test/{ => weight}/weight_model_test.dart (100%) rename test/{ => weight}/weight_provider_test.dart (98%) rename test/{ => weight}/weight_screen_test.dart (97%) rename test/{ => workout}/gym_mode_screen_test.dart (98%) rename test/{ => workout}/plate_calculator_test.dart (100%) rename test/{ => workout}/set_model_test.dart (96%) rename test/{ => workout}/setting_model_test.dart (100%) rename test/{ => workout}/workout_day_form_test.dart (97%) rename test/{ => workout}/workout_form_test.dart (99%) rename test/{ => workout}/workout_form_test.mocks.dart (100%) rename test/{ => workout}/workout_log_model_test.dart (100%) rename test/{ => workout}/workout_plan_model_test.dart (94%) rename test/{ => workout}/workout_plan_screen_test.dart (96%) rename test/{ => workout}/workout_plans_screen_test.dart (98%) rename test/{ => workout}/workout_set_form_test.dart (95%) rename test/{ => workout}/workout_set_form_test.mocks.dart (100%) diff --git a/test/auth_screen_test.dart b/test/auth/auth_screen_test.dart similarity index 100% rename from test/auth_screen_test.dart rename to test/auth/auth_screen_test.dart diff --git a/test/gallery_form_test.dart b/test/gallery/gallery_form_test.dart similarity index 97% rename from test/gallery_form_test.dart rename to test/gallery/gallery_form_test.dart index 690e2cea..259c2a7d 100644 --- a/test/gallery_form_test.dart +++ b/test/gallery/gallery_form_test.dart @@ -27,8 +27,8 @@ import 'package:wger/models/gallery/image.dart' as gallery; import 'package:wger/providers/gallery.dart'; import 'package:wger/widgets/gallery/forms.dart'; -import '../test_data/gallery.dart'; -import 'gallery_screen_test.mocks.dart'; +import './gallery_screen_test.mocks.dart'; +import '../../test_data/gallery.dart'; void main() { late gallery.Image image; diff --git a/test/gallery_screen_test.dart b/test/gallery/gallery_screen_test.dart similarity index 97% rename from test/gallery_screen_test.dart rename to test/gallery/gallery_screen_test.dart index 8507048e..f75f4705 100644 --- a/test/gallery_screen_test.dart +++ b/test/gallery/gallery_screen_test.dart @@ -27,8 +27,8 @@ import 'package:wger/providers/gallery.dart'; import 'package:wger/screens/form_screen.dart'; import 'package:wger/widgets/gallery/overview.dart'; -import '../test_data/gallery.dart'; -import 'gallery_screen_test.mocks.dart'; +import './gallery_screen_test.mocks.dart'; +import '../../test_data/gallery.dart'; @GenerateMocks([GalleryProvider]) void main() { diff --git a/test/gallery_screen_test.mocks.dart b/test/gallery/gallery_screen_test.mocks.dart similarity index 100% rename from test/gallery_screen_test.mocks.dart rename to test/gallery/gallery_screen_test.mocks.dart diff --git a/test/nutritional_diary_test.dart b/test/nutrition/nutritional_diary_test.dart similarity index 98% rename from test/nutritional_diary_test.dart rename to test/nutrition/nutritional_diary_test.dart index 55cb637c..d65029a7 100644 --- a/test/nutritional_diary_test.dart +++ b/test/nutrition/nutritional_diary_test.dart @@ -22,7 +22,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:wger/widgets/nutrition/charts.dart'; import 'package:wger/widgets/nutrition/nutritional_diary_detail.dart'; -import '../test_data/nutritional_plans.dart'; +import '../../test_data/nutritional_plans.dart'; void main() { Widget getWidget({locale = 'en'}) { diff --git a/test/nutritional_meal_form_test.dart b/test/nutrition/nutritional_meal_form_test.dart similarity index 97% rename from test/nutritional_meal_form_test.dart rename to test/nutrition/nutritional_meal_form_test.dart index 0075503d..d3a34666 100644 --- a/test/nutritional_meal_form_test.dart +++ b/test/nutrition/nutritional_meal_form_test.dart @@ -29,8 +29,8 @@ import 'package:wger/providers/nutrition.dart'; import 'package:wger/screens/nutritional_plan_screen.dart'; import 'package:wger/widgets/nutrition/forms.dart'; -import '../test_data/nutritional_plans.dart'; -import 'nutritional_plan_form_test.mocks.dart'; +import './nutritional_plan_form_test.mocks.dart'; +import '../../test_data/nutritional_plans.dart'; void main() { var mockNutrition = MockNutritionPlansProvider(); diff --git a/test/nutritional_plan_form_test.dart b/test/nutrition/nutritional_plan_form_test.dart similarity index 98% rename from test/nutritional_plan_form_test.dart rename to test/nutrition/nutritional_plan_form_test.dart index 6cb45705..059f1637 100644 --- a/test/nutritional_plan_form_test.dart +++ b/test/nutrition/nutritional_plan_form_test.dart @@ -28,7 +28,7 @@ import 'package:wger/providers/nutrition.dart'; import 'package:wger/screens/nutritional_plan_screen.dart'; import 'package:wger/widgets/nutrition/forms.dart'; -import 'nutritional_plan_form_test.mocks.dart'; +import './nutritional_plan_form_test.mocks.dart'; @GenerateMocks([NutritionPlansProvider]) void main() { diff --git a/test/nutritional_plan_form_test.mocks.dart b/test/nutrition/nutritional_plan_form_test.mocks.dart similarity index 100% rename from test/nutritional_plan_form_test.mocks.dart rename to test/nutrition/nutritional_plan_form_test.mocks.dart diff --git a/test/nutritional_plan_model_test.dart b/test/nutrition/nutritional_plan_model_test.dart similarity index 97% rename from test/nutritional_plan_model_test.dart rename to test/nutrition/nutritional_plan_model_test.dart index e2e12746..8eb86cc5 100644 --- a/test/nutritional_plan_model_test.dart +++ b/test/nutrition/nutritional_plan_model_test.dart @@ -20,7 +20,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:wger/models/nutrition/nutritional_plan.dart'; import 'package:wger/models/nutrition/nutritional_values.dart'; -import '../test_data/nutritional_plans.dart'; +import '../../test_data/nutritional_plans.dart'; void main() { late NutritionalPlan plan; diff --git a/test/nutritional_plan_screen_test.dart b/test/nutrition/nutritional_plan_screen_test.dart similarity index 96% rename from test/nutritional_plan_screen_test.dart rename to test/nutrition/nutritional_plan_screen_test.dart index 98bb314e..796f11af 100644 --- a/test/nutritional_plan_screen_test.dart +++ b/test/nutrition/nutritional_plan_screen_test.dart @@ -25,9 +25,9 @@ import 'package:wger/providers/nutrition.dart'; import 'package:wger/screens/nutritional_plan_screen.dart'; import 'package:wger/widgets/nutrition/charts.dart'; -import '../test_data/nutritional_plans.dart'; -import 'base_provider_test.mocks.dart'; -import 'utils.dart'; +import '../../test_data/nutritional_plans.dart'; +import '../other/base_provider_test.mocks.dart'; +import '../utils.dart'; void main() { Widget createNutritionalPlan({locale = 'en'}) { diff --git a/test/nutritional_plans_screen_test.dart b/test/nutrition/nutritional_plans_screen_test.dart similarity index 98% rename from test/nutritional_plans_screen_test.dart rename to test/nutrition/nutritional_plans_screen_test.dart index abd62d50..0b0bbb24 100644 --- a/test/nutritional_plans_screen_test.dart +++ b/test/nutrition/nutritional_plans_screen_test.dart @@ -28,8 +28,8 @@ import 'package:wger/screens/form_screen.dart'; import 'package:wger/screens/nutritional_plans_screen.dart'; import 'package:wger/widgets/nutrition/forms.dart'; -import 'base_provider_test.mocks.dart'; -import 'utils.dart'; +import '../other/base_provider_test.mocks.dart'; +import '../utils.dart'; void main() { Widget createHomeScreen({locale = 'en'}) { diff --git a/test/nutritional_values_class_test.dart b/test/nutrition/nutritional_values_class_test.dart similarity index 100% rename from test/nutritional_values_class_test.dart rename to test/nutrition/nutritional_values_class_test.dart diff --git a/test/base_provider_test.dart b/test/other/base_provider_test.dart similarity index 98% rename from test/base_provider_test.dart rename to test/other/base_provider_test.dart index bfec04ae..2f6cbdf1 100644 --- a/test/base_provider_test.dart +++ b/test/other/base_provider_test.dart @@ -21,7 +21,7 @@ import 'package:http/http.dart' as http; import 'package:mockito/annotations.dart'; import 'package:wger/providers/base_provider.dart'; -import 'utils.dart'; +import '../utils.dart'; @GenerateMocks([http.Client]) void main() { diff --git a/test/base_provider_test.mocks.dart b/test/other/base_provider_test.mocks.dart similarity index 100% rename from test/base_provider_test.mocks.dart rename to test/other/base_provider_test.mocks.dart diff --git a/test/extensions_test.dart b/test/other/extensions_test.dart similarity index 100% rename from test/extensions_test.dart rename to test/other/extensions_test.dart diff --git a/test/weight_model_test.dart b/test/weight/weight_model_test.dart similarity index 100% rename from test/weight_model_test.dart rename to test/weight/weight_model_test.dart diff --git a/test/weight_provider_test.dart b/test/weight/weight_provider_test.dart similarity index 98% rename from test/weight_provider_test.dart rename to test/weight/weight_provider_test.dart index 7f9c1106..f120b15a 100644 --- a/test/weight_provider_test.dart +++ b/test/weight/weight_provider_test.dart @@ -22,8 +22,8 @@ import 'package:mockito/mockito.dart'; import 'package:wger/models/body_weight/weight_entry.dart'; import 'package:wger/providers/body_weight.dart'; -import 'base_provider_test.mocks.dart'; -import 'utils.dart'; +import '../other/base_provider_test.mocks.dart'; +import '../utils.dart'; void main() { group('test body weight provider', () { diff --git a/test/weight_screen_test.dart b/test/weight/weight_screen_test.dart similarity index 97% rename from test/weight_screen_test.dart rename to test/weight/weight_screen_test.dart index d551227a..d0db6acd 100644 --- a/test/weight_screen_test.dart +++ b/test/weight/weight_screen_test.dart @@ -28,9 +28,9 @@ import 'package:wger/screens/weight_screen.dart'; import 'package:wger/widgets/core/charts.dart'; import 'package:wger/widgets/weight/forms.dart'; -import '../test_data/body_weight.dart'; -import 'base_provider_test.mocks.dart'; -import 'utils.dart'; +import '../../test_data/body_weight.dart'; +import '../other/base_provider_test.mocks.dart'; +import '../utils.dart'; void main() { Widget createHomeScreen({locale = 'en'}) { diff --git a/test/gym_mode_screen_test.dart b/test/workout/gym_mode_screen_test.dart similarity index 98% rename from test/gym_mode_screen_test.dart rename to test/workout/gym_mode_screen_test.dart index 685f501b..95e5a3dc 100644 --- a/test/gym_mode_screen_test.dart +++ b/test/workout/gym_mode_screen_test.dart @@ -27,9 +27,9 @@ import 'package:wger/screens/workout_plan_screen.dart'; import 'package:wger/widgets/workouts/forms.dart'; import 'package:wger/widgets/workouts/gym_mode.dart'; -import '../test_data/workouts.dart'; -import 'base_provider_test.mocks.dart'; -import 'utils.dart'; +import '../../test_data/workouts.dart'; +import '../other/base_provider_test.mocks.dart'; +import '../utils.dart'; void main() { Widget createHomeScreen({locale = 'en'}) { diff --git a/test/plate_calculator_test.dart b/test/workout/plate_calculator_test.dart similarity index 100% rename from test/plate_calculator_test.dart rename to test/workout/plate_calculator_test.dart diff --git a/test/set_model_test.dart b/test/workout/set_model_test.dart similarity index 96% rename from test/set_model_test.dart rename to test/workout/set_model_test.dart index 60f1bdae..c92a9137 100644 --- a/test/set_model_test.dart +++ b/test/workout/set_model_test.dart @@ -18,7 +18,7 @@ import 'package:flutter_test/flutter_test.dart'; -import '../test_data/workouts.dart'; +import '../../test_data/workouts.dart'; void main() { group('Test the getSmartTextRepr method for a set', () { diff --git a/test/setting_model_test.dart b/test/workout/setting_model_test.dart similarity index 100% rename from test/setting_model_test.dart rename to test/workout/setting_model_test.dart diff --git a/test/workout_day_form_test.dart b/test/workout/workout_day_form_test.dart similarity index 97% rename from test/workout_day_form_test.dart rename to test/workout/workout_day_form_test.dart index a06cab56..3da79efa 100644 --- a/test/workout_day_form_test.dart +++ b/test/workout/workout_day_form_test.dart @@ -27,8 +27,8 @@ import 'package:wger/models/workouts/workout_plan.dart'; import 'package:wger/providers/workout_plans.dart'; import 'package:wger/widgets/workouts/forms.dart'; -import '../test_data/workouts.dart'; -import 'workout_form_test.mocks.dart'; +import './workout_form_test.mocks.dart'; +import '../../test_data/workouts.dart'; void main() { var mockWorkoutPlans = MockWorkoutPlansProvider(); diff --git a/test/workout_form_test.dart b/test/workout/workout_form_test.dart similarity index 99% rename from test/workout_form_test.dart rename to test/workout/workout_form_test.dart index fae44db8..44f72b28 100644 --- a/test/workout_form_test.dart +++ b/test/workout/workout_form_test.dart @@ -28,7 +28,7 @@ import 'package:wger/providers/workout_plans.dart'; import 'package:wger/screens/workout_plan_screen.dart'; import 'package:wger/widgets/workouts/forms.dart'; -import 'workout_form_test.mocks.dart'; +import './workout_form_test.mocks.dart'; @GenerateMocks([WorkoutPlansProvider]) void main() { diff --git a/test/workout_form_test.mocks.dart b/test/workout/workout_form_test.mocks.dart similarity index 100% rename from test/workout_form_test.mocks.dart rename to test/workout/workout_form_test.mocks.dart diff --git a/test/workout_log_model_test.dart b/test/workout/workout_log_model_test.dart similarity index 100% rename from test/workout_log_model_test.dart rename to test/workout/workout_log_model_test.dart diff --git a/test/workout_plan_model_test.dart b/test/workout/workout_plan_model_test.dart similarity index 94% rename from test/workout_plan_model_test.dart rename to test/workout/workout_plan_model_test.dart index b0250774..574820d4 100644 --- a/test/workout_plan_model_test.dart +++ b/test/workout/workout_plan_model_test.dart @@ -18,8 +18,8 @@ import 'package:flutter_test/flutter_test.dart'; -import '../test_data/exercises.dart'; -import '../test_data/workouts.dart'; +import '../../test_data/exercises.dart'; +import '../../test_data/workouts.dart'; void main() { group('model tests', () { diff --git a/test/workout_plan_screen_test.dart b/test/workout/workout_plan_screen_test.dart similarity index 96% rename from test/workout_plan_screen_test.dart rename to test/workout/workout_plan_screen_test.dart index a2d98e63..7f909d98 100644 --- a/test/workout_plan_screen_test.dart +++ b/test/workout/workout_plan_screen_test.dart @@ -23,9 +23,9 @@ import 'package:provider/provider.dart'; import 'package:wger/providers/workout_plans.dart'; import 'package:wger/screens/workout_plan_screen.dart'; -import '../test_data/workouts.dart'; -import 'base_provider_test.mocks.dart'; -import 'utils.dart'; +import '../../test_data/workouts.dart'; +import '../other/base_provider_test.mocks.dart'; +import '../utils.dart'; void main() { Widget createHomeScreen({locale = 'en'}) { diff --git a/test/workout_plans_screen_test.dart b/test/workout/workout_plans_screen_test.dart similarity index 98% rename from test/workout_plans_screen_test.dart rename to test/workout/workout_plans_screen_test.dart index fe387318..eddc25bc 100644 --- a/test/workout_plans_screen_test.dart +++ b/test/workout/workout_plans_screen_test.dart @@ -29,8 +29,8 @@ import 'package:wger/screens/workout_plans_screen.dart'; import 'package:wger/widgets/nutrition/forms.dart'; import 'package:wger/widgets/workouts/forms.dart'; -import 'base_provider_test.mocks.dart'; -import 'utils.dart'; +import '../other/base_provider_test.mocks.dart'; +import '../utils.dart'; void main() { Widget createHomeScreen({locale = 'en'}) { diff --git a/test/workout_set_form_test.dart b/test/workout/workout_set_form_test.dart similarity index 95% rename from test/workout_set_form_test.dart rename to test/workout/workout_set_form_test.dart index cbab5c10..67d605a7 100644 --- a/test/workout_set_form_test.dart +++ b/test/workout/workout_set_form_test.dart @@ -32,11 +32,11 @@ import 'package:wger/providers/exercises.dart'; import 'package:wger/providers/workout_plans.dart'; import 'package:wger/widgets/workouts/forms.dart'; -import '../test_data/workouts.dart'; -import 'base_provider_test.mocks.dart'; -import 'utils.dart'; -import 'workout_form_test.mocks.dart'; -import 'workout_set_form_test.mocks.dart'; +import './workout_form_test.mocks.dart'; +import './workout_set_form_test.mocks.dart'; +import '../../test_data/workouts.dart'; +import '../other/base_provider_test.mocks.dart'; +import '../utils.dart'; @GenerateMocks([ExercisesProvider]) void main() { diff --git a/test/workout_set_form_test.mocks.dart b/test/workout/workout_set_form_test.mocks.dart similarity index 100% rename from test/workout_set_form_test.mocks.dart rename to test/workout/workout_set_form_test.mocks.dart From 498a43f292a73c752603ca355a03d3718b86c191 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 4 Nov 2021 22:04:47 +0100 Subject: [PATCH 10/49] Test min application version check in auth provider --- lib/helpers/consts.dart | 2 +- lib/main.dart | 2 +- lib/providers/auth.dart | 29 ++++++++++----- test/auth/auth_provider_test.dart | 62 +++++++++++++++++++++++++++++++ test/utils.dart | 3 +- 5 files changed, 85 insertions(+), 13 deletions(-) create mode 100644 test/auth/auth_provider_test.dart diff --git a/lib/helpers/consts.dart b/lib/helpers/consts.dart index a37ab849..dc094d27 100644 --- a/lib/helpers/consts.dart +++ b/lib/helpers/consts.dart @@ -72,4 +72,4 @@ const ENERGY_CARBOHYDRATES = 4; const ENERGY_FAT = 9; /// Flag to check for updates to the new version. -const ENABLED_UPDATE = false; +const CHECK_APP_MIN_VERSION = false; diff --git a/lib/main.dart b/lib/main.dart index c58abe57..479f8098 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -105,7 +105,7 @@ class MyApp extends StatelessWidget { theme: wgerTheme, home: auth.isAuth ? FutureBuilder( - future: auth.neededApplicationUpdate(), + future: auth.applicationUpdateRequired(), builder: (ctx, snapshot) => snapshot.connectionState == ConnectionState.done && snapshot.data == true ? UpdateAppScreen() diff --git a/lib/providers/auth.dart b/lib/providers/auth.dart index 45c12cf0..5f96ba7a 100644 --- a/lib/providers/auth.dart +++ b/lib/providers/auth.dart @@ -40,6 +40,12 @@ class AuthProvider with ChangeNotifier { String? serverVersion; PackageInfo? applicationVersion; + late http.Client client; + + AuthProvider([http.Client? client]) { + this.client = client ?? http.Client(); + } + /// flag to indicate that the application has successfully loaded all initial data bool dataInit = false; @@ -66,7 +72,7 @@ class AuthProvider with ChangeNotifier { /// Server application version Future setServerVersion() async { - final response = await http.get(makeUri(serverUrl!, 'version')); + final response = await client.get(makeUri(serverUrl!, 'version')); final responseData = json.decode(response.body); serverVersion = responseData; } @@ -78,15 +84,18 @@ class AuthProvider with ChangeNotifier { } /// Checking if there is a new version of the application. - Future neededApplicationUpdate() async { - if (!ENABLED_UPDATE) { + Future applicationUpdateRequired([String? version]) async { + if (!CHECK_APP_MIN_VERSION) { return false; } - final response = await http.get(makeUri(serverUrl!, 'min-app-version')); - final applicationLatestVersion = json.decode(response.body); - final currentVersion = Version.parse(applicationVersion!.version); - final latestAppVersion = Version.parse(applicationLatestVersion); - return latestAppVersion > currentVersion; + + final applicationCurrentVersion = version ?? applicationVersion!.version; + + final response = await client.get(makeUri(serverUrl!, 'min-app-version')); + final currentVersion = Version.parse(applicationCurrentVersion); + + final requiredAppVersion = Version.parse(response.body); + return requiredAppVersion >= currentVersion; } /// Registers a new user @@ -111,7 +120,7 @@ class AuthProvider with ChangeNotifier { if (email != '') { data['email'] = email; } - final response = await http.post( + final response = await client.post( uri, headers: { HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8', @@ -137,7 +146,7 @@ class AuthProvider with ChangeNotifier { await logout(shouldNotify: false); try { - final response = await http.post( + final response = await client.post( uri, headers: { HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8', diff --git a/test/auth/auth_provider_test.dart b/test/auth/auth_provider_test.dart new file mode 100644 index 00000000..8af65057 --- /dev/null +++ b/test/auth/auth_provider_test.dart @@ -0,0 +1,62 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:http/http.dart'; +import 'package:mockito/mockito.dart'; +import 'package:wger/providers/auth.dart'; + +import '../other/base_provider_test.mocks.dart'; + +void main() { + late AuthProvider authProvider; + late MockClient mockClient; + + final Uri tVersionUri = Uri( + scheme: 'http', + host: 'localhost', + path: 'api/v2/min-app-version/', + ); + + setUp(() { + mockClient = MockClient(); + authProvider = AuthProvider(mockClient); + authProvider.serverUrl = 'http://localhost'; + }); + + group('min application version check', () { + test('app version higher than min version', () async { + // arrange + + when(mockClient.get(tVersionUri)).thenAnswer((_) => Future(() => Response('1.2.0', 200))); + final updateNeeded = await authProvider.applicationUpdateRequired('1.3.0'); + + // assert + expect(updateNeeded, false); + }); + + test('app version higher than min version', () async { + // arrange + when(mockClient.get(tVersionUri)).thenAnswer((_) => Future(() => Response('1.3', 200))); + final updateNeeded = await authProvider.applicationUpdateRequired('1.1'); + + // assert + expect(updateNeeded, true); + }); + + test('app version higher than min version', () async { + // arrange + when(mockClient.get(tVersionUri)).thenAnswer((_) => Future(() => Response('1.3.0', 200))); + final updateNeeded = await authProvider.applicationUpdateRequired('1.1'); + + // assert + expect(updateNeeded, true); + }); + + test('app version equal as min version', () async { + // arrange + when(mockClient.get(tVersionUri)).thenAnswer((_) => Future(() => Response('1.3.0', 200))); + final updateNeeded = await authProvider.applicationUpdateRequired('1.3.0'); + + // assert + expect(updateNeeded, true); //!!! + }); + }); +} diff --git a/test/utils.dart b/test/utils.dart index 7a612cef..59be586a 100644 --- a/test/utils.dart +++ b/test/utils.dart @@ -20,9 +20,10 @@ import 'package:wger/providers/auth.dart'; import 'package:wger/providers/exercises.dart'; import '../test_data/exercises.dart'; +import 'other/base_provider_test.mocks.dart'; // Test Auth provider -final AuthProvider testAuthProvider = AuthProvider() +final AuthProvider testAuthProvider = AuthProvider(MockClient()) ..token = 'FooBar' ..serverUrl = 'https://localhost'; From 03f7e1e3711b27674be82f825e26964deb901416 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 4 Nov 2021 22:06:03 +0100 Subject: [PATCH 11/49] Remove linting errors --- lib/helpers/gym_mode.dart | 1 - lib/helpers/misc.dart | 2 +- lib/providers/nutrition.dart | 2 +- lib/screens/home_tabs_screen.dart | 4 ++-- lib/widgets/nutrition/widgets.dart | 2 +- lib/widgets/workouts/log.dart | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/helpers/gym_mode.dart b/lib/helpers/gym_mode.dart index dd15611a..ffad3e26 100644 --- a/lib/helpers/gym_mode.dart +++ b/lib/helpers/gym_mode.dart @@ -19,7 +19,6 @@ /// Calculates the number of plates needed to reach a specific weight List plateCalculator(num totalWeight, num barWeight, List plates) { final List ans = []; - final platesCount = plates.length; // Weight is less than the bar if (totalWeight < barWeight) { diff --git a/lib/helpers/misc.dart b/lib/helpers/misc.dart index 01261914..05e5d693 100644 --- a/lib/helpers/misc.dart +++ b/lib/helpers/misc.dart @@ -96,6 +96,6 @@ void launchURL(String url, BuildContext context) async { await canLaunch(url) ? await launch(url) : ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text("Could not open $url.")), + SnackBar(content: Text('Could not open $url.')), ); } diff --git a/lib/providers/nutrition.dart b/lib/providers/nutrition.dart index a7228134..5fcc9d62 100644 --- a/lib/providers/nutrition.dart +++ b/lib/providers/nutrition.dart @@ -330,7 +330,7 @@ class NutritionPlansProvider extends WgerBaseProvider with ChangeNotifier { Future logMealToDiary(Meal meal) async { for (final item in meal.mealItems) { final plan = findById(meal.planId); - final Log log = Log.fromMealItem(item, plan.id!, meal.id!); + final Log log = Log.fromMealItem(item, plan.id!, meal.id); final data = await post(log.toJson(), makeUrl(_nutritionDiaryPath)); log.id = data['id']; diff --git a/lib/screens/home_tabs_screen.dart b/lib/screens/home_tabs_screen.dart index e3c6f1b1..6621e4f9 100644 --- a/lib/screens/home_tabs_screen.dart +++ b/lib/screens/home_tabs_screen.dart @@ -129,12 +129,12 @@ class _HomeTabsScreenState extends State with SingleTickerProvid child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Center( + const Center( child: SizedBox( height: 70, child: RiveAnimation.asset( 'assets/animations/wger_logo.riv', - animations: const ['idle_loop2'], + animations: ['idle_loop2'], ), ), ), diff --git a/lib/widgets/nutrition/widgets.dart b/lib/widgets/nutrition/widgets.dart index 5e4fb00e..6438ce30 100644 --- a/lib/widgets/nutrition/widgets.dart +++ b/lib/widgets/nutrition/widgets.dart @@ -27,7 +27,7 @@ class IngredientTypeahead extends StatefulWidget { final TextEditingController _ingredientController; final TextEditingController _ingredientIdController; - IngredientTypeahead(this._ingredientIdController, this._ingredientController); + const IngredientTypeahead(this._ingredientIdController, this._ingredientController); @override _IngredientTypeaheadState createState() => _IngredientTypeaheadState(); diff --git a/lib/widgets/workouts/log.dart b/lib/widgets/workouts/log.dart index cb245adb..15f7e809 100644 --- a/lib/widgets/workouts/log.dart +++ b/lib/widgets/workouts/log.dart @@ -98,7 +98,7 @@ class _DayLogWidgetState extends State { children: [ Text(log.singleLogRepTextNoNl), IconButton( - icon: Icon(Icons.delete), + icon: const Icon(Icons.delete), onPressed: () async { showDeleteDialog( context, exercise.name, log, exercise, widget._exerciseData); From cf882c194f208c4f4f867f082d374b93cbe8dd85 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Mon, 8 Nov 2021 09:42:24 +0100 Subject: [PATCH 12/49] Move flag checking for minimum required version to manifest This is still not the best solution, ideally we would save this to some kind of configuration file that we can use for dev/prod etc. Also, this solution doesn't work with iOS or web --- android/app/src/main/AndroidManifest.xml | 1 + lib/helpers/consts.dart | 7 ++++--- lib/providers/auth.dart | 20 ++++++++++---------- lib/screens/auth_screen.dart | 10 ++++------ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 9a8d34ed..3438b858 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -26,6 +26,7 @@ android:icon="@mipmap/ic_launcher"> + ? metadata = {}; late http.Client client; AuthProvider([http.Client? client]) { this.client = client ?? http.Client(); + + try { + AndroidMetadata.metaDataAsMap.then((value) => metadata = value); + } on PlatformException { + throw Exception('An error occurred reading the metadata from AndroidManifest'); + } } /// flag to indicate that the application has successfully loaded all initial data @@ -85,7 +92,8 @@ class AuthProvider with ChangeNotifier { /// Checking if there is a new version of the application. Future applicationUpdateRequired([String? version]) async { - if (!CHECK_APP_MIN_VERSION) { + if (metadata!.containsKey('wger.check_min_app_version') || + metadata!['wger.check_min_app_version'] == 'false') { return false; } @@ -105,14 +113,6 @@ class AuthProvider with ChangeNotifier { required String email, required String serverUrl}) async { final uri = Uri.parse('$serverUrl/api/v2/register/'); - Map? metadata = {}; - - // Read the api key from the manifest file - try { - metadata = await AndroidMetadata.metaDataAsMap; - } on PlatformException { - throw Exception('An error occurred reading the API key'); - } // Register try { @@ -124,7 +124,7 @@ class AuthProvider with ChangeNotifier { uri, headers: { HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8', - HttpHeaders.authorizationHeader: "Token ${metadata!['wger.api_key']}" + HttpHeaders.authorizationHeader: 'Token ${metadata![MANIFEST_KEY_API]}' }, body: json.encode(data), ); diff --git a/lib/screens/auth_screen.dart b/lib/screens/auth_screen.dart index 39c7d5d3..b4edb819 100644 --- a/lib/screens/auth_screen.dart +++ b/lib/screens/auth_screen.dart @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import 'package:android_metadata/android_metadata.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -119,11 +118,10 @@ class _AuthCardState extends State { // // If not, the user will not be able to register via the app try { - AndroidMetadata.metaDataAsMap.then((data) { - if (!data!.containsKey('wger.api_key') || data['wger.api_key'] == '') { - _canRegister = false; - } - }); + final metadata = Provider.of(context, listen: false).metadata; + if (metadata!.containsKey(MANIFEST_KEY_API) || metadata[MANIFEST_KEY_API] == '') { + _canRegister = false; + } } on PlatformException { _canRegister = false; } From 909349ce909a87e650bb12f49cd7887ef2f810fe Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Mon, 8 Nov 2021 09:44:22 +0100 Subject: [PATCH 13/49] Remove unsed code in auth provider --- lib/providers/auth.dart | 46 ----------------------------------------- 1 file changed, 46 deletions(-) diff --git a/lib/providers/auth.dart b/lib/providers/auth.dart index dbc7475d..b4781a76 100644 --- a/lib/providers/auth.dart +++ b/lib/providers/auth.dart @@ -56,27 +56,10 @@ class AuthProvider with ChangeNotifier { /// flag to indicate that the application has successfully loaded all initial data bool dataInit = false; - // DateTime _expiryDate; - // String _userId; - // Timer _authTimer; - bool get isAuth { return token != null; } - String? get token2 { - // if (_expiryDate != null && - // _expiryDate.isAfter(DateTime.now()) && - // _token != null) { - return token; - // } - // return null; - } - - // String get userId { - // return _userId; - // } - /// Server application version Future setServerVersion() async { final response = await client.get(makeUri(serverUrl!, 'version')); @@ -163,13 +146,6 @@ class AuthProvider with ChangeNotifier { this.serverUrl = serverUrl; token = responseData['token']; - // _userId = responseData['localId']; - // _expiryDate = DateTime.now().add( - // Duration( - // seconds: int.parse(responseData['expiresIn']), - // ), - // ); - notifyListeners(); // store login data in shared preferences @@ -177,7 +153,6 @@ class AuthProvider with ChangeNotifier { final userData = json.encode({ 'token': token, 'serverUrl': this.serverUrl, - // 'expiryDate': _expiryDate.toIso8601String(), }); final serverData = json.encode({ 'serverUrl': this.serverUrl, @@ -210,16 +185,9 @@ class AuthProvider with ChangeNotifier { return false; } final extractedUserData = json.decode(prefs.getString('userData')!); - // final expiryDate = DateTime.parse(extractedUserData['expiryDate']); - - // if (expiryDate.isBefore(DateTime.now())) { - // return false; - // } token = extractedUserData['token']; serverUrl = extractedUserData['serverUrl']; - // _userId = extractedUserData['userId']; - // _expiryDate = expiryDate; log('autologin successful'); setApplicationVersion(); @@ -234,12 +202,6 @@ class AuthProvider with ChangeNotifier { token = null; serverUrl = null; dataInit = false; - // _userId = null; - // _expiryDate = null; - // if (_authTimer != null) { - // _authTimer.cancel(); - // _authTimer = null; - // } if (shouldNotify) { notifyListeners(); @@ -249,14 +211,6 @@ class AuthProvider with ChangeNotifier { prefs.remove('userData'); } - // void _autoLogout() { - // if (_authTimer != null) { - // _authTimer.cancel(); - // } - // final timeToExpiry = _expiryDate.difference(DateTime.now()).inSeconds; - // _authTimer = Timer(Duration(seconds: timeToExpiry), logout); - // } - /// Returns the application name and version /// /// This is used in the headers when talking to the API From 1e9c44e56b87cb4aba2e135a6965d813bc4396c6 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Mon, 8 Nov 2021 09:54:50 +0100 Subject: [PATCH 14/49] Use makeUri helper function in auth provider --- lib/providers/auth.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/providers/auth.dart b/lib/providers/auth.dart index b4781a76..e00126b7 100644 --- a/lib/providers/auth.dart +++ b/lib/providers/auth.dart @@ -41,6 +41,11 @@ class AuthProvider with ChangeNotifier { PackageInfo? applicationVersion; Map? metadata = {}; + static const MIN_APP_VERSION_URL = 'min-app-version'; + static const SERVER_VERSION_URL = 'version'; + static const REGISTRATION_URL = 'register'; + static const LOGIN_URL = 'login'; + late http.Client client; AuthProvider([http.Client? client]) { @@ -62,7 +67,7 @@ class AuthProvider with ChangeNotifier { /// Server application version Future setServerVersion() async { - final response = await client.get(makeUri(serverUrl!, 'version')); + final response = await client.get(makeUri(serverUrl!, SERVER_VERSION_URL)); final responseData = json.decode(response.body); serverVersion = responseData; } @@ -82,7 +87,7 @@ class AuthProvider with ChangeNotifier { final applicationCurrentVersion = version ?? applicationVersion!.version; - final response = await client.get(makeUri(serverUrl!, 'min-app-version')); + final response = await client.get(makeUri(serverUrl!, MIN_APP_VERSION_URL)); final currentVersion = Version.parse(applicationCurrentVersion); final requiredAppVersion = Version.parse(response.body); @@ -95,8 +100,6 @@ class AuthProvider with ChangeNotifier { required String password, required String email, required String serverUrl}) async { - final uri = Uri.parse('$serverUrl/api/v2/register/'); - // Register try { final Map data = {'username': username, 'password': password}; @@ -104,7 +107,7 @@ class AuthProvider with ChangeNotifier { data['email'] = email; } final response = await client.post( - uri, + makeUri(serverUrl, REGISTRATION_URL), headers: { HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8', HttpHeaders.authorizationHeader: 'Token ${metadata![MANIFEST_KEY_API]}' @@ -125,12 +128,11 @@ class AuthProvider with ChangeNotifier { /// Authenticates a user Future login(String username, String password, String serverUrl) async { - final uri = Uri.parse('$serverUrl/api/v2/login/'); await logout(shouldNotify: false); try { final response = await client.post( - uri, + makeUri(serverUrl, LOGIN_URL), headers: { HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8', }, From fbff8f54253b62199e8efdcdf2f467843e45043a Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Mon, 8 Nov 2021 09:57:18 +0100 Subject: [PATCH 15/49] Send user agent header with app version when logging in and registering --- lib/providers/auth.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/providers/auth.dart b/lib/providers/auth.dart index e00126b7..0e9d13cd 100644 --- a/lib/providers/auth.dart +++ b/lib/providers/auth.dart @@ -110,7 +110,8 @@ class AuthProvider with ChangeNotifier { makeUri(serverUrl, REGISTRATION_URL), headers: { HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8', - HttpHeaders.authorizationHeader: 'Token ${metadata![MANIFEST_KEY_API]}' + HttpHeaders.authorizationHeader: 'Token ${metadata![MANIFEST_KEY_API]}', + HttpHeaders.userAgentHeader: getAppNameHeader(), }, body: json.encode(data), ); @@ -135,6 +136,7 @@ class AuthProvider with ChangeNotifier { makeUri(serverUrl, LOGIN_URL), headers: { HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8', + HttpHeaders.userAgentHeader: getAppNameHeader(), }, body: json.encode({'username': username, 'password': password}), ); @@ -219,10 +221,10 @@ class AuthProvider with ChangeNotifier { String getAppNameHeader() { String out = ''; if (applicationVersion != null) { - out = '${applicationVersion!.version} ' + out = '/${applicationVersion!.version} ' '(${applicationVersion!.packageName}; ' 'build: ${applicationVersion!.buildNumber})'; } - return 'wger App/$out'; + return 'wger App$out'; } } From a77a0cc5db14e97a0af90db5891f82812c7153aa Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Mon, 8 Nov 2021 10:37:57 +0100 Subject: [PATCH 16/49] Show last logged items for quick access --- lib/screens/nutritional_plan_screen.dart | 1 + lib/widgets/dashboard/widgets.dart | 1 + lib/widgets/nutrition/forms.dart | 31 ++++++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/lib/screens/nutritional_plan_screen.dart b/lib/screens/nutritional_plan_screen.dart index 172e8eb9..f28c569c 100644 --- a/lib/screens/nutritional_plan_screen.dart +++ b/lib/screens/nutritional_plan_screen.dart @@ -53,6 +53,7 @@ class NutritionalPlanScreen extends StatelessWidget { arguments: FormScreenArguments( AppLocalizations.of(context).logIngredient, IngredientLogForm(_nutritionalPlan), + hasListView: true, ), ); }, diff --git a/lib/widgets/dashboard/widgets.dart b/lib/widgets/dashboard/widgets.dart index 993582a8..6048f0a9 100644 --- a/lib/widgets/dashboard/widgets.dart +++ b/lib/widgets/dashboard/widgets.dart @@ -210,6 +210,7 @@ class _DashboardNutritionWidgetState extends State { arguments: FormScreenArguments( AppLocalizations.of(context).logIngredient, IngredientLogForm(_plan!), + hasListView: true, ), ); }, diff --git a/lib/widgets/nutrition/forms.dart b/lib/widgets/nutrition/forms.dart index 6bff2a12..70e0725c 100644 --- a/lib/widgets/nutrition/forms.dart +++ b/lib/widgets/nutrition/forms.dart @@ -226,6 +226,9 @@ class IngredientLogForm extends StatelessWidget { @override Widget build(BuildContext context) { + final diaryEntries = _plan.logs; + final String unit = AppLocalizations.of(context).g; + return Container( margin: const EdgeInsets.all(20), child: Form( @@ -295,6 +298,34 @@ class IngredientLogForm extends StatelessWidget { Navigator.of(context).pop(); }, ), + if (diaryEntries.isNotEmpty) const SizedBox(height: 10.0), + Container( + child: Text(AppLocalizations.of(context).recentlyUsedIngredients), + padding: const EdgeInsets.all(10.0), + ), + Expanded( + child: ListView.builder( + itemCount: diaryEntries.length, + shrinkWrap: true, + itemBuilder: (context, index) { + return Card( + child: ListTile( + onTap: () { + _ingredientController.text = diaryEntries[index].ingredientObj.name; + _ingredientIdController.text = + diaryEntries[index].ingredientObj.id.toString(); + _amountController.text = diaryEntries[index].amount.toStringAsFixed(0); + _mealItem.ingredientId = diaryEntries[index].ingredientId; + _mealItem.amount = diaryEntries[index].amount; + }, + title: Text(_plan.logs[index].ingredientObj.name), + subtitle: Text('${diaryEntries[index].amount.toStringAsFixed(0)}$unit'), + trailing: const Icon(Icons.copy), + ), + ); + }, + ), + ) ], ), ), From e5bd9e901fbd8a3087c16732ced63955fabdb498 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Mon, 8 Nov 2021 10:55:16 +0100 Subject: [PATCH 17/49] Add workaround for the AndroidMetadata checks The metaDataAsMap method doesn't work during tests and throws a null check error. A better solution should be implemented when possible. --- analysis_options.yaml | 2 +- lib/providers/auth.dart | 21 ++++++++++++--------- lib/screens/auth_screen.dart | 2 +- test/auth/auth_provider_test.dart | 2 +- test/utils.dart | 2 +- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 92ea0b11..6640b461 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -65,7 +65,7 @@ linter: empty_statements: true exhaustive_cases: true file_names: true - flutter_style_todos: true + flutter_style_todos: false hash_and_equals: true implementation_imports: true iterable_contains_unrelated_type: true diff --git a/lib/providers/auth.dart b/lib/providers/auth.dart index 0e9d13cd..e1f1f6db 100644 --- a/lib/providers/auth.dart +++ b/lib/providers/auth.dart @@ -39,7 +39,7 @@ class AuthProvider with ChangeNotifier { String? serverUrl; String? serverVersion; PackageInfo? applicationVersion; - Map? metadata = {}; + Map metadata = {}; static const MIN_APP_VERSION_URL = 'min-app-version'; static const SERVER_VERSION_URL = 'version'; @@ -48,13 +48,16 @@ class AuthProvider with ChangeNotifier { late http.Client client; - AuthProvider([http.Client? client]) { + AuthProvider([http.Client? client, bool? checkMetadata]) { this.client = client ?? http.Client(); - try { - AndroidMetadata.metaDataAsMap.then((value) => metadata = value); - } on PlatformException { - throw Exception('An error occurred reading the metadata from AndroidManifest'); + // TODO: this is a workaround since AndroidMetadata doesn't work while running tests + if (checkMetadata ?? true) { + try { + AndroidMetadata.metaDataAsMap.then((value) => metadata = value!); + } on PlatformException { + throw Exception('An error occurred reading the metadata from AndroidManifest'); + } catch (error) {} } } @@ -80,8 +83,8 @@ class AuthProvider with ChangeNotifier { /// Checking if there is a new version of the application. Future applicationUpdateRequired([String? version]) async { - if (metadata!.containsKey('wger.check_min_app_version') || - metadata!['wger.check_min_app_version'] == 'false') { + if (metadata.containsKey('wger.check_min_app_version') || + metadata['wger.check_min_app_version'] == 'false') { return false; } @@ -110,7 +113,7 @@ class AuthProvider with ChangeNotifier { makeUri(serverUrl, REGISTRATION_URL), headers: { HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8', - HttpHeaders.authorizationHeader: 'Token ${metadata![MANIFEST_KEY_API]}', + HttpHeaders.authorizationHeader: 'Token ${metadata[MANIFEST_KEY_API]}', HttpHeaders.userAgentHeader: getAppNameHeader(), }, body: json.encode(data), diff --git a/lib/screens/auth_screen.dart b/lib/screens/auth_screen.dart index b4edb819..6a80be1b 100644 --- a/lib/screens/auth_screen.dart +++ b/lib/screens/auth_screen.dart @@ -119,7 +119,7 @@ class _AuthCardState extends State { // If not, the user will not be able to register via the app try { final metadata = Provider.of(context, listen: false).metadata; - if (metadata!.containsKey(MANIFEST_KEY_API) || metadata[MANIFEST_KEY_API] == '') { + if (metadata.containsKey(MANIFEST_KEY_API) || metadata[MANIFEST_KEY_API] == '') { _canRegister = false; } } on PlatformException { diff --git a/test/auth/auth_provider_test.dart b/test/auth/auth_provider_test.dart index 8af65057..8dc53fd9 100644 --- a/test/auth/auth_provider_test.dart +++ b/test/auth/auth_provider_test.dart @@ -17,7 +17,7 @@ void main() { setUp(() { mockClient = MockClient(); - authProvider = AuthProvider(mockClient); + authProvider = AuthProvider(mockClient, false); authProvider.serverUrl = 'http://localhost'; }); diff --git a/test/utils.dart b/test/utils.dart index 59be586a..67c8b97d 100644 --- a/test/utils.dart +++ b/test/utils.dart @@ -23,7 +23,7 @@ import '../test_data/exercises.dart'; import 'other/base_provider_test.mocks.dart'; // Test Auth provider -final AuthProvider testAuthProvider = AuthProvider(MockClient()) +final AuthProvider testAuthProvider = AuthProvider(MockClient(), false) ..token = 'FooBar' ..serverUrl = 'https://localhost'; From 520b0b1460b0674457fa97fe9a9d29d3c27ba276 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Mon, 8 Nov 2021 15:25:06 +0100 Subject: [PATCH 18/49] Add new build system for android releases --- .github/workflows/android-release-ng.yml | 90 ++++++++++++++++++++ android/fastlane/Fastfile | 24 ------ android/fastlane/Pluginfile | 1 - android/fastlane/envfiles/decrypt_secrets.sh | 0 pubspec.lock | 49 +++++++++++ pubspec.yaml | 5 +- 6 files changed, 142 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/android-release-ng.yml mode change 100644 => 100755 android/fastlane/envfiles/decrypt_secrets.sh diff --git a/.github/workflows/android-release-ng.yml b/.github/workflows/android-release-ng.yml new file mode 100644 index 00000000..d3a9d4af --- /dev/null +++ b/.github/workflows/android-release-ng.yml @@ -0,0 +1,90 @@ +name: Google Play release 2 +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + deploy_android: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 11.x + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3' + + - name: Setup Flutter + uses: subosito/flutter-action@v1 + with: + channel: 'stable' + flutter-version: '2.5.x' + + - name: Decrypt config files + run: | + cd ./android/fastlane/envfiles + chmod +x ./decrypt_secrets.sh + ./decrypt_secrets.sh + env: + DECRYPTKEY_PLAYSTORE: ${{ secrets.DECRYPTKEY_PLAYSTORE }} + DECRYPTKEY_PLAYSTORE_SIGNING_KEY: ${{ secrets.DECRYPTKEY_PLAYSTORE_SIGNING_KEY }} + DECRYPTKEY_PROPERTIES: ${{ secrets.DECRYPTKEY_PROPERTIES }} + + - name: Flutter info + run: | + dart --version + flutter --version + + - name: Install Flutter dependencies + run: flutter pub get + + - name: Extract version information + id: get_version + run: | + echo ::set-output name=VERSION_V::$(echo $GITHUB_REF | cut -d / -f 3) + echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 2-) + echo ::set-output name=BUILD::$(flutter pub run cider version | cut -d '+' -f 2) + + # Note: the original tag that triggered the workflow is in the form vX.Y.Z + # but the pubspec.yaml is committed in the commit after that one. + # Since we need the tag to point to the correct commit for other workflows + # such as f-droid we need a way to correct it. Only moving the tag + # would not work, as it would trigger this workflow again. So as + # a workaround, we use the v-tag to trigger this workflow, add a new + # one without the v and push it. + - name: Bump version + run: | + flutter pub run cider version ${{ steps.get_version.outputs.VERSION }}+${{ steps.get_version.outputs.BUILD }} + flutter pub run cider bump build + + git config user.name Github-actions + git config user.email github-actions@github.com + git add . + git commit -m "Bump version to $( flutter pub run cider version )" + git tag ${{ steps.get_version.outputs.VERSION }} + git push origin HEAD:master --tags + git push origin --delete ${{ steps.get_version.outputs.VERSION_V }} + + - name: Build AAB + run: flutter build appbundle --release + env: + WGER_API_KEY: ${{ secrets.WGER_API_KEY }} + + - name: Upload build to Play Store + uses: maierj/fastlane-action@v2 + with: + lane: production + subdirectory: android + + - name: Make Github release + uses: softprops/action-gh-release@v1 + with: + files: build/app/outputs/bundle/release/app-release.aab + tag_name: ${{ steps.get_version.outputs.VERSION }} \ No newline at end of file diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 5689be81..6be66427 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -25,30 +25,6 @@ end platform :android do - desc "Sets the version name and code in pubspec.yaml" - lane :setVersion do - begin - old_version_code = google_play_track_version_codes( - package_name: "de.wger.flutter", - track: "production", - json_key: "./fastlane/envfiles/playstore.json", - ) - puts "old_version_code: " + old_version_code.to_s - new_version_code = old_version_code.last().to_i + 1 - puts "new_version_code: " + new_version_code.to_s - - new_version_name = get_version_number_from_git_branch(pattern: 'release/#') - puts new_version_name.to_s - - flutter_set_version( - path_to_yaml: "../pubspec.yaml", - version_name: new_version_name.to_s, - version_code: new_version_code.to_s, - ) - end - end - - desc "Upload app to production" lane :production do begin diff --git a/android/fastlane/Pluginfile b/android/fastlane/Pluginfile index e6832759..87578f80 100644 --- a/android/fastlane/Pluginfile +++ b/android/fastlane/Pluginfile @@ -3,4 +3,3 @@ # Ensure this file is checked in to source control! gem 'fastlane-plugin-versioning' -gem 'fastlane-plugin-flutter_dart_version_manager' diff --git a/android/fastlane/envfiles/decrypt_secrets.sh b/android/fastlane/envfiles/decrypt_secrets.sh old mode 100644 new mode 100755 diff --git a/pubspec.lock b/pubspec.lock index f83d717e..cd1ac129 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -127,6 +127,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.1+1" + change: + dependency: transitive + description: + name: change + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" characters: dependency: transitive description: @@ -176,6 +183,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + cider: + dependency: "direct dev" + description: + name: cider + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" cli_util: dependency: transitive description: @@ -504,6 +518,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.1.4" + klizma: + dependency: transitive + description: + name: klizma + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" lints: dependency: transitive description: @@ -518,6 +539,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.2" + markdown: + dependency: transitive + description: + name: markdown + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + marker: + dependency: transitive + description: + name: marker + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.2" matcher: dependency: transitive description: @@ -693,6 +728,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.1+1" + rfc_6901: + dependency: transitive + description: + name: rfc_6901 + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" rive: dependency: "direct main" description: @@ -908,6 +950,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + version_manipulation: + dependency: transitive + description: + name: version_manipulation + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" video_player: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 3b9d3b2f..46d4479c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 0.2.0+11 +version: 1.3.0+23 environment: sdk: '>=2.12.0 <3.0.0' @@ -36,6 +36,7 @@ dependencies: charts_flutter: ^0.12.0 collection: ^1.15.0-nullsafety.4 cupertino_icons: ^1.0.0 + equatable: ^2.0.3 flutter_calendar_carousel: ^2.0.3 flutter_html: ^2.1.2 flutter_typeahead: ^3.2.0 @@ -51,7 +52,6 @@ dependencies: shared_preferences: ^2.0.7 table_calendar: ^3.0.2 url_launcher: ^6.0.10 - equatable: ^2.0.3 dev_dependencies: flutter_test: @@ -64,6 +64,7 @@ dev_dependencies: mockito: ^5.0.15 network_image_mock: ^2.0.1 flutter_lints: ^1.0.4 + cider: ^0.1.0 flutter_icons: android: true From 7ab7d5c9f3f7323af014dda7e81f4498a3299870 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 10:20:38 +0100 Subject: [PATCH 19/49] Remove duplicated android release config file --- .github/workflows/android-release-ng.yml | 90 ------------------------ .github/workflows/android-release.yml | 72 +++++++++++++------ 2 files changed, 52 insertions(+), 110 deletions(-) delete mode 100644 .github/workflows/android-release-ng.yml diff --git a/.github/workflows/android-release-ng.yml b/.github/workflows/android-release-ng.yml deleted file mode 100644 index d3a9d4af..00000000 --- a/.github/workflows/android-release-ng.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Google Play release 2 -on: - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - -jobs: - deploy_android: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup Java - uses: actions/setup-java@v1 - with: - java-version: 11.x - - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3' - - - name: Setup Flutter - uses: subosito/flutter-action@v1 - with: - channel: 'stable' - flutter-version: '2.5.x' - - - name: Decrypt config files - run: | - cd ./android/fastlane/envfiles - chmod +x ./decrypt_secrets.sh - ./decrypt_secrets.sh - env: - DECRYPTKEY_PLAYSTORE: ${{ secrets.DECRYPTKEY_PLAYSTORE }} - DECRYPTKEY_PLAYSTORE_SIGNING_KEY: ${{ secrets.DECRYPTKEY_PLAYSTORE_SIGNING_KEY }} - DECRYPTKEY_PROPERTIES: ${{ secrets.DECRYPTKEY_PROPERTIES }} - - - name: Flutter info - run: | - dart --version - flutter --version - - - name: Install Flutter dependencies - run: flutter pub get - - - name: Extract version information - id: get_version - run: | - echo ::set-output name=VERSION_V::$(echo $GITHUB_REF | cut -d / -f 3) - echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 2-) - echo ::set-output name=BUILD::$(flutter pub run cider version | cut -d '+' -f 2) - - # Note: the original tag that triggered the workflow is in the form vX.Y.Z - # but the pubspec.yaml is committed in the commit after that one. - # Since we need the tag to point to the correct commit for other workflows - # such as f-droid we need a way to correct it. Only moving the tag - # would not work, as it would trigger this workflow again. So as - # a workaround, we use the v-tag to trigger this workflow, add a new - # one without the v and push it. - - name: Bump version - run: | - flutter pub run cider version ${{ steps.get_version.outputs.VERSION }}+${{ steps.get_version.outputs.BUILD }} - flutter pub run cider bump build - - git config user.name Github-actions - git config user.email github-actions@github.com - git add . - git commit -m "Bump version to $( flutter pub run cider version )" - git tag ${{ steps.get_version.outputs.VERSION }} - git push origin HEAD:master --tags - git push origin --delete ${{ steps.get_version.outputs.VERSION_V }} - - - name: Build AAB - run: flutter build appbundle --release - env: - WGER_API_KEY: ${{ secrets.WGER_API_KEY }} - - - name: Upload build to Play Store - uses: maierj/fastlane-action@v2 - with: - lane: production - subdirectory: android - - - name: Make Github release - uses: softprops/action-gh-release@v1 - with: - files: build/app/outputs/bundle/release/app-release.aab - tag_name: ${{ steps.get_version.outputs.VERSION }} \ No newline at end of file diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 9ed81aa9..d3a9d4af 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -1,8 +1,8 @@ -name: Google Play release +name: Google Play release 2 on: push: - branches: - - 'release/*' + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' jobs: deploy_android: @@ -14,19 +14,12 @@ jobs: - name: Setup Java uses: actions/setup-java@v1 with: - java-version: 12.x + java-version: 11.x - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7' - - - name: Decrypt config files - run: cd ./android/fastlane/envfiles && chmod +x ./decrypt_secrets.sh && ./decrypt_secrets.sh - env: - DECRYPTKEY_PLAYSTORE: ${{ secrets.DECRYPTKEY_PLAYSTORE }} - DECRYPTKEY_PLAYSTORE_SIGNING_KEY: ${{ secrets.DECRYPTKEY_PLAYSTORE_SIGNING_KEY }} - DECRYPTKEY_PROPERTIES: ${{ secrets.DECRYPTKEY_PROPERTIES }} + ruby-version: '3' - name: Setup Flutter uses: subosito/flutter-action@v1 @@ -34,25 +27,64 @@ jobs: channel: 'stable' flutter-version: '2.5.x' - - run: dart --version - - run: flutter --version + - name: Decrypt config files + run: | + cd ./android/fastlane/envfiles + chmod +x ./decrypt_secrets.sh + ./decrypt_secrets.sh + env: + DECRYPTKEY_PLAYSTORE: ${{ secrets.DECRYPTKEY_PLAYSTORE }} + DECRYPTKEY_PLAYSTORE_SIGNING_KEY: ${{ secrets.DECRYPTKEY_PLAYSTORE_SIGNING_KEY }} + DECRYPTKEY_PROPERTIES: ${{ secrets.DECRYPTKEY_PROPERTIES }} + + - name: Flutter info + run: | + dart --version + flutter --version - name: Install Flutter dependencies run: flutter pub get + - name: Extract version information + id: get_version + run: | + echo ::set-output name=VERSION_V::$(echo $GITHUB_REF | cut -d / -f 3) + echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 2-) + echo ::set-output name=BUILD::$(flutter pub run cider version | cut -d '+' -f 2) + + # Note: the original tag that triggered the workflow is in the form vX.Y.Z + # but the pubspec.yaml is committed in the commit after that one. + # Since we need the tag to point to the correct commit for other workflows + # such as f-droid we need a way to correct it. Only moving the tag + # would not work, as it would trigger this workflow again. So as + # a workaround, we use the v-tag to trigger this workflow, add a new + # one without the v and push it. - name: Bump version - uses: maierj/fastlane-action@v2.0.0 - with: - lane: setVersion - subdirectory: android + run: | + flutter pub run cider version ${{ steps.get_version.outputs.VERSION }}+${{ steps.get_version.outputs.BUILD }} + flutter pub run cider bump build + + git config user.name Github-actions + git config user.email github-actions@github.com + git add . + git commit -m "Bump version to $( flutter pub run cider version )" + git tag ${{ steps.get_version.outputs.VERSION }} + git push origin HEAD:master --tags + git push origin --delete ${{ steps.get_version.outputs.VERSION_V }} - name: Build AAB run: flutter build appbundle --release env: WGER_API_KEY: ${{ secrets.WGER_API_KEY }} - - name: Run Fastlane - uses: maierj/fastlane-action@v2.0.0 + - name: Upload build to Play Store + uses: maierj/fastlane-action@v2 with: lane: production subdirectory: android + + - name: Make Github release + uses: softprops/action-gh-release@v1 + with: + files: build/app/outputs/bundle/release/app-release.aab + tag_name: ${{ steps.get_version.outputs.VERSION }} \ No newline at end of file From f826c28b3444dd924e89dce3314006fb68c3fd4e Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 10:34:47 +0100 Subject: [PATCH 20/49] Fix workflow name --- .github/workflows/android-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index d3a9d4af..38e86d90 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -1,4 +1,4 @@ -name: Google Play release 2 +name: Google Play release on: push: tags: From 57361f9ef501aa817629866aefff7578520537d8 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 10:58:33 +0100 Subject: [PATCH 21/49] Add CHANGELOG.md --- .github/workflows/android-release.yml | 3 ++- CHANGELOG.md | 25 +++++++++++++++++++++++++ CHANGELOG.template.md | 10 ++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md create mode 100644 CHANGELOG.template.md diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 38e86d90..04a9cab1 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -87,4 +87,5 @@ jobs: uses: softprops/action-gh-release@v1 with: files: build/app/outputs/bundle/release/app-release.aab - tag_name: ${{ steps.get_version.outputs.VERSION }} \ No newline at end of file + tag_name: ${{ steps.get_version.outputs.VERSION }} + body_path: CHANGELOG.md \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..f1351e44 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,25 @@ +🚀 Features: +* Allow users to give meals a description #89 +* Allow users to delete workout log entries #97 +* Allow users to log individual ingredients/products #114 +* New loading animation during first run #99 +* Added reference from log to meal #105 + + +🐛 Bug Fixes: +* Improve usability for workout logs #91 +* Preselect correct time in session form #93 +* Fixed infinite loader bug during auth #96 +* Fix error not showing up in auth screen #102 +* Fix for chart legend bug #112 +* Fix for RiR slider #113 + + +🧰 Maintenance: +* Better linting #87 #98 +* Improve automatic build system for publication on play store +* Notify the user when saving entries in gym mode #92 +* Consistenly display nutritional values #94 +* Add minimum required server version #29 +* Make order field of sets required #109 + diff --git a/CHANGELOG.template.md b/CHANGELOG.template.md new file mode 100644 index 00000000..f29c2972 --- /dev/null +++ b/CHANGELOG.template.md @@ -0,0 +1,10 @@ +🚀 Features: +* + + +🐛 Bug Fixes: +* + + +🧰 Maintenance: +* \ No newline at end of file From c02f81b21ed081f93335f343dca2cf173c706a99 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 11:25:16 +0100 Subject: [PATCH 22/49] Bump action version --- .github/workflows/android-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 04a9cab1..367dca86 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -78,7 +78,7 @@ jobs: WGER_API_KEY: ${{ secrets.WGER_API_KEY }} - name: Upload build to Play Store - uses: maierj/fastlane-action@v2 + uses: maierj/fastlane-action@v2.1.0 with: lane: production subdirectory: android From 97616871bc603045b64bd22950eb10d6c012137b Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 11:29:46 +0100 Subject: [PATCH 23/49] Don't run CI when non-dart files were changed --- .github/workflows/ci.yml | 4 ++++ .github/workflows/linter.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33c08a3f..9ac22461 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,8 +2,12 @@ name: Continous Integration on: push: branches: [ master ] + paths: + - '**.dart' pull_request: branches: [ master ] + paths: + - '**.dart' jobs: test: runs-on: ubuntu-20.04 diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 0b31d6da..d8052c82 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -4,6 +4,8 @@ on: push: branches: - "master" + paths: + - '**.dart' jobs: From 933d1684cb676b6ca58f2be3dd6ea39caf7ba59a Mon Sep 17 00:00:00 2001 From: Github-actions Date: Tue, 9 Nov 2021 10:32:34 +0000 Subject: [PATCH 24/49] Bump version to 1.4.0+24 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 46d4479c..a521352d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 1.3.0+23 +version: 1.4.0+24 environment: sdk: '>=2.12.0 <3.0.0' From 15f3431247bf87f4e8457919022eff5d24e707f2 Mon Sep 17 00:00:00 2001 From: Github-actions Date: Tue, 9 Nov 2021 10:46:09 +0000 Subject: [PATCH 25/49] Bump version to 1.4.0+25 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a521352d..3b10eb86 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 1.4.0+24 +version: 1.4.0+25 environment: sdk: '>=2.12.0 <3.0.0' From 438da84ba9c9b61a3687c3ca370f88314c5c21fe Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 11:54:26 +0100 Subject: [PATCH 26/49] Rename language --- .../fastlane/metadata/android/{es => es-ES}/short_description.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename android/fastlane/metadata/android/{es => es-ES}/short_description.txt (100%) diff --git a/android/fastlane/metadata/android/es/short_description.txt b/android/fastlane/metadata/android/es-ES/short_description.txt similarity index 100% rename from android/fastlane/metadata/android/es/short_description.txt rename to android/fastlane/metadata/android/es-ES/short_description.txt From 265857fe9c8c7a15abc47d386c3bfba55f0e2c17 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 11:55:12 +0100 Subject: [PATCH 27/49] Reset version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 3b10eb86..46d4479c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 1.4.0+25 +version: 1.3.0+23 environment: sdk: '>=2.12.0 <3.0.0' From 15122ce7a02bae9a7a51d09b3d937082395869b4 Mon Sep 17 00:00:00 2001 From: Github-actions Date: Tue, 9 Nov 2021 10:57:47 +0000 Subject: [PATCH 28/49] Bump version to 1.4.0+24 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 46d4479c..a521352d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 1.3.0+23 +version: 1.4.0+24 environment: sdk: '>=2.12.0 <3.0.0' From bff749d70d638f592732798a3e301e492d08d2e1 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 12:02:50 +0100 Subject: [PATCH 29/49] Reset version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a521352d..46d4479c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 1.4.0+24 +version: 1.3.0+23 environment: sdk: '>=2.12.0 <3.0.0' From 670feac6401740a418693d749cbeeb9e088d1278 Mon Sep 17 00:00:00 2001 From: Github-actions Date: Tue, 9 Nov 2021 11:11:16 +0000 Subject: [PATCH 30/49] Bump version to 1.4.0+24 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 46d4479c..a521352d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 1.3.0+23 +version: 1.4.0+24 environment: sdk: '>=2.12.0 <3.0.0' From a7b0f63a7f4fe2b0d0cd4ac8e19e45e8d642c936 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 12:19:29 +0100 Subject: [PATCH 31/49] Add missing titles to android metadata --- android/fastlane/metadata/android/es-ES/title.txt | 1 + android/fastlane/metadata/android/hr/title.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 android/fastlane/metadata/android/es-ES/title.txt create mode 100644 android/fastlane/metadata/android/hr/title.txt diff --git a/android/fastlane/metadata/android/es-ES/title.txt b/android/fastlane/metadata/android/es-ES/title.txt new file mode 100644 index 00000000..ea0df956 --- /dev/null +++ b/android/fastlane/metadata/android/es-ES/title.txt @@ -0,0 +1 @@ +wger Workout Manager \ No newline at end of file diff --git a/android/fastlane/metadata/android/hr/title.txt b/android/fastlane/metadata/android/hr/title.txt new file mode 100644 index 00000000..ea0df956 --- /dev/null +++ b/android/fastlane/metadata/android/hr/title.txt @@ -0,0 +1 @@ +wger Workout Manager \ No newline at end of file From c21222d2aa57f4db4356c7e77af6134f0e6636fb Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 12:20:21 +0100 Subject: [PATCH 32/49] Reset version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a521352d..46d4479c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 1.4.0+24 +version: 1.3.0+23 environment: sdk: '>=2.12.0 <3.0.0' From 82b98e7eed9beb68e7bef47888f438c3996a0a13 Mon Sep 17 00:00:00 2001 From: Github-actions Date: Tue, 9 Nov 2021 11:22:58 +0000 Subject: [PATCH 33/49] Bump version to 1.4.0+24 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 46d4479c..a521352d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 1.3.0+23 +version: 1.4.0+24 environment: sdk: '>=2.12.0 <3.0.0' From 0dac09bdf28ef26de220611e323ce32db12c160c Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 12:26:47 +0100 Subject: [PATCH 34/49] Reset version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a521352d..46d4479c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 1.4.0+24 +version: 1.3.0+23 environment: sdk: '>=2.12.0 <3.0.0' From ae7df87b5bc1a0212b4f1142a6a64cc3ebc51ffd Mon Sep 17 00:00:00 2001 From: Github-actions Date: Tue, 9 Nov 2021 11:29:28 +0000 Subject: [PATCH 35/49] Bump version to 1.4.0+24 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 46d4479c..a521352d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 1.3.0+23 +version: 1.4.0+24 environment: sdk: '>=2.12.0 <3.0.0' From 54d11e6691714f4843ece45e4d9dfd96782a505c Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 12:36:09 +0100 Subject: [PATCH 36/49] Add full description info to Spanish Play Store metadata --- .../android/es-ES/full_description.txt | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 android/fastlane/metadata/android/es-ES/full_description.txt diff --git a/android/fastlane/metadata/android/es-ES/full_description.txt b/android/fastlane/metadata/android/es-ES/full_description.txt new file mode 100644 index 00000000..27025dcd --- /dev/null +++ b/android/fastlane/metadata/android/es-ES/full_description.txt @@ -0,0 +1,39 @@ +From fitness lovers to fitness lovers – get your health organized with WGER, your Workout Manager! + +Have you already found your #1 fitness app and do you love to create your own sports routines? No matter what type of sporty beast you are – we all have something in common: We love to keep track of our health data <3 + +So we don’t judge you for still managing your fitness journey with your handy little workout log book but welcome to 2021! + +We have developed a 100% free digital health and fitness tracker app for you, sized down to the most relevant features to make your life easier. Get started, keep training and celebrate your progress! + +wger is an Open Source project and all about: +* Your Body +* Your Workouts +* Your Progress +* Your Data + +Your Body: +No need to google for the ingredients of your favourite treats – choose your daily meals from more than 78000 products and see the nutritional values. Add meals to the nutritional plan and keep an overview of your diet in the calendar. + +Your Workouts: +You know what is best for your body. Create your own workouts out of a growing variety from 200 different exercises. Then, use the Gym Mode to guide you through the training while you log your weights with one tap. + +Your Progress: +Never lose sight of your goals. Track your weight and keep your statistics. + +Your Data: +wger is your personalized fitness diary – but you own your data. Use the REST API to access and do amazing things with it. + +Please note: This free app is not based on additional fundings and we don’t ask you to donate money. More than that it is a community project which is growing constantly. So be prepared for new features anytime! + +#OpenSource – what does that mean? + +Open Source means that the whole source code for this app and the server it talks to is free and available to anybody: +* Do you want to run wger on your own server for you or your local gym? Go ahead! +* Do you miss a feature and want to implement it? Start now! +* Do you want to check that nothing is being sent anywhere? You can! + +Join our community and become a part of sport enthusiasts and IT geeks from all over the world. We keep working on adjusting and optimizing the app customized to our needs. We love your input so feel free to jump in anytime and contribute your wishes and ideas! + +-> find the source code on https://github.com/wger-project +-> ask your questions or just say hello on our discord Server https://discord.gg/rPWFv6W \ No newline at end of file From 0814ca713dc2d539b2007207f8e385b4aa0ec208 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 9 Nov 2021 12:39:55 +0100 Subject: [PATCH 37/49] Reset version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a521352d..46d4479c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 1.4.0+24 +version: 1.3.0+23 environment: sdk: '>=2.12.0 <3.0.0' From efc3507f8a47ca63813c3fd81648637316f61d77 Mon Sep 17 00:00:00 2001 From: Github-actions Date: Tue, 9 Nov 2021 11:42:53 +0000 Subject: [PATCH 38/49] Bump version to 1.4.0+24 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 46d4479c..a521352d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # github action, the current versions are ignored. # - the version number is taken from the git branch release/x.y.z # - the build number is computed by reading the last one from the play store and increased by one -version: 1.3.0+23 +version: 1.4.0+24 environment: sdk: '>=2.12.0 <3.0.0' From d8b7d452912645bbc19a6831d5b094993dea4cbe Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Wed, 10 Nov 2021 15:16:09 +0100 Subject: [PATCH 39/49] Upgrade dependencies and recreate generated files --- lib/models/body_weight/weight_entry.g.dart | 8 +- lib/models/exercises/category.g.dart | 8 +- lib/models/exercises/comment.g.dart | 5 +- lib/models/exercises/equipment.g.dart | 5 +- lib/models/exercises/exercise.g.dart | 35 +-- lib/models/exercises/image.g.dart | 8 +- lib/models/exercises/muscle.g.dart | 5 +- lib/models/gallery/image.g.dart | 5 +- .../measurements/measurement_category.g.dart | 9 +- .../measurements/measurement_entry.g.dart | 8 +- lib/models/nutrition/ingredient.g.dart | 32 ++- .../nutrition/ingredient_weight_unit.g.dart | 11 +- lib/models/nutrition/log.g.dart | 13 +- lib/models/nutrition/meal.g.dart | 12 +- lib/models/nutrition/meal_item.g.dart | 5 +- lib/models/nutrition/nutritional_plan.g.dart | 8 +- lib/models/nutrition/weight_unit.g.dart | 8 +- lib/models/workouts/day.g.dart | 5 +- lib/models/workouts/log.g.dart | 23 +- lib/models/workouts/repetition_unit.g.dart | 8 +- lib/models/workouts/session.g.dart | 16 +- lib/models/workouts/set.g.dart | 5 +- lib/models/workouts/setting.g.dart | 27 +- lib/models/workouts/weight_unit.g.dart | 8 +- lib/models/workouts/workout_plan.g.dart | 8 +- pubspec.lock | 41 +-- pubspec.yaml | 6 +- test/gallery/gallery_screen_test.mocks.dart | 74 +++--- ...surement_categories_screen_test.mocks.dart | 62 +++-- .../measurement_provider_test.mocks.dart | 45 ++-- .../nutritional_plan_form_test.mocks.dart | 121 +++++---- test/other/base_provider_test.mocks.dart | 70 +++-- test/workout/workout_form_test.mocks.dart | 249 ++++++++++-------- test/workout/workout_set_form_test.mocks.dart | 87 +++--- 34 files changed, 634 insertions(+), 406 deletions(-) diff --git a/lib/models/body_weight/weight_entry.g.dart b/lib/models/body_weight/weight_entry.g.dart index 98ab3eda..60ee02c9 100644 --- a/lib/models/body_weight/weight_entry.g.dart +++ b/lib/models/body_weight/weight_entry.g.dart @@ -7,7 +7,10 @@ part of 'weight_entry.dart'; // ************************************************************************** WeightEntry _$WeightEntryFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'weight', 'date']); + $checkKeys( + json, + requiredKeys: const ['id', 'weight', 'date'], + ); return WeightEntry( id: json['id'] as int?, weight: stringToNum(json['weight'] as String?), @@ -15,7 +18,8 @@ WeightEntry _$WeightEntryFromJson(Map json) { ); } -Map _$WeightEntryToJson(WeightEntry instance) => { +Map _$WeightEntryToJson(WeightEntry instance) => + { 'id': instance.id, 'weight': numToString(instance.weight), 'date': toDate(instance.date), diff --git a/lib/models/exercises/category.g.dart b/lib/models/exercises/category.g.dart index 5083051f..19383107 100644 --- a/lib/models/exercises/category.g.dart +++ b/lib/models/exercises/category.g.dart @@ -7,14 +7,18 @@ part of 'category.dart'; // ************************************************************************** ExerciseCategory _$ExerciseCategoryFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'name']); + $checkKeys( + json, + requiredKeys: const ['id', 'name'], + ); return ExerciseCategory( id: json['id'] as int, name: json['name'] as String, ); } -Map _$ExerciseCategoryToJson(ExerciseCategory instance) => { +Map _$ExerciseCategoryToJson(ExerciseCategory instance) => + { 'id': instance.id, 'name': instance.name, }; diff --git a/lib/models/exercises/comment.g.dart b/lib/models/exercises/comment.g.dart index 6195a276..179ef89b 100644 --- a/lib/models/exercises/comment.g.dart +++ b/lib/models/exercises/comment.g.dart @@ -7,7 +7,10 @@ part of 'comment.dart'; // ************************************************************************** Comment _$CommentFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'comment']); + $checkKeys( + json, + requiredKeys: const ['id', 'comment'], + ); return Comment( id: json['id'] as int, comment: json['comment'] as String, diff --git a/lib/models/exercises/equipment.g.dart b/lib/models/exercises/equipment.g.dart index 252f0397..3948e1bb 100644 --- a/lib/models/exercises/equipment.g.dart +++ b/lib/models/exercises/equipment.g.dart @@ -7,7 +7,10 @@ part of 'equipment.dart'; // ************************************************************************** Equipment _$EquipmentFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'name']); + $checkKeys( + json, + requiredKeys: const ['id', 'name'], + ); return Equipment( id: json['id'] as int, name: json['name'] as String, diff --git a/lib/models/exercises/exercise.g.dart b/lib/models/exercises/exercise.g.dart index 4c449343..44575077 100644 --- a/lib/models/exercises/exercise.g.dart +++ b/lib/models/exercises/exercise.g.dart @@ -7,19 +7,22 @@ part of 'exercise.dart'; // ************************************************************************** Exercise _$ExerciseFromJson(Map json) { - $checkKeys(json, requiredKeys: const [ - 'id', - 'uuid', - 'creation_date', - 'name', - 'description', - 'category', - 'muscles', - 'muscles_secondary', - 'equipment', - 'images', - 'comments' - ]); + $checkKeys( + json, + requiredKeys: const [ + 'id', + 'uuid', + 'creation_date', + 'name', + 'description', + 'category', + 'muscles', + 'muscles_secondary', + 'equipment', + 'images', + 'comments' + ], + ); return Exercise( id: json['id'] as int, uuid: json['uuid'] as String, @@ -41,7 +44,8 @@ Exercise _$ExerciseFromJson(Map json) { tips: (json['comments'] as List?) ?.map((e) => Comment.fromJson(e as Map)) .toList(), - )..categoryObj = ExerciseCategory.fromJson(json['category'] as Map); + )..categoryObj = + ExerciseCategory.fromJson(json['category'] as Map); } Map _$ExerciseToJson(Exercise instance) => { @@ -52,7 +56,8 @@ Map _$ExerciseToJson(Exercise instance) => { 'description': instance.description, 'category': instance.categoryObj.toJson(), 'muscles': instance.muscles.map((e) => e.toJson()).toList(), - 'muscles_secondary': instance.musclesSecondary.map((e) => e.toJson()).toList(), + 'muscles_secondary': + instance.musclesSecondary.map((e) => e.toJson()).toList(), 'equipment': instance.equipment.map((e) => e.toJson()).toList(), 'images': instance.images.map((e) => e.toJson()).toList(), 'comments': instance.tips.map((e) => e.toJson()).toList(), diff --git a/lib/models/exercises/image.g.dart b/lib/models/exercises/image.g.dart index c55b4029..1240dc38 100644 --- a/lib/models/exercises/image.g.dart +++ b/lib/models/exercises/image.g.dart @@ -7,7 +7,10 @@ part of 'image.dart'; // ************************************************************************** ExerciseImage _$ExerciseImageFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'uuid', 'exercise_base', 'image']); + $checkKeys( + json, + requiredKeys: const ['id', 'uuid', 'exercise_base', 'image'], + ); return ExerciseImage( id: json['id'] as int, uuid: json['uuid'] as String, @@ -17,7 +20,8 @@ ExerciseImage _$ExerciseImageFromJson(Map json) { ); } -Map _$ExerciseImageToJson(ExerciseImage instance) => { +Map _$ExerciseImageToJson(ExerciseImage instance) => + { 'id': instance.id, 'uuid': instance.uuid, 'exercise_base': instance.exerciseBaseId, diff --git a/lib/models/exercises/muscle.g.dart b/lib/models/exercises/muscle.g.dart index 41820a7f..89bcb1ab 100644 --- a/lib/models/exercises/muscle.g.dart +++ b/lib/models/exercises/muscle.g.dart @@ -7,7 +7,10 @@ part of 'muscle.dart'; // ************************************************************************** Muscle _$MuscleFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'name', 'is_front']); + $checkKeys( + json, + requiredKeys: const ['id', 'name', 'is_front'], + ); return Muscle( id: json['id'] as int, name: json['name'] as String, diff --git a/lib/models/gallery/image.g.dart b/lib/models/gallery/image.g.dart index 98ad831b..d87cc4e4 100644 --- a/lib/models/gallery/image.g.dart +++ b/lib/models/gallery/image.g.dart @@ -7,7 +7,10 @@ part of 'image.dart'; // ************************************************************************** Image _$ImageFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'date', 'image']); + $checkKeys( + json, + requiredKeys: const ['id', 'date', 'image'], + ); return Image( id: json['id'] as int?, date: DateTime.parse(json['date'] as String), diff --git a/lib/models/measurements/measurement_category.g.dart b/lib/models/measurements/measurement_category.g.dart index 8c5b6538..ef4ebcd3 100644 --- a/lib/models/measurements/measurement_category.g.dart +++ b/lib/models/measurements/measurement_category.g.dart @@ -7,7 +7,10 @@ part of 'measurement_category.dart'; // ************************************************************************** MeasurementCategory _$MeasurementCategoryFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'name', 'unit']); + $checkKeys( + json, + requiredKeys: const ['id', 'name', 'unit'], + ); return MeasurementCategory( id: json['id'] as int?, name: json['name'] as String, @@ -19,7 +22,9 @@ MeasurementCategory _$MeasurementCategoryFromJson(Map json) { ); } -Map _$MeasurementCategoryToJson(MeasurementCategory instance) => { +Map _$MeasurementCategoryToJson( + MeasurementCategory instance) => + { 'id': instance.id, 'name': instance.name, 'unit': instance.unit, diff --git a/lib/models/measurements/measurement_entry.g.dart b/lib/models/measurements/measurement_entry.g.dart index 76964759..4b096960 100644 --- a/lib/models/measurements/measurement_entry.g.dart +++ b/lib/models/measurements/measurement_entry.g.dart @@ -7,7 +7,10 @@ part of 'measurement_entry.dart'; // ************************************************************************** MeasurementEntry _$MeasurementEntryFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'category', 'date', 'value', 'notes']); + $checkKeys( + json, + requiredKeys: const ['id', 'category', 'date', 'value', 'notes'], + ); return MeasurementEntry( id: json['id'] as int?, category: json['category'] as int, @@ -17,7 +20,8 @@ MeasurementEntry _$MeasurementEntryFromJson(Map json) { ); } -Map _$MeasurementEntryToJson(MeasurementEntry instance) => { +Map _$MeasurementEntryToJson(MeasurementEntry instance) => + { 'id': instance.id, 'category': instance.category, 'date': toDate(instance.date), diff --git a/lib/models/nutrition/ingredient.g.dart b/lib/models/nutrition/ingredient.g.dart index 6ffb0a9c..e5859dda 100644 --- a/lib/models/nutrition/ingredient.g.dart +++ b/lib/models/nutrition/ingredient.g.dart @@ -7,19 +7,22 @@ part of 'ingredient.dart'; // ************************************************************************** Ingredient _$IngredientFromJson(Map json) { - $checkKeys(json, requiredKeys: const [ - 'id', - 'name', - 'creation_date', - 'energy', - 'carbohydrates', - 'carbohydrates_sugar', - 'protein', - 'fat', - 'fat_saturated', - 'fibres', - 'sodium' - ]); + $checkKeys( + json, + requiredKeys: const [ + 'id', + 'name', + 'creation_date', + 'energy', + 'carbohydrates', + 'carbohydrates_sugar', + 'protein', + 'fat', + 'fat_saturated', + 'fibres', + 'sodium' + ], + ); return Ingredient( id: json['id'] as int, name: json['name'] as String, @@ -35,7 +38,8 @@ Ingredient _$IngredientFromJson(Map json) { ); } -Map _$IngredientToJson(Ingredient instance) => { +Map _$IngredientToJson(Ingredient instance) => + { 'id': instance.id, 'name': instance.name, 'creation_date': toDate(instance.creationDate), diff --git a/lib/models/nutrition/ingredient_weight_unit.g.dart b/lib/models/nutrition/ingredient_weight_unit.g.dart index 600d0ed4..74b1f101 100644 --- a/lib/models/nutrition/ingredient_weight_unit.g.dart +++ b/lib/models/nutrition/ingredient_weight_unit.g.dart @@ -7,17 +7,22 @@ part of 'ingredient_weight_unit.dart'; // ************************************************************************** IngredientWeightUnit _$IngredientWeightUnitFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'weight_unit', 'ingredient', 'grams', 'amount']); + $checkKeys( + json, + requiredKeys: const ['id', 'weight_unit', 'ingredient', 'grams', 'amount'], + ); return IngredientWeightUnit( id: json['id'] as int, - weightUnit: WeightUnit.fromJson(json['weight_unit'] as Map), + weightUnit: + WeightUnit.fromJson(json['weight_unit'] as Map), ingredient: Ingredient.fromJson(json['ingredient'] as Map), grams: json['grams'] as int, amount: (json['amount'] as num).toDouble(), ); } -Map _$IngredientWeightUnitToJson(IngredientWeightUnit instance) => +Map _$IngredientWeightUnitToJson( + IngredientWeightUnit instance) => { 'id': instance.id, 'weight_unit': instance.weightUnit, diff --git a/lib/models/nutrition/log.g.dart b/lib/models/nutrition/log.g.dart index 72c3f639..39068768 100644 --- a/lib/models/nutrition/log.g.dart +++ b/lib/models/nutrition/log.g.dart @@ -7,8 +7,17 @@ part of 'log.dart'; // ************************************************************************** Log _$LogFromJson(Map json) { - $checkKeys(json, - requiredKeys: const ['id', 'plan', 'datetime', 'ingredient', 'weight_unit', 'amount']); + $checkKeys( + json, + requiredKeys: const [ + 'id', + 'plan', + 'datetime', + 'ingredient', + 'weight_unit', + 'amount' + ], + ); return Log( id: json['id'] as int?, mealId: json['meal'] as int?, diff --git a/lib/models/nutrition/meal.g.dart b/lib/models/nutrition/meal.g.dart index 3d079787..296d637e 100644 --- a/lib/models/nutrition/meal.g.dart +++ b/lib/models/nutrition/meal.g.dart @@ -6,13 +6,11 @@ part of 'meal.dart'; // JsonSerializableGenerator // ************************************************************************** -Meal _$MealFromJson(Map json) { - return Meal( - id: json['id'] as int?, - time: stringToTime(json['time'] as String?), - name: json['name'] as String?, - )..planId = json['plan'] as int; -} +Meal _$MealFromJson(Map json) => Meal( + id: json['id'] as int?, + time: stringToTime(json['time'] as String?), + name: json['name'] as String?, + )..planId = json['plan'] as int; Map _$MealToJson(Meal instance) => { 'id': instance.id, diff --git a/lib/models/nutrition/meal_item.g.dart b/lib/models/nutrition/meal_item.g.dart index e0af0526..514788cc 100644 --- a/lib/models/nutrition/meal_item.g.dart +++ b/lib/models/nutrition/meal_item.g.dart @@ -7,7 +7,10 @@ part of 'meal_item.dart'; // ************************************************************************** MealItem _$MealItemFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'amount']); + $checkKeys( + json, + requiredKeys: const ['id', 'amount'], + ); return MealItem( id: json['id'] as int?, mealId: json['meal'] as int?, diff --git a/lib/models/nutrition/nutritional_plan.g.dart b/lib/models/nutrition/nutritional_plan.g.dart index 024e87db..9b10d8a5 100644 --- a/lib/models/nutrition/nutritional_plan.g.dart +++ b/lib/models/nutrition/nutritional_plan.g.dart @@ -7,7 +7,10 @@ part of 'nutritional_plan.dart'; // ************************************************************************** NutritionalPlan _$NutritionalPlanFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'description', 'creation_date']); + $checkKeys( + json, + requiredKeys: const ['id', 'description', 'creation_date'], + ); return NutritionalPlan( id: json['id'] as int?, description: json['description'] as String, @@ -15,7 +18,8 @@ NutritionalPlan _$NutritionalPlanFromJson(Map json) { ); } -Map _$NutritionalPlanToJson(NutritionalPlan instance) => { +Map _$NutritionalPlanToJson(NutritionalPlan instance) => + { 'id': instance.id, 'description': instance.description, 'creation_date': toDate(instance.creationDate), diff --git a/lib/models/nutrition/weight_unit.g.dart b/lib/models/nutrition/weight_unit.g.dart index b8a01b2b..74e1f0cf 100644 --- a/lib/models/nutrition/weight_unit.g.dart +++ b/lib/models/nutrition/weight_unit.g.dart @@ -7,14 +7,18 @@ part of 'weight_unit.dart'; // ************************************************************************** WeightUnit _$WeightUnitFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'name']); + $checkKeys( + json, + requiredKeys: const ['id', 'name'], + ); return WeightUnit( id: json['id'] as int, name: json['name'] as String, ); } -Map _$WeightUnitToJson(WeightUnit instance) => { +Map _$WeightUnitToJson(WeightUnit instance) => + { 'id': instance.id, 'name': instance.name, }; diff --git a/lib/models/workouts/day.g.dart b/lib/models/workouts/day.g.dart index 6ab6e972..0f1b6736 100644 --- a/lib/models/workouts/day.g.dart +++ b/lib/models/workouts/day.g.dart @@ -7,7 +7,10 @@ part of 'day.dart'; // ************************************************************************** Day _$DayFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'training', 'description', 'day']); + $checkKeys( + json, + requiredKeys: const ['id', 'training', 'description', 'day'], + ); return Day() ..id = json['id'] as int? ..workoutId = json['training'] as int diff --git a/lib/models/workouts/log.g.dart b/lib/models/workouts/log.g.dart index c9717af3..cb2815e3 100644 --- a/lib/models/workouts/log.g.dart +++ b/lib/models/workouts/log.g.dart @@ -7,16 +7,19 @@ part of 'log.dart'; // ************************************************************************** Log _$LogFromJson(Map json) { - $checkKeys(json, requiredKeys: const [ - 'id', - 'exercise', - 'workout', - 'reps', - 'repetition_unit', - 'weight', - 'weight_unit', - 'date' - ]); + $checkKeys( + json, + requiredKeys: const [ + 'id', + 'exercise', + 'workout', + 'reps', + 'repetition_unit', + 'weight', + 'weight_unit', + 'date' + ], + ); return Log( id: json['id'] as int?, exerciseId: json['exercise'] as int, diff --git a/lib/models/workouts/repetition_unit.g.dart b/lib/models/workouts/repetition_unit.g.dart index 40829256..115dc338 100644 --- a/lib/models/workouts/repetition_unit.g.dart +++ b/lib/models/workouts/repetition_unit.g.dart @@ -7,14 +7,18 @@ part of 'repetition_unit.dart'; // ************************************************************************** RepetitionUnit _$RepetitionUnitFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'name']); + $checkKeys( + json, + requiredKeys: const ['id', 'name'], + ); return RepetitionUnit( id: json['id'] as int, name: json['name'] as String, ); } -Map _$RepetitionUnitToJson(RepetitionUnit instance) => { +Map _$RepetitionUnitToJson(RepetitionUnit instance) => + { 'id': instance.id, 'name': instance.name, }; diff --git a/lib/models/workouts/session.g.dart b/lib/models/workouts/session.g.dart index b00ec0c2..e16affad 100644 --- a/lib/models/workouts/session.g.dart +++ b/lib/models/workouts/session.g.dart @@ -7,8 +7,17 @@ part of 'session.dart'; // ************************************************************************** WorkoutSession _$WorkoutSessionFromJson(Map json) { - $checkKeys(json, - requiredKeys: const ['id', 'workout', 'date', 'impression', 'time_start', 'time_end']); + $checkKeys( + json, + requiredKeys: const [ + 'id', + 'workout', + 'date', + 'impression', + 'time_start', + 'time_end' + ], + ); return WorkoutSession() ..id = json['id'] as int? ..workoutId = json['workout'] as int @@ -19,7 +28,8 @@ WorkoutSession _$WorkoutSessionFromJson(Map json) { ..timeEnd = stringToTime(json['time_end'] as String?); } -Map _$WorkoutSessionToJson(WorkoutSession instance) => { +Map _$WorkoutSessionToJson(WorkoutSession instance) => + { 'id': instance.id, 'workout': instance.workoutId, 'date': toDate(instance.date), diff --git a/lib/models/workouts/set.g.dart b/lib/models/workouts/set.g.dart index 9c6f83e2..2548fc12 100644 --- a/lib/models/workouts/set.g.dart +++ b/lib/models/workouts/set.g.dart @@ -7,7 +7,10 @@ part of 'set.dart'; // ************************************************************************** Set _$SetFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'sets', 'order', 'comment']); + $checkKeys( + json, + requiredKeys: const ['id', 'sets', 'order', 'comment'], + ); return Set( day: json['exerciseday'] as int, sets: json['sets'] as int, diff --git a/lib/models/workouts/setting.g.dart b/lib/models/workouts/setting.g.dart index d99751fa..05715589 100644 --- a/lib/models/workouts/setting.g.dart +++ b/lib/models/workouts/setting.g.dart @@ -7,18 +7,21 @@ part of 'setting.dart'; // ************************************************************************** Setting _$SettingFromJson(Map json) { - $checkKeys(json, requiredKeys: const [ - 'id', - 'set', - 'order', - 'exercise', - 'repetition_unit', - 'reps', - 'weight', - 'weight_unit', - 'comment', - 'rir' - ]); + $checkKeys( + json, + requiredKeys: const [ + 'id', + 'set', + 'order', + 'exercise', + 'repetition_unit', + 'reps', + 'weight', + 'weight_unit', + 'comment', + 'rir' + ], + ); return Setting( id: json['id'] as int?, setId: json['set'] as int, diff --git a/lib/models/workouts/weight_unit.g.dart b/lib/models/workouts/weight_unit.g.dart index b8a01b2b..74e1f0cf 100644 --- a/lib/models/workouts/weight_unit.g.dart +++ b/lib/models/workouts/weight_unit.g.dart @@ -7,14 +7,18 @@ part of 'weight_unit.dart'; // ************************************************************************** WeightUnit _$WeightUnitFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'name']); + $checkKeys( + json, + requiredKeys: const ['id', 'name'], + ); return WeightUnit( id: json['id'] as int, name: json['name'] as String, ); } -Map _$WeightUnitToJson(WeightUnit instance) => { +Map _$WeightUnitToJson(WeightUnit instance) => + { 'id': instance.id, 'name': instance.name, }; diff --git a/lib/models/workouts/workout_plan.g.dart b/lib/models/workouts/workout_plan.g.dart index 0a1dfb0a..ef156e3e 100644 --- a/lib/models/workouts/workout_plan.g.dart +++ b/lib/models/workouts/workout_plan.g.dart @@ -7,7 +7,10 @@ part of 'workout_plan.dart'; // ************************************************************************** WorkoutPlan _$WorkoutPlanFromJson(Map json) { - $checkKeys(json, requiredKeys: const ['id', 'creation_date', 'name', 'description']); + $checkKeys( + json, + requiredKeys: const ['id', 'creation_date', 'name', 'description'], + ); return WorkoutPlan( id: json['id'] as int?, creationDate: DateTime.parse(json['creation_date'] as String), @@ -16,7 +19,8 @@ WorkoutPlan _$WorkoutPlanFromJson(Map json) { ); } -Map _$WorkoutPlanToJson(WorkoutPlan instance) => { +Map _$WorkoutPlanToJson(WorkoutPlan instance) => + { 'id': instance.id, 'creation_date': instance.creationDate.toIso8601String(), 'name': instance.name, diff --git a/pubspec.lock b/pubspec.lock index cd1ac129..d179f097 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "22.0.0" + version: "30.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "1.7.2" + version: "2.7.0" android_metadata: dependency: "direct main" description: @@ -84,7 +84,7 @@ packages: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.5" build_runner_core: dependency: transitive description: @@ -175,7 +175,7 @@ packages: name: chewie url: "https://pub.dartlang.org" source: hosted - version: "1.2.2" + version: "1.1.0" chewie_audio: dependency: transitive description: @@ -252,14 +252,14 @@ packages: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.4" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.2.0" equatable: dependency: "direct main" description: @@ -367,7 +367,7 @@ packages: name: flutter_math_fork url: "https://pub.dartlang.org" source: hosted - version: "0.3.3+1" + version: "0.5.0" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -381,7 +381,7 @@ packages: name: flutter_svg url: "https://pub.dartlang.org" source: hosted - version: "0.22.0" + version: "0.23.0+1" flutter_test: dependency: "direct dev" description: flutter @@ -510,14 +510,14 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.3.0" json_serializable: dependency: "direct dev" description: name: json_serializable url: "https://pub.dartlang.org" source: hosted - version: "4.1.4" + version: "6.0.1" klizma: dependency: transitive description: @@ -580,7 +580,7 @@ packages: name: mockito url: "https://pub.dartlang.org" source: hosted - version: "5.0.15" + version: "5.0.16" nested: dependency: transitive description: @@ -706,7 +706,7 @@ packages: name: provider url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "6.0.1" pub_semver: dependency: transitive description: @@ -816,7 +816,14 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.1.1" + source_helper: + dependency: transitive + description: + name: source_helper + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" source_span: dependency: transitive description: @@ -963,7 +970,7 @@ packages: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "2.2.6" + version: "2.2.7" video_player_platform_interface: dependency: transitive description: @@ -1033,21 +1040,21 @@ packages: name: webview_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.3.0" webview_flutter_android: dependency: transitive description: name: webview_flutter_android url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.2.1" webview_flutter_platform_interface: dependency: transitive description: name: webview_flutter_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.4.0" webview_flutter_wkwebview: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index a521352d..5551bdb7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,10 +44,10 @@ dependencies: http: ^0.13.3 image_picker: ^0.8.4+1 intl: ^0.17.0 - json_annotation: ^4.0.1 + json_annotation: ^4.3.0 version: ^2.0.0 package_info: ^2.0.2 - provider: ^5.0.0 + provider: ^6.0.1 rive: ^0.7.33 shared_preferences: ^2.0.7 table_calendar: ^3.0.2 @@ -60,7 +60,7 @@ dev_dependencies: # sdk: flutter build_runner: ^2.1.2 flutter_launcher_icons: ^0.9.1 - json_serializable: ^4.1.4 + json_serializable: ^6.0.1 mockito: ^5.0.15 network_image_mock: ^2.0.1 flutter_lints: ^1.0.4 diff --git a/test/gallery/gallery_screen_test.mocks.dart b/test/gallery/gallery_screen_test.mocks.dart index b7864a90..1490b2f8 100644 --- a/test/gallery/gallery_screen_test.mocks.dart +++ b/test/gallery/gallery_screen_test.mocks.dart @@ -1,5 +1,5 @@ -// Mocks generated by Mockito 5.0.15 from annotations -// in wger/test/gallery_screen_test.dart. +// Mocks generated by Mockito 5.0.16 from annotations +// in wger/test/gallery/gallery_screen_test.dart. // Do not manually edit this file. import 'dart:async' as _i6; @@ -19,6 +19,7 @@ import 'package:wger/providers/gallery.dart' as _i4; // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types class _FakeAuthProvider_0 extends _i1.Fake implements _i2.AuthProvider {} @@ -37,31 +38,33 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider { } @override - List<_i5.Image> get images => - (super.noSuchMethod(Invocation.getter(#images), returnValue: <_i5.Image>[]) - as List<_i5.Image>); + List<_i5.Image> get images => (super.noSuchMethod(Invocation.getter(#images), + returnValue: <_i5.Image>[]) as List<_i5.Image>); @override set images(List<_i5.Image>? _images) => - super.noSuchMethod(Invocation.setter(#images, _images), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#images, _images), + returnValueForMissingStub: null); @override - _i2.AuthProvider get auth => - (super.noSuchMethod(Invocation.getter(#auth), returnValue: _FakeAuthProvider_0()) - as _i2.AuthProvider); + _i2.AuthProvider get auth => (super.noSuchMethod(Invocation.getter(#auth), + returnValue: _FakeAuthProvider_0()) as _i2.AuthProvider); @override set auth(_i2.AuthProvider? _auth) => - super.noSuchMethod(Invocation.setter(#auth, _auth), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#auth, _auth), + returnValueForMissingStub: null); @override - _i3.Client get client => - (super.noSuchMethod(Invocation.getter(#client), returnValue: _FakeClient_1()) as _i3.Client); + _i3.Client get client => (super.noSuchMethod(Invocation.getter(#client), + returnValue: _FakeClient_1()) as _i3.Client); @override set client(_i3.Client? _client) => - super.noSuchMethod(Invocation.setter(#client, _client), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#client, _client), + returnValueForMissingStub: null); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod(Invocation.method(#clear, []), + returnValueForMissingStub: null); @override _i6.Future fetchAndSetGallery() => (super.noSuchMethod(Invocation.method(#fetchAndSetGallery, []), @@ -83,43 +86,50 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider { returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i6.Future); @override - Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => + Uri makeUrl(String? path, + {int? id, String? objectMethod, Map? query}) => (super.noSuchMethod( - Invocation.method( - #makeUrl, [path], {#id: id, #objectMethod: objectMethod, #query: query}), + Invocation.method(#makeUrl, [path], + {#id: id, #objectMethod: objectMethod, #query: query}), returnValue: _FakeUri_2()) as Uri); @override - _i6.Future> fetch(Uri? uri) => - (super.noSuchMethod(Invocation.method(#fetch, [uri]), - returnValue: Future>.value({})) - as _i6.Future>); + _i6.Future> fetch(Uri? uri) => (super.noSuchMethod( + Invocation.method(#fetch, [uri]), + returnValue: Future>.value({})) + as _i6.Future>); @override _i6.Future> post(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#post, [data, uri]), - returnValue: Future>.value({})) + returnValue: + Future>.value({})) as _i6.Future>); @override - _i6.Future> patch(Map? data, Uri? uri) => + _i6.Future> patch( + Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#patch, [data, uri]), - returnValue: Future>.value({})) + returnValue: + Future>.value({})) as _i6.Future>); @override _i6.Future<_i3.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod(Invocation.method(#deleteRequest, [url, id]), - returnValue: Future<_i3.Response>.value(_FakeResponse_3())) as _i6.Future<_i3.Response>); + returnValue: Future<_i3.Response>.value(_FakeResponse_3())) + as _i6.Future<_i3.Response>); @override String toString() => super.toString(); @override - void addListener(_i8.VoidCallback? listener) => super - .noSuchMethod(Invocation.method(#addListener, [listener]), returnValueForMissingStub: null); + void addListener(_i8.VoidCallback? listener) => + super.noSuchMethod(Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null); @override void removeListener(_i8.VoidCallback? listener) => super.noSuchMethod(Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null); @override - void dispose() => - super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null); + void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), + returnValueForMissingStub: null); @override void notifyListeners() => - super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null); } diff --git a/test/measurements/measurement_categories_screen_test.mocks.dart b/test/measurements/measurement_categories_screen_test.mocks.dart index bc5f90a5..44427afa 100644 --- a/test/measurements/measurement_categories_screen_test.mocks.dart +++ b/test/measurements/measurement_categories_screen_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.0.15 from annotations +// Mocks generated by Mockito 5.0.16 from annotations // in wger/test/measurements/measurement_categories_screen_test.dart. // Do not manually edit this file. @@ -18,37 +18,43 @@ import 'package:wger/providers/measurement.dart' as _i4; // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types -class _FakeWgerBaseProvider_0 extends _i1.Fake implements _i2.WgerBaseProvider {} +class _FakeWgerBaseProvider_0 extends _i1.Fake implements _i2.WgerBaseProvider { +} -class _FakeMeasurementCategory_1 extends _i1.Fake implements _i3.MeasurementCategory {} +class _FakeMeasurementCategory_1 extends _i1.Fake + implements _i3.MeasurementCategory {} /// 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); } @override _i2.WgerBaseProvider get baseProvider => - (super.noSuchMethod(Invocation.getter(#baseProvider), returnValue: _FakeWgerBaseProvider_0()) - as _i2.WgerBaseProvider); + (super.noSuchMethod(Invocation.getter(#baseProvider), + returnValue: _FakeWgerBaseProvider_0()) as _i2.WgerBaseProvider); @override List<_i3.MeasurementCategory> get categories => - (super.noSuchMethod(Invocation.getter(#categories), returnValue: <_i3.MeasurementCategory>[]) + (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); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod(Invocation.method(#clear, []), + returnValueForMissingStub: null); @override - _i3.MeasurementCategory findCategoryById(int? id) => - (super.noSuchMethod(Invocation.method(#findCategoryById, [id]), - returnValue: _FakeMeasurementCategory_1()) as _i3.MeasurementCategory); + _i3.MeasurementCategory findCategoryById(int? id) => (super.noSuchMethod( + Invocation.method(#findCategoryById, [id]), + returnValue: _FakeMeasurementCategory_1()) as _i3.MeasurementCategory); @override _i5.Future fetchAndSetCategories() => (super.noSuchMethod(Invocation.method(#fetchAndSetCategories, []), @@ -60,10 +66,10 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i5.Future); @override - _i5.Future fetchAndSetAllCategoriesAndEntries() => - (super.noSuchMethod(Invocation.method(#fetchAndSetAllCategoriesAndEntries, []), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i5.Future); + _i5.Future fetchAndSetAllCategoriesAndEntries() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllCategoriesAndEntries, []), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i5.Future); @override _i5.Future addCategory(_i3.MeasurementCategory? category) => (super.noSuchMethod(Invocation.method(#addCategory, [category]), @@ -76,7 +82,8 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide returnValueForMissingStub: Future.value()) as _i5.Future); @override _i5.Future editCategory(int? id, String? newName, String? newUnit) => - (super.noSuchMethod(Invocation.method(#editCategory, [id, newName, newUnit]), + (super.noSuchMethod( + Invocation.method(#editCategory, [id, newName, newUnit]), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i5.Future); @override @@ -90,25 +97,28 @@ class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvide returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i5.Future); @override - _i5.Future editEntry( - int? id, int? categoryId, num? newValue, String? newNotes, DateTime? newDate) => + _i5.Future editEntry(int? id, int? categoryId, num? newValue, + String? newNotes, DateTime? newDate) => (super.noSuchMethod( - Invocation.method(#editEntry, [id, categoryId, newValue, newNotes, newDate]), + Invocation.method( + #editEntry, [id, categoryId, newValue, newNotes, newDate]), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i5.Future); @override String toString() => super.toString(); @override - void addListener(_i7.VoidCallback? listener) => super - .noSuchMethod(Invocation.method(#addListener, [listener]), returnValueForMissingStub: null); + void addListener(_i7.VoidCallback? listener) => + super.noSuchMethod(Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null); @override void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod(Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null); @override - void dispose() => - super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null); + void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), + returnValueForMissingStub: null); @override void notifyListeners() => - super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null); } diff --git a/test/measurements/measurement_provider_test.mocks.dart b/test/measurements/measurement_provider_test.mocks.dart index 3d0ae4e9..1f87fba2 100644 --- a/test/measurements/measurement_provider_test.mocks.dart +++ b/test/measurements/measurement_provider_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.0.15 from annotations +// Mocks generated by Mockito 5.0.16 from annotations // in wger/test/measurements/measurement_provider_test.dart. // Do not manually edit this file. @@ -16,6 +16,7 @@ import 'package:wger/providers/base_provider.dart' as _i4; // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types class _FakeAuthProvider_0 extends _i1.Fake implements _i2.AuthProvider {} @@ -34,43 +35,49 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { } @override - _i2.AuthProvider get auth => - (super.noSuchMethod(Invocation.getter(#auth), returnValue: _FakeAuthProvider_0()) - as _i2.AuthProvider); + _i2.AuthProvider get auth => (super.noSuchMethod(Invocation.getter(#auth), + returnValue: _FakeAuthProvider_0()) as _i2.AuthProvider); @override set auth(_i2.AuthProvider? _auth) => - super.noSuchMethod(Invocation.setter(#auth, _auth), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#auth, _auth), + returnValueForMissingStub: null); @override - _i3.Client get client => - (super.noSuchMethod(Invocation.getter(#client), returnValue: _FakeClient_1()) as _i3.Client); + _i3.Client get client => (super.noSuchMethod(Invocation.getter(#client), + returnValue: _FakeClient_1()) as _i3.Client); @override set client(_i3.Client? _client) => - super.noSuchMethod(Invocation.setter(#client, _client), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#client, _client), + returnValueForMissingStub: null); @override - Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => + Uri makeUrl(String? path, + {int? id, String? objectMethod, Map? query}) => (super.noSuchMethod( - Invocation.method( - #makeUrl, [path], {#id: id, #objectMethod: objectMethod, #query: query}), + Invocation.method(#makeUrl, [path], + {#id: id, #objectMethod: objectMethod, #query: query}), returnValue: _FakeUri_2()) as Uri); @override - _i5.Future> fetch(Uri? uri) => - (super.noSuchMethod(Invocation.method(#fetch, [uri]), - returnValue: Future>.value({})) - as _i5.Future>); + _i5.Future> fetch(Uri? uri) => (super.noSuchMethod( + Invocation.method(#fetch, [uri]), + returnValue: Future>.value({})) + as _i5.Future>); @override _i5.Future> post(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#post, [data, uri]), - returnValue: Future>.value({})) + returnValue: + Future>.value({})) as _i5.Future>); @override - _i5.Future> patch(Map? data, Uri? uri) => + _i5.Future> patch( + Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#patch, [data, uri]), - returnValue: Future>.value({})) + returnValue: + Future>.value({})) as _i5.Future>); @override _i5.Future<_i3.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod(Invocation.method(#deleteRequest, [url, id]), - returnValue: Future<_i3.Response>.value(_FakeResponse_3())) as _i5.Future<_i3.Response>); + returnValue: Future<_i3.Response>.value(_FakeResponse_3())) + as _i5.Future<_i3.Response>); @override String toString() => super.toString(); } diff --git a/test/nutrition/nutritional_plan_form_test.mocks.dart b/test/nutrition/nutritional_plan_form_test.mocks.dart index a878141a..b2b8f158 100644 --- a/test/nutrition/nutritional_plan_form_test.mocks.dart +++ b/test/nutrition/nutritional_plan_form_test.mocks.dart @@ -1,5 +1,5 @@ -// Mocks generated by Mockito 5.0.15 from annotations -// in wger/test/nutritional_plan_form_test.dart. +// Mocks generated by Mockito 5.0.16 from annotations +// in wger/test/nutrition/nutritional_plan_form_test.dart. // Do not manually edit this file. import 'dart:async' as _i9; @@ -21,6 +21,7 @@ import 'package:wger/providers/nutrition.dart' as _i8; // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types class _FakeAuthProvider_0 extends _i1.Fake implements _i2.AuthProvider {} @@ -41,38 +42,41 @@ class _FakeResponse_7 extends _i1.Fake implements _i3.Response {} /// A class which mocks [NutritionPlansProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansProvider { +class MockNutritionPlansProvider extends _i1.Mock + implements _i8.NutritionPlansProvider { MockNutritionPlansProvider() { _i1.throwOnMissingStub(this); } @override List<_i4.NutritionalPlan> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i4.NutritionalPlan>[]) - as List<_i4.NutritionalPlan>); + (super.noSuchMethod(Invocation.getter(#items), + returnValue: <_i4.NutritionalPlan>[]) as List<_i4.NutritionalPlan>); @override - _i2.AuthProvider get auth => - (super.noSuchMethod(Invocation.getter(#auth), returnValue: _FakeAuthProvider_0()) - as _i2.AuthProvider); + _i2.AuthProvider get auth => (super.noSuchMethod(Invocation.getter(#auth), + returnValue: _FakeAuthProvider_0()) as _i2.AuthProvider); @override set auth(_i2.AuthProvider? _auth) => - super.noSuchMethod(Invocation.setter(#auth, _auth), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#auth, _auth), + returnValueForMissingStub: null); @override - _i3.Client get client => - (super.noSuchMethod(Invocation.getter(#client), returnValue: _FakeClient_1()) as _i3.Client); + _i3.Client get client => (super.noSuchMethod(Invocation.getter(#client), + returnValue: _FakeClient_1()) as _i3.Client); @override set client(_i3.Client? _client) => - super.noSuchMethod(Invocation.setter(#client, _client), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#client, _client), + returnValueForMissingStub: null); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod(Invocation.method(#clear, []), + returnValueForMissingStub: null); @override _i4.NutritionalPlan findById(int? id) => - (super.noSuchMethod(Invocation.method(#findById, [id]), returnValue: _FakeNutritionalPlan_2()) - as _i4.NutritionalPlan); + (super.noSuchMethod(Invocation.method(#findById, [id]), + returnValue: _FakeNutritionalPlan_2()) as _i4.NutritionalPlan); @override _i5.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(#findMealById, [id])) as _i5.Meal?); @@ -89,17 +93,20 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP @override _i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(Invocation.method(#fetchAndSetPlanSparse, [planId]), - returnValue: Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2())) + returnValue: + Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2())) as _i9.Future<_i4.NutritionalPlan>); @override _i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(Invocation.method(#fetchAndSetPlanFull, [planId]), - returnValue: Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2())) + returnValue: + Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2())) as _i9.Future<_i4.NutritionalPlan>); @override _i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) => (super.noSuchMethod(Invocation.method(#addPlan, [planData]), - returnValue: Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2())) + returnValue: + Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2())) as _i9.Future<_i4.NutritionalPlan>); @override _i9.Future editPlan(_i4.NutritionalPlan? plan) => @@ -107,26 +114,31 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i9.Future); @override - _i9.Future deletePlan(int? id) => (super.noSuchMethod(Invocation.method(#deletePlan, [id]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i9.Future); + _i9.Future deletePlan(int? id) => + (super.noSuchMethod(Invocation.method(#deletePlan, [id]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i9.Future); @override _i9.Future<_i5.Meal> addMeal(_i5.Meal? meal, int? planId) => (super.noSuchMethod(Invocation.method(#addMeal, [meal, planId]), - returnValue: Future<_i5.Meal>.value(_FakeMeal_3())) as _i9.Future<_i5.Meal>); + returnValue: Future<_i5.Meal>.value(_FakeMeal_3())) + as _i9.Future<_i5.Meal>); @override _i9.Future<_i5.Meal> editMeal(_i5.Meal? meal) => (super.noSuchMethod(Invocation.method(#editMeal, [meal]), - returnValue: Future<_i5.Meal>.value(_FakeMeal_3())) as _i9.Future<_i5.Meal>); + returnValue: Future<_i5.Meal>.value(_FakeMeal_3())) + as _i9.Future<_i5.Meal>); @override _i9.Future deleteMeal(_i5.Meal? meal) => (super.noSuchMethod(Invocation.method(#deleteMeal, [meal]), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i9.Future); @override - _i9.Future<_i6.MealItem> addMealItem(_i6.MealItem? mealItem, _i5.Meal? meal) => + _i9.Future<_i6.MealItem> addMealItem( + _i6.MealItem? mealItem, _i5.Meal? meal) => (super.noSuchMethod(Invocation.method(#addMealItem, [mealItem, meal]), - returnValue: Future<_i6.MealItem>.value(_FakeMealItem_4())) as _i9.Future<_i6.MealItem>); + returnValue: Future<_i6.MealItem>.value(_FakeMealItem_4())) + as _i9.Future<_i6.MealItem>); @override _i9.Future deleteMealItem(_i6.MealItem? mealItem) => (super.noSuchMethod(Invocation.method(#deleteMealItem, [mealItem]), @@ -143,15 +155,25 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i9.Future); @override - _i9.Future> searchIngredient(String? name, [String? languageCode = r'en']) => - (super.noSuchMethod(Invocation.method(#searchIngredient, [name, languageCode]), - returnValue: Future>.value([])) as _i9.Future>); + _i9.Future> searchIngredient(String? name, + [String? languageCode = r'en']) => + (super.noSuchMethod( + Invocation.method(#searchIngredient, [name, languageCode]), + returnValue: Future>.value([])) + as _i9.Future>); @override _i9.Future logMealToDiary(_i5.Meal? meal) => (super.noSuchMethod(Invocation.method(#logMealToDiary, [meal]), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i9.Future); @override + _i9.Future logIngredentToDiary(_i6.MealItem? mealItem, int? planId, + [DateTime? dateTime]) => + (super.noSuchMethod( + Invocation.method(#logIngredentToDiary, [mealItem, planId, dateTime]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i9.Future); + @override _i9.Future deleteLog(int? logId, int? planId) => (super.noSuchMethod(Invocation.method(#deleteLog, [logId, planId]), returnValue: Future.value(), @@ -162,43 +184,50 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i9.Future); @override - Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => + Uri makeUrl(String? path, + {int? id, String? objectMethod, Map? query}) => (super.noSuchMethod( - Invocation.method( - #makeUrl, [path], {#id: id, #objectMethod: objectMethod, #query: query}), + Invocation.method(#makeUrl, [path], + {#id: id, #objectMethod: objectMethod, #query: query}), returnValue: _FakeUri_6()) as Uri); @override - _i9.Future> fetch(Uri? uri) => - (super.noSuchMethod(Invocation.method(#fetch, [uri]), - returnValue: Future>.value({})) - as _i9.Future>); + _i9.Future> fetch(Uri? uri) => (super.noSuchMethod( + Invocation.method(#fetch, [uri]), + returnValue: Future>.value({})) + as _i9.Future>); @override _i9.Future> post(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#post, [data, uri]), - returnValue: Future>.value({})) + returnValue: + Future>.value({})) as _i9.Future>); @override - _i9.Future> patch(Map? data, Uri? uri) => + _i9.Future> patch( + Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#patch, [data, uri]), - returnValue: Future>.value({})) + returnValue: + Future>.value({})) as _i9.Future>); @override _i9.Future<_i3.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod(Invocation.method(#deleteRequest, [url, id]), - returnValue: Future<_i3.Response>.value(_FakeResponse_7())) as _i9.Future<_i3.Response>); + returnValue: Future<_i3.Response>.value(_FakeResponse_7())) + as _i9.Future<_i3.Response>); @override String toString() => super.toString(); @override - void addListener(_i10.VoidCallback? listener) => super - .noSuchMethod(Invocation.method(#addListener, [listener]), returnValueForMissingStub: null); + void addListener(_i10.VoidCallback? listener) => + super.noSuchMethod(Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null); @override void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod(Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null); @override - void dispose() => - super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null); + void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), + returnValueForMissingStub: null); @override void notifyListeners() => - super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null); } diff --git a/test/other/base_provider_test.mocks.dart b/test/other/base_provider_test.mocks.dart index c64ebdcf..de3e7152 100644 --- a/test/other/base_provider_test.mocks.dart +++ b/test/other/base_provider_test.mocks.dart @@ -1,5 +1,5 @@ -// Mocks generated by Mockito 5.0.15 from annotations -// in wger/test/base_provider_test.dart. +// Mocks generated by Mockito 5.0.16 from annotations +// in wger/test/other/base_provider_test.dart. // Do not manually edit this file. import 'dart:async' as _i5; @@ -19,10 +19,12 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types class _FakeResponse_0 extends _i1.Fake implements _i2.Response {} -class _FakeStreamedResponse_1 extends _i1.Fake implements _i3.StreamedResponse {} +class _FakeStreamedResponse_1 extends _i1.Fake implements _i3.StreamedResponse { +} /// A class which mocks [Client]. /// @@ -35,51 +37,73 @@ class MockClient extends _i1.Mock implements _i4.Client { @override _i5.Future<_i2.Response> head(Uri? url, {Map? headers}) => (super.noSuchMethod(Invocation.method(#head, [url], {#headers: headers}), - returnValue: Future<_i2.Response>.value(_FakeResponse_0())) as _i5.Future<_i2.Response>); + returnValue: Future<_i2.Response>.value(_FakeResponse_0())) + as _i5.Future<_i2.Response>); @override _i5.Future<_i2.Response> get(Uri? url, {Map? headers}) => (super.noSuchMethod(Invocation.method(#get, [url], {#headers: headers}), - returnValue: Future<_i2.Response>.value(_FakeResponse_0())) as _i5.Future<_i2.Response>); + returnValue: Future<_i2.Response>.value(_FakeResponse_0())) + as _i5.Future<_i2.Response>); @override _i5.Future<_i2.Response> post(Uri? url, - {Map? headers, Object? body, _i6.Encoding? encoding}) => + {Map? headers, + Object? body, + _i6.Encoding? encoding}) => (super.noSuchMethod( - Invocation.method(#post, [url], {#headers: headers, #body: body, #encoding: encoding}), - returnValue: Future<_i2.Response>.value(_FakeResponse_0())) as _i5.Future<_i2.Response>); + Invocation.method(#post, [url], + {#headers: headers, #body: body, #encoding: encoding}), + returnValue: Future<_i2.Response>.value(_FakeResponse_0())) + as _i5.Future<_i2.Response>); @override _i5.Future<_i2.Response> put(Uri? url, - {Map? headers, Object? body, _i6.Encoding? encoding}) => + {Map? headers, + Object? body, + _i6.Encoding? encoding}) => (super.noSuchMethod( - Invocation.method(#put, [url], {#headers: headers, #body: body, #encoding: encoding}), - returnValue: Future<_i2.Response>.value(_FakeResponse_0())) as _i5.Future<_i2.Response>); + Invocation.method(#put, [url], + {#headers: headers, #body: body, #encoding: encoding}), + returnValue: Future<_i2.Response>.value(_FakeResponse_0())) + as _i5.Future<_i2.Response>); @override _i5.Future<_i2.Response> patch(Uri? url, - {Map? headers, Object? body, _i6.Encoding? encoding}) => + {Map? headers, + Object? body, + _i6.Encoding? encoding}) => (super.noSuchMethod( - Invocation.method(#patch, [url], {#headers: headers, #body: body, #encoding: encoding}), - returnValue: Future<_i2.Response>.value(_FakeResponse_0())) as _i5.Future<_i2.Response>); + Invocation.method(#patch, [url], + {#headers: headers, #body: body, #encoding: encoding}), + returnValue: Future<_i2.Response>.value(_FakeResponse_0())) + as _i5.Future<_i2.Response>); @override _i5.Future<_i2.Response> delete(Uri? url, - {Map? headers, Object? body, _i6.Encoding? encoding}) => + {Map? headers, + Object? body, + _i6.Encoding? encoding}) => (super.noSuchMethod( - Invocation.method(#delete, [url], {#headers: headers, #body: body, #encoding: encoding}), - returnValue: Future<_i2.Response>.value(_FakeResponse_0())) as _i5.Future<_i2.Response>); + Invocation.method(#delete, [url], + {#headers: headers, #body: body, #encoding: encoding}), + returnValue: Future<_i2.Response>.value(_FakeResponse_0())) + as _i5.Future<_i2.Response>); @override _i5.Future read(Uri? url, {Map? headers}) => (super.noSuchMethod(Invocation.method(#read, [url], {#headers: headers}), returnValue: Future.value('')) as _i5.Future); @override - _i5.Future<_i7.Uint8List> readBytes(Uri? url, {Map? headers}) => - (super.noSuchMethod(Invocation.method(#readBytes, [url], {#headers: headers}), - returnValue: Future<_i7.Uint8List>.value(_i7.Uint8List(0))) as _i5.Future<_i7.Uint8List>); + _i5.Future<_i7.Uint8List> readBytes(Uri? url, + {Map? headers}) => + (super.noSuchMethod( + Invocation.method(#readBytes, [url], {#headers: headers}), + returnValue: Future<_i7.Uint8List>.value(_i7.Uint8List(0))) + as _i5.Future<_i7.Uint8List>); @override _i5.Future<_i3.StreamedResponse> send(_i8.BaseRequest? request) => (super.noSuchMethod(Invocation.method(#send, [request]), - returnValue: Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_1())) + returnValue: + Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_1())) as _i5.Future<_i3.StreamedResponse>); @override - void close() => - super.noSuchMethod(Invocation.method(#close, []), returnValueForMissingStub: null); + void close() => super.noSuchMethod(Invocation.method(#close, []), + returnValueForMissingStub: null); @override String toString() => super.toString(); } diff --git a/test/workout/workout_form_test.mocks.dart b/test/workout/workout_form_test.mocks.dart index 9bfd1d08..0e935afc 100644 --- a/test/workout/workout_form_test.mocks.dart +++ b/test/workout/workout_form_test.mocks.dart @@ -1,5 +1,5 @@ -// Mocks generated by Mockito 5.0.15 from annotations -// in wger/test/workout_form_test.dart. +// Mocks generated by Mockito 5.0.16 from annotations +// in wger/test/workout/workout_form_test.dart. // Do not manually edit this file. import 'dart:async' as _i13; @@ -26,6 +26,7 @@ import 'package:wger/providers/workout_plans.dart' as _i12; // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types class _FakeWeightUnit_0 extends _i1.Fake implements _i2.WeightUnit {} @@ -54,73 +55,79 @@ class _FakeResponse_11 extends _i1.Fake implements _i5.Response {} /// A class which mocks [WorkoutPlansProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockWorkoutPlansProvider extends _i1.Mock implements _i12.WorkoutPlansProvider { +class MockWorkoutPlansProvider extends _i1.Mock + implements _i12.WorkoutPlansProvider { MockWorkoutPlansProvider() { _i1.throwOnMissingStub(this); } @override List<_i6.WorkoutPlan> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i6.WorkoutPlan>[]) - as List<_i6.WorkoutPlan>); + (super.noSuchMethod(Invocation.getter(#items), + returnValue: <_i6.WorkoutPlan>[]) as List<_i6.WorkoutPlan>); @override List<_i2.WeightUnit> get weightUnits => - (super.noSuchMethod(Invocation.getter(#weightUnits), returnValue: <_i2.WeightUnit>[]) - as List<_i2.WeightUnit>); + (super.noSuchMethod(Invocation.getter(#weightUnits), + returnValue: <_i2.WeightUnit>[]) as List<_i2.WeightUnit>); @override _i2.WeightUnit get defaultWeightUnit => - (super.noSuchMethod(Invocation.getter(#defaultWeightUnit), returnValue: _FakeWeightUnit_0()) - as _i2.WeightUnit); + (super.noSuchMethod(Invocation.getter(#defaultWeightUnit), + returnValue: _FakeWeightUnit_0()) as _i2.WeightUnit); @override List<_i3.RepetitionUnit> get repetitionUnits => - (super.noSuchMethod(Invocation.getter(#repetitionUnits), returnValue: <_i3.RepetitionUnit>[]) - as List<_i3.RepetitionUnit>); + (super.noSuchMethod(Invocation.getter(#repetitionUnits), + returnValue: <_i3.RepetitionUnit>[]) as List<_i3.RepetitionUnit>); @override _i3.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod(Invocation.getter(#defaultRepetitionUnit), returnValue: _FakeRepetitionUnit_1()) as _i3.RepetitionUnit); @override - _i4.AuthProvider get auth => - (super.noSuchMethod(Invocation.getter(#auth), returnValue: _FakeAuthProvider_2()) - as _i4.AuthProvider); + _i4.AuthProvider get auth => (super.noSuchMethod(Invocation.getter(#auth), + returnValue: _FakeAuthProvider_2()) as _i4.AuthProvider); @override set auth(_i4.AuthProvider? _auth) => - super.noSuchMethod(Invocation.setter(#auth, _auth), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#auth, _auth), + returnValueForMissingStub: null); @override - _i5.Client get client => - (super.noSuchMethod(Invocation.getter(#client), returnValue: _FakeClient_3()) as _i5.Client); + _i5.Client get client => (super.noSuchMethod(Invocation.getter(#client), + returnValue: _FakeClient_3()) as _i5.Client); @override set client(_i5.Client? _client) => - super.noSuchMethod(Invocation.setter(#client, _client), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#client, _client), + returnValueForMissingStub: null); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - void clear() => - super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); + void clear() => super.noSuchMethod(Invocation.method(#clear, []), + returnValueForMissingStub: null); @override _i6.WorkoutPlan findById(int? id) => - (super.noSuchMethod(Invocation.method(#findById, [id]), returnValue: _FakeWorkoutPlan_4()) - as _i6.WorkoutPlan); + (super.noSuchMethod(Invocation.method(#findById, [id]), + returnValue: _FakeWorkoutPlan_4()) as _i6.WorkoutPlan); @override - int findIndexById(int? id) => - (super.noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) as int); + int findIndexById(int? id) => (super + .noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) + as int); @override void setCurrentPlan(int? id) => - super.noSuchMethod(Invocation.method(#setCurrentPlan, [id]), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#setCurrentPlan, [id]), + returnValueForMissingStub: null); @override void resetCurrentPlan() => - super.noSuchMethod(Invocation.method(#resetCurrentPlan, []), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#resetCurrentPlan, []), + returnValueForMissingStub: null); @override - _i13.Future fetchAndSetAllPlansFull() => - (super.noSuchMethod(Invocation.method(#fetchAndSetAllPlansFull, []), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future fetchAndSetAllPlansFull() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllPlansFull, []), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override - _i13.Future fetchAndSetAllPlansSparse() => - (super.noSuchMethod(Invocation.method(#fetchAndSetAllPlansSparse, []), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllPlansSparse, []), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override _i13.Future<_i6.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(Invocation.method(#fetchAndSetPlanSparse, [planId]), @@ -128,7 +135,8 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i12.WorkoutPlansProv as _i13.Future<_i6.WorkoutPlan>); @override _i13.Future<_i6.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => - (super.noSuchMethod(Invocation.method(#fetchAndSetWorkoutPlanFull, [workoutId]), + (super.noSuchMethod( + Invocation.method(#fetchAndSetWorkoutPlanFull, [workoutId]), returnValue: Future<_i6.WorkoutPlan>.value(_FakeWorkoutPlan_4())) as _i13.Future<_i6.WorkoutPlan>); @override @@ -139,78 +147,89 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i12.WorkoutPlansProv @override _i13.Future editWorkout(_i6.WorkoutPlan? workout) => (super.noSuchMethod(Invocation.method(#editWorkout, [workout]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) + as _i13.Future); @override - _i13.Future deleteWorkout(int? id) => - (super.noSuchMethod(Invocation.method(#deleteWorkout, [id]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future deleteWorkout(int? id) => (super.noSuchMethod( + Invocation.method(#deleteWorkout, [id]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override _i13.Future> fetchLogData( _i6.WorkoutPlan? workout, _i14.Exercise? exercise) => (super.noSuchMethod(Invocation.method(#fetchLogData, [workout, exercise]), - returnValue: Future>.value({})) + returnValue: + Future>.value({})) as _i13.Future>); @override - _i13.Future fetchAndSetRepetitionUnits() => - (super.noSuchMethod(Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); - @override - _i13.Future fetchAndSetWeightUnits() => - (super.noSuchMethod(Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); - @override - _i13.Future fetchAndSetUnits() => - (super.noSuchMethod(Invocation.method(#fetchAndSetUnits, []), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); - @override - _i13.Future<_i7.Day> addDay(_i7.Day? day, _i6.WorkoutPlan? workout) => - (super.noSuchMethod(Invocation.method(#addDay, [day, workout]), - returnValue: Future<_i7.Day>.value(_FakeDay_5())) as _i13.Future<_i7.Day>); - @override - _i13.Future editDay(_i7.Day? day) => (super.noSuchMethod(Invocation.method(#editDay, [day]), + _i13.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetRepetitionUnits, []), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i13.Future); @override - _i13.Future deleteDay(_i7.Day? day) => - (super.noSuchMethod(Invocation.method(#deleteDay, [day]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future fetchAndSetWeightUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetWeightUnits, []), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); + @override + _i13.Future fetchAndSetUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetUnits, []), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); + @override + _i13.Future<_i7.Day> addDay(_i7.Day? day, _i6.WorkoutPlan? workout) => + (super.noSuchMethod(Invocation.method(#addDay, [day, workout]), + returnValue: Future<_i7.Day>.value(_FakeDay_5())) + as _i13.Future<_i7.Day>); + @override + _i13.Future editDay(_i7.Day? day) => (super.noSuchMethod( + Invocation.method(#editDay, [day]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); + @override + _i13.Future deleteDay(_i7.Day? day) => (super.noSuchMethod( + Invocation.method(#deleteDay, [day]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override _i13.Future<_i8.Set> addSet(_i8.Set? workoutSet) => (super.noSuchMethod(Invocation.method(#addSet, [workoutSet]), - returnValue: Future<_i8.Set>.value(_FakeSet_6())) as _i13.Future<_i8.Set>); + returnValue: Future<_i8.Set>.value(_FakeSet_6())) + as _i13.Future<_i8.Set>); @override - _i13.Future editSet(_i8.Set? workoutSet) => - (super.noSuchMethod(Invocation.method(#editSet, [workoutSet]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future editSet(_i8.Set? workoutSet) => (super.noSuchMethod( + Invocation.method(#editSet, [workoutSet]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override - _i13.Future> reorderSets(List<_i8.Set>? sets, int? startIndex) => + _i13.Future> reorderSets( + List<_i8.Set>? sets, int? startIndex) => (super.noSuchMethod(Invocation.method(#reorderSets, [sets, startIndex]), - returnValue: Future>.value(<_i8.Set>[])) as _i13.Future>); + returnValue: Future>.value(<_i8.Set>[])) + as _i13.Future>); @override - _i13.Future fetchComputedSettings(_i8.Set? workoutSet) => - (super.noSuchMethod(Invocation.method(#fetchComputedSettings, [workoutSet]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future fetchComputedSettings(_i8.Set? workoutSet) => (super + .noSuchMethod(Invocation.method(#fetchComputedSettings, [workoutSet]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) + as _i13.Future); @override - _i13.Future fetchSmartText(_i8.Set? workoutSet, _i14.Exercise? exercise) => - (super.noSuchMethod(Invocation.method(#fetchSmartText, [workoutSet, exercise]), + _i13.Future fetchSmartText( + _i8.Set? workoutSet, _i14.Exercise? exercise) => + (super.noSuchMethod( + Invocation.method(#fetchSmartText, [workoutSet, exercise]), returnValue: Future.value('')) as _i13.Future); @override - _i13.Future deleteSet(_i8.Set? workoutSet) => - (super.noSuchMethod(Invocation.method(#deleteSet, [workoutSet]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future deleteSet(_i8.Set? workoutSet) => (super.noSuchMethod( + Invocation.method(#deleteSet, [workoutSet]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override _i13.Future<_i9.Setting> addSetting(_i9.Setting? workoutSetting) => (super.noSuchMethod(Invocation.method(#addSetting, [workoutSetting]), - returnValue: Future<_i9.Setting>.value(_FakeSetting_7())) as _i13.Future<_i9.Setting>); + returnValue: Future<_i9.Setting>.value(_FakeSetting_7())) + as _i13.Future<_i9.Setting>); @override _i13.Future fetchSessionData() => (super.noSuchMethod(Invocation.method(#fetchSessionData, []), @@ -218,55 +237,65 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i12.WorkoutPlansProv @override _i13.Future<_i10.WorkoutSession> addSession(_i10.WorkoutSession? session) => (super.noSuchMethod(Invocation.method(#addSession, [session]), - returnValue: Future<_i10.WorkoutSession>.value(_FakeWorkoutSession_8())) + returnValue: + Future<_i10.WorkoutSession>.value(_FakeWorkoutSession_8())) as _i13.Future<_i10.WorkoutSession>); @override _i13.Future<_i11.Log> addLog(_i11.Log? log) => (super.noSuchMethod(Invocation.method(#addLog, [log]), - returnValue: Future<_i11.Log>.value(_FakeLog_9())) as _i13.Future<_i11.Log>); + returnValue: Future<_i11.Log>.value(_FakeLog_9())) + as _i13.Future<_i11.Log>); @override - _i13.Future deleteLog(_i11.Log? log) => - (super.noSuchMethod(Invocation.method(#deleteLog, [log]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future deleteLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#deleteLog, [log]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override - Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => + Uri makeUrl(String? path, + {int? id, String? objectMethod, Map? query}) => (super.noSuchMethod( - Invocation.method( - #makeUrl, [path], {#id: id, #objectMethod: objectMethod, #query: query}), + Invocation.method(#makeUrl, [path], + {#id: id, #objectMethod: objectMethod, #query: query}), returnValue: _FakeUri_10()) as Uri); @override - _i13.Future> fetch(Uri? uri) => - (super.noSuchMethod(Invocation.method(#fetch, [uri]), - returnValue: Future>.value({})) - as _i13.Future>); + _i13.Future> fetch(Uri? uri) => (super.noSuchMethod( + Invocation.method(#fetch, [uri]), + returnValue: Future>.value({})) + as _i13.Future>); @override - _i13.Future> post(Map? data, Uri? uri) => + _i13.Future> post( + Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#post, [data, uri]), - returnValue: Future>.value({})) + returnValue: + Future>.value({})) as _i13.Future>); @override - _i13.Future> patch(Map? data, Uri? uri) => + _i13.Future> patch( + Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#patch, [data, uri]), - returnValue: Future>.value({})) + returnValue: + Future>.value({})) as _i13.Future>); @override - _i13.Future<_i5.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod( - Invocation.method(#deleteRequest, [url, id]), - returnValue: Future<_i5.Response>.value(_FakeResponse_11())) as _i13.Future<_i5.Response>); + _i13.Future<_i5.Response> deleteRequest(String? url, int? id) => + (super.noSuchMethod(Invocation.method(#deleteRequest, [url, id]), + returnValue: Future<_i5.Response>.value(_FakeResponse_11())) + as _i13.Future<_i5.Response>); @override String toString() => super.toString(); @override - void addListener(_i15.VoidCallback? listener) => super - .noSuchMethod(Invocation.method(#addListener, [listener]), returnValueForMissingStub: null); + void addListener(_i15.VoidCallback? listener) => + super.noSuchMethod(Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null); @override void removeListener(_i15.VoidCallback? listener) => super.noSuchMethod(Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null); @override - void dispose() => - super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null); + void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), + returnValueForMissingStub: null); @override void notifyListeners() => - super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null); } diff --git a/test/workout/workout_set_form_test.mocks.dart b/test/workout/workout_set_form_test.mocks.dart index b6cef929..3c5a2667 100644 --- a/test/workout/workout_set_form_test.mocks.dart +++ b/test/workout/workout_set_form_test.mocks.dart @@ -1,5 +1,5 @@ -// Mocks generated by Mockito 5.0.15 from annotations -// in wger/test/workout_set_form_test.dart. +// Mocks generated by Mockito 5.0.16 from annotations +// in wger/test/workout/workout_set_form_test.dart. // Do not manually edit this file. import 'dart:async' as _i6; @@ -18,6 +18,7 @@ import 'package:wger/providers/exercises.dart' as _i5; // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types class _FakeAuthProvider_0 extends _i1.Fake implements _i2.AuthProvider {} @@ -38,29 +39,30 @@ class MockExercisesProvider extends _i1.Mock implements _i5.ExercisesProvider { } @override - List<_i4.Exercise> get items => - (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i4.Exercise>[]) - as List<_i4.Exercise>); + List<_i4.Exercise> get items => (super.noSuchMethod(Invocation.getter(#items), + returnValue: <_i4.Exercise>[]) as List<_i4.Exercise>); @override - _i2.AuthProvider get auth => - (super.noSuchMethod(Invocation.getter(#auth), returnValue: _FakeAuthProvider_0()) - as _i2.AuthProvider); + _i2.AuthProvider get auth => (super.noSuchMethod(Invocation.getter(#auth), + returnValue: _FakeAuthProvider_0()) as _i2.AuthProvider); @override set auth(_i2.AuthProvider? _auth) => - super.noSuchMethod(Invocation.setter(#auth, _auth), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#auth, _auth), + returnValueForMissingStub: null); @override - _i3.Client get client => - (super.noSuchMethod(Invocation.getter(#client), returnValue: _FakeClient_1()) as _i3.Client); + _i3.Client get client => (super.noSuchMethod(Invocation.getter(#client), + returnValue: _FakeClient_1()) as _i3.Client); @override set client(_i3.Client? _client) => - super.noSuchMethod(Invocation.setter(#client, _client), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#client, _client), + returnValueForMissingStub: null); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) + as bool); @override - _i4.Exercise findById(int? exerciseId) => (super - .noSuchMethod(Invocation.method(#findById, [exerciseId]), returnValue: _FakeExercise_2()) - as _i4.Exercise); + _i4.Exercise findById(int? exerciseId) => + (super.noSuchMethod(Invocation.method(#findById, [exerciseId]), + returnValue: _FakeExercise_2()) as _i4.Exercise); @override _i6.Future fetchAndSetCategories() => (super.noSuchMethod(Invocation.method(#fetchAndSetCategories, []), @@ -79,54 +81,65 @@ class MockExercisesProvider extends _i1.Mock implements _i5.ExercisesProvider { @override _i6.Future<_i4.Exercise> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod(Invocation.method(#fetchAndSetExercise, [exerciseId]), - returnValue: Future<_i4.Exercise>.value(_FakeExercise_2())) as _i6.Future<_i4.Exercise>); + returnValue: Future<_i4.Exercise>.value(_FakeExercise_2())) + as _i6.Future<_i4.Exercise>); @override _i6.Future fetchAndSetExercises() => (super.noSuchMethod(Invocation.method(#fetchAndSetExercises, []), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i6.Future); @override - _i6.Future> searchExercise(String? name, [String? languageCode = r'en']) => - (super.noSuchMethod(Invocation.method(#searchExercise, [name, languageCode]), - returnValue: Future>.value([])) as _i6.Future>); - @override - Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => + _i6.Future> searchExercise(String? name, + [String? languageCode = r'en']) => (super.noSuchMethod( - Invocation.method( - #makeUrl, [path], {#id: id, #objectMethod: objectMethod, #query: query}), + Invocation.method(#searchExercise, [name, languageCode]), + returnValue: Future>.value([])) + as _i6.Future>); + @override + Uri makeUrl(String? path, + {int? id, String? objectMethod, Map? query}) => + (super.noSuchMethod( + Invocation.method(#makeUrl, [path], + {#id: id, #objectMethod: objectMethod, #query: query}), returnValue: _FakeUri_3()) as Uri); @override - _i6.Future> fetch(Uri? uri) => - (super.noSuchMethod(Invocation.method(#fetch, [uri]), - returnValue: Future>.value({})) - as _i6.Future>); + _i6.Future> fetch(Uri? uri) => (super.noSuchMethod( + Invocation.method(#fetch, [uri]), + returnValue: Future>.value({})) + as _i6.Future>); @override _i6.Future> post(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#post, [data, uri]), - returnValue: Future>.value({})) + returnValue: + Future>.value({})) as _i6.Future>); @override - _i6.Future> patch(Map? data, Uri? uri) => + _i6.Future> patch( + Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#patch, [data, uri]), - returnValue: Future>.value({})) + returnValue: + Future>.value({})) as _i6.Future>); @override _i6.Future<_i3.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod(Invocation.method(#deleteRequest, [url, id]), - returnValue: Future<_i3.Response>.value(_FakeResponse_4())) as _i6.Future<_i3.Response>); + returnValue: Future<_i3.Response>.value(_FakeResponse_4())) + as _i6.Future<_i3.Response>); @override String toString() => super.toString(); @override - void addListener(_i7.VoidCallback? listener) => super - .noSuchMethod(Invocation.method(#addListener, [listener]), returnValueForMissingStub: null); + void addListener(_i7.VoidCallback? listener) => + super.noSuchMethod(Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null); @override void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod(Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null); @override - void dispose() => - super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null); + void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), + returnValueForMissingStub: null); @override void notifyListeners() => - super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null); } From ab885b114557b736b8e3d9516601f377fba7f59b Mon Sep 17 00:00:00 2001 From: Github-actions Date: Wed, 10 Nov 2021 14:19:52 +0000 Subject: [PATCH 40/49] Automatic linting --- lib/models/body_weight/weight_entry.g.dart | 3 +- lib/models/exercises/category.g.dart | 3 +- lib/models/exercises/exercise.g.dart | 6 +- lib/models/exercises/image.g.dart | 3 +- .../measurements/measurement_category.g.dart | 4 +- .../measurements/measurement_entry.g.dart | 3 +- lib/models/nutrition/ingredient.g.dart | 3 +- .../nutrition/ingredient_weight_unit.g.dart | 6 +- lib/models/nutrition/log.g.dart | 9 +- lib/models/nutrition/nutritional_plan.g.dart | 3 +- lib/models/nutrition/weight_unit.g.dart | 3 +- lib/models/workouts/repetition_unit.g.dart | 3 +- lib/models/workouts/session.g.dart | 12 +- lib/models/workouts/weight_unit.g.dart | 3 +- lib/models/workouts/workout_plan.g.dart | 3 +- test/gallery/gallery_screen_test.mocks.dart | 69 +++--- ...surement_categories_screen_test.mocks.dart | 59 ++--- .../measurement_provider_test.mocks.dart | 42 ++-- .../nutritional_plan_form_test.mocks.dart | 115 ++++----- test/other/base_provider_test.mocks.dart | 65 ++--- test/workout/workout_form_test.mocks.dart | 232 ++++++++---------- test/workout/workout_set_form_test.mocks.dart | 80 +++--- 22 files changed, 294 insertions(+), 435 deletions(-) diff --git a/lib/models/body_weight/weight_entry.g.dart b/lib/models/body_weight/weight_entry.g.dart index 60ee02c9..d1152d20 100644 --- a/lib/models/body_weight/weight_entry.g.dart +++ b/lib/models/body_weight/weight_entry.g.dart @@ -18,8 +18,7 @@ WeightEntry _$WeightEntryFromJson(Map json) { ); } -Map _$WeightEntryToJson(WeightEntry instance) => - { +Map _$WeightEntryToJson(WeightEntry instance) => { 'id': instance.id, 'weight': numToString(instance.weight), 'date': toDate(instance.date), diff --git a/lib/models/exercises/category.g.dart b/lib/models/exercises/category.g.dart index 19383107..915120d1 100644 --- a/lib/models/exercises/category.g.dart +++ b/lib/models/exercises/category.g.dart @@ -17,8 +17,7 @@ ExerciseCategory _$ExerciseCategoryFromJson(Map json) { ); } -Map _$ExerciseCategoryToJson(ExerciseCategory instance) => - { +Map _$ExerciseCategoryToJson(ExerciseCategory instance) => { 'id': instance.id, 'name': instance.name, }; diff --git a/lib/models/exercises/exercise.g.dart b/lib/models/exercises/exercise.g.dart index 44575077..2b0bf68e 100644 --- a/lib/models/exercises/exercise.g.dart +++ b/lib/models/exercises/exercise.g.dart @@ -44,8 +44,7 @@ Exercise _$ExerciseFromJson(Map json) { tips: (json['comments'] as List?) ?.map((e) => Comment.fromJson(e as Map)) .toList(), - )..categoryObj = - ExerciseCategory.fromJson(json['category'] as Map); + )..categoryObj = ExerciseCategory.fromJson(json['category'] as Map); } Map _$ExerciseToJson(Exercise instance) => { @@ -56,8 +55,7 @@ Map _$ExerciseToJson(Exercise instance) => { 'description': instance.description, 'category': instance.categoryObj.toJson(), 'muscles': instance.muscles.map((e) => e.toJson()).toList(), - 'muscles_secondary': - instance.musclesSecondary.map((e) => e.toJson()).toList(), + 'muscles_secondary': instance.musclesSecondary.map((e) => e.toJson()).toList(), 'equipment': instance.equipment.map((e) => e.toJson()).toList(), 'images': instance.images.map((e) => e.toJson()).toList(), 'comments': instance.tips.map((e) => e.toJson()).toList(), diff --git a/lib/models/exercises/image.g.dart b/lib/models/exercises/image.g.dart index 1240dc38..6ef7c62e 100644 --- a/lib/models/exercises/image.g.dart +++ b/lib/models/exercises/image.g.dart @@ -20,8 +20,7 @@ ExerciseImage _$ExerciseImageFromJson(Map json) { ); } -Map _$ExerciseImageToJson(ExerciseImage instance) => - { +Map _$ExerciseImageToJson(ExerciseImage instance) => { 'id': instance.id, 'uuid': instance.uuid, 'exercise_base': instance.exerciseBaseId, diff --git a/lib/models/measurements/measurement_category.g.dart b/lib/models/measurements/measurement_category.g.dart index ef4ebcd3..eb887b2e 100644 --- a/lib/models/measurements/measurement_category.g.dart +++ b/lib/models/measurements/measurement_category.g.dart @@ -22,9 +22,7 @@ MeasurementCategory _$MeasurementCategoryFromJson(Map json) { ); } -Map _$MeasurementCategoryToJson( - MeasurementCategory instance) => - { +Map _$MeasurementCategoryToJson(MeasurementCategory instance) => { 'id': instance.id, 'name': instance.name, 'unit': instance.unit, diff --git a/lib/models/measurements/measurement_entry.g.dart b/lib/models/measurements/measurement_entry.g.dart index 4b096960..7f6e346a 100644 --- a/lib/models/measurements/measurement_entry.g.dart +++ b/lib/models/measurements/measurement_entry.g.dart @@ -20,8 +20,7 @@ MeasurementEntry _$MeasurementEntryFromJson(Map json) { ); } -Map _$MeasurementEntryToJson(MeasurementEntry instance) => - { +Map _$MeasurementEntryToJson(MeasurementEntry instance) => { 'id': instance.id, 'category': instance.category, 'date': toDate(instance.date), diff --git a/lib/models/nutrition/ingredient.g.dart b/lib/models/nutrition/ingredient.g.dart index e5859dda..05ef48d7 100644 --- a/lib/models/nutrition/ingredient.g.dart +++ b/lib/models/nutrition/ingredient.g.dart @@ -38,8 +38,7 @@ Ingredient _$IngredientFromJson(Map json) { ); } -Map _$IngredientToJson(Ingredient instance) => - { +Map _$IngredientToJson(Ingredient instance) => { 'id': instance.id, 'name': instance.name, 'creation_date': toDate(instance.creationDate), diff --git a/lib/models/nutrition/ingredient_weight_unit.g.dart b/lib/models/nutrition/ingredient_weight_unit.g.dart index 74b1f101..f147a2ee 100644 --- a/lib/models/nutrition/ingredient_weight_unit.g.dart +++ b/lib/models/nutrition/ingredient_weight_unit.g.dart @@ -13,16 +13,14 @@ IngredientWeightUnit _$IngredientWeightUnitFromJson(Map json) { ); return IngredientWeightUnit( id: json['id'] as int, - weightUnit: - WeightUnit.fromJson(json['weight_unit'] as Map), + weightUnit: WeightUnit.fromJson(json['weight_unit'] as Map), ingredient: Ingredient.fromJson(json['ingredient'] as Map), grams: json['grams'] as int, amount: (json['amount'] as num).toDouble(), ); } -Map _$IngredientWeightUnitToJson( - IngredientWeightUnit instance) => +Map _$IngredientWeightUnitToJson(IngredientWeightUnit instance) => { 'id': instance.id, 'weight_unit': instance.weightUnit, diff --git a/lib/models/nutrition/log.g.dart b/lib/models/nutrition/log.g.dart index 39068768..61690155 100644 --- a/lib/models/nutrition/log.g.dart +++ b/lib/models/nutrition/log.g.dart @@ -9,14 +9,7 @@ part of 'log.dart'; Log _$LogFromJson(Map 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?, diff --git a/lib/models/nutrition/nutritional_plan.g.dart b/lib/models/nutrition/nutritional_plan.g.dart index 9b10d8a5..661a9f47 100644 --- a/lib/models/nutrition/nutritional_plan.g.dart +++ b/lib/models/nutrition/nutritional_plan.g.dart @@ -18,8 +18,7 @@ NutritionalPlan _$NutritionalPlanFromJson(Map json) { ); } -Map _$NutritionalPlanToJson(NutritionalPlan instance) => - { +Map _$NutritionalPlanToJson(NutritionalPlan instance) => { 'id': instance.id, 'description': instance.description, 'creation_date': toDate(instance.creationDate), diff --git a/lib/models/nutrition/weight_unit.g.dart b/lib/models/nutrition/weight_unit.g.dart index 74e1f0cf..6f2b9607 100644 --- a/lib/models/nutrition/weight_unit.g.dart +++ b/lib/models/nutrition/weight_unit.g.dart @@ -17,8 +17,7 @@ WeightUnit _$WeightUnitFromJson(Map json) { ); } -Map _$WeightUnitToJson(WeightUnit instance) => - { +Map _$WeightUnitToJson(WeightUnit instance) => { 'id': instance.id, 'name': instance.name, }; diff --git a/lib/models/workouts/repetition_unit.g.dart b/lib/models/workouts/repetition_unit.g.dart index 115dc338..33e6a815 100644 --- a/lib/models/workouts/repetition_unit.g.dart +++ b/lib/models/workouts/repetition_unit.g.dart @@ -17,8 +17,7 @@ RepetitionUnit _$RepetitionUnitFromJson(Map json) { ); } -Map _$RepetitionUnitToJson(RepetitionUnit instance) => - { +Map _$RepetitionUnitToJson(RepetitionUnit instance) => { 'id': instance.id, 'name': instance.name, }; diff --git a/lib/models/workouts/session.g.dart b/lib/models/workouts/session.g.dart index e16affad..79f4fee4 100644 --- a/lib/models/workouts/session.g.dart +++ b/lib/models/workouts/session.g.dart @@ -9,14 +9,7 @@ part of 'session.dart'; WorkoutSession _$WorkoutSessionFromJson(Map 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? @@ -28,8 +21,7 @@ WorkoutSession _$WorkoutSessionFromJson(Map json) { ..timeEnd = stringToTime(json['time_end'] as String?); } -Map _$WorkoutSessionToJson(WorkoutSession instance) => - { +Map _$WorkoutSessionToJson(WorkoutSession instance) => { 'id': instance.id, 'workout': instance.workoutId, 'date': toDate(instance.date), diff --git a/lib/models/workouts/weight_unit.g.dart b/lib/models/workouts/weight_unit.g.dart index 74e1f0cf..6f2b9607 100644 --- a/lib/models/workouts/weight_unit.g.dart +++ b/lib/models/workouts/weight_unit.g.dart @@ -17,8 +17,7 @@ WeightUnit _$WeightUnitFromJson(Map json) { ); } -Map _$WeightUnitToJson(WeightUnit instance) => - { +Map _$WeightUnitToJson(WeightUnit instance) => { 'id': instance.id, 'name': instance.name, }; diff --git a/lib/models/workouts/workout_plan.g.dart b/lib/models/workouts/workout_plan.g.dart index ef156e3e..ac1d6fa9 100644 --- a/lib/models/workouts/workout_plan.g.dart +++ b/lib/models/workouts/workout_plan.g.dart @@ -19,8 +19,7 @@ WorkoutPlan _$WorkoutPlanFromJson(Map json) { ); } -Map _$WorkoutPlanToJson(WorkoutPlan instance) => - { +Map _$WorkoutPlanToJson(WorkoutPlan instance) => { 'id': instance.id, 'creation_date': instance.creationDate.toIso8601String(), 'name': instance.name, diff --git a/test/gallery/gallery_screen_test.mocks.dart b/test/gallery/gallery_screen_test.mocks.dart index 1490b2f8..8f5d6f1d 100644 --- a/test/gallery/gallery_screen_test.mocks.dart +++ b/test/gallery/gallery_screen_test.mocks.dart @@ -38,33 +38,31 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider { } @override - List<_i5.Image> get images => (super.noSuchMethod(Invocation.getter(#images), - returnValue: <_i5.Image>[]) as List<_i5.Image>); + List<_i5.Image> get images => + (super.noSuchMethod(Invocation.getter(#images), returnValue: <_i5.Image>[]) + as List<_i5.Image>); @override set images(List<_i5.Image>? _images) => - super.noSuchMethod(Invocation.setter(#images, _images), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#images, _images), returnValueForMissingStub: null); @override - _i2.AuthProvider get auth => (super.noSuchMethod(Invocation.getter(#auth), - returnValue: _FakeAuthProvider_0()) as _i2.AuthProvider); + _i2.AuthProvider get auth => + (super.noSuchMethod(Invocation.getter(#auth), returnValue: _FakeAuthProvider_0()) + as _i2.AuthProvider); @override set auth(_i2.AuthProvider? _auth) => - super.noSuchMethod(Invocation.setter(#auth, _auth), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#auth, _auth), returnValueForMissingStub: null); @override - _i3.Client get client => (super.noSuchMethod(Invocation.getter(#client), - returnValue: _FakeClient_1()) as _i3.Client); + _i3.Client get client => + (super.noSuchMethod(Invocation.getter(#client), returnValue: _FakeClient_1()) as _i3.Client); @override set client(_i3.Client? _client) => - super.noSuchMethod(Invocation.setter(#client, _client), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#client, _client), returnValueForMissingStub: null); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override - void clear() => super.noSuchMethod(Invocation.method(#clear, []), - returnValueForMissingStub: null); + void clear() => + super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); @override _i6.Future fetchAndSetGallery() => (super.noSuchMethod(Invocation.method(#fetchAndSetGallery, []), @@ -86,50 +84,43 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider { returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i6.Future); @override - Uri makeUrl(String? path, - {int? id, String? objectMethod, Map? query}) => + Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => (super.noSuchMethod( - Invocation.method(#makeUrl, [path], - {#id: id, #objectMethod: objectMethod, #query: query}), + Invocation.method( + #makeUrl, [path], {#id: id, #objectMethod: objectMethod, #query: query}), returnValue: _FakeUri_2()) as Uri); @override - _i6.Future> fetch(Uri? uri) => (super.noSuchMethod( - Invocation.method(#fetch, [uri]), - returnValue: Future>.value({})) - as _i6.Future>); + _i6.Future> fetch(Uri? uri) => + (super.noSuchMethod(Invocation.method(#fetch, [uri]), + returnValue: Future>.value({})) + as _i6.Future>); @override _i6.Future> post(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#post, [data, uri]), - returnValue: - Future>.value({})) + returnValue: Future>.value({})) as _i6.Future>); @override - _i6.Future> patch( - Map? data, Uri? uri) => + _i6.Future> patch(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#patch, [data, uri]), - returnValue: - Future>.value({})) + returnValue: Future>.value({})) as _i6.Future>); @override _i6.Future<_i3.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod(Invocation.method(#deleteRequest, [url, id]), - returnValue: Future<_i3.Response>.value(_FakeResponse_3())) - as _i6.Future<_i3.Response>); + returnValue: Future<_i3.Response>.value(_FakeResponse_3())) as _i6.Future<_i3.Response>); @override String toString() => super.toString(); @override - void addListener(_i8.VoidCallback? listener) => - super.noSuchMethod(Invocation.method(#addListener, [listener]), - returnValueForMissingStub: null); + void addListener(_i8.VoidCallback? listener) => super + .noSuchMethod(Invocation.method(#addListener, [listener]), returnValueForMissingStub: null); @override void removeListener(_i8.VoidCallback? listener) => super.noSuchMethod(Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null); @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); + void dispose() => + super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null); @override void notifyListeners() => - super.noSuchMethod(Invocation.method(#notifyListeners, []), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null); } diff --git a/test/measurements/measurement_categories_screen_test.mocks.dart b/test/measurements/measurement_categories_screen_test.mocks.dart index 44427afa..89093d71 100644 --- a/test/measurements/measurement_categories_screen_test.mocks.dart +++ b/test/measurements/measurement_categories_screen_test.mocks.dart @@ -20,41 +20,36 @@ import 'package:wger/providers/measurement.dart' as _i4; // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types -class _FakeWgerBaseProvider_0 extends _i1.Fake implements _i2.WgerBaseProvider { -} +class _FakeWgerBaseProvider_0 extends _i1.Fake implements _i2.WgerBaseProvider {} -class _FakeMeasurementCategory_1 extends _i1.Fake - implements _i3.MeasurementCategory {} +class _FakeMeasurementCategory_1 extends _i1.Fake implements _i3.MeasurementCategory {} /// 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); } @override _i2.WgerBaseProvider get baseProvider => - (super.noSuchMethod(Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0()) as _i2.WgerBaseProvider); + (super.noSuchMethod(Invocation.getter(#baseProvider), returnValue: _FakeWgerBaseProvider_0()) + as _i2.WgerBaseProvider); @override List<_i3.MeasurementCategory> get categories => - (super.noSuchMethod(Invocation.getter(#categories), - returnValue: <_i3.MeasurementCategory>[]) + (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); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override - void clear() => super.noSuchMethod(Invocation.method(#clear, []), - returnValueForMissingStub: null); + void clear() => + super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); @override - _i3.MeasurementCategory findCategoryById(int? id) => (super.noSuchMethod( - Invocation.method(#findCategoryById, [id]), - returnValue: _FakeMeasurementCategory_1()) as _i3.MeasurementCategory); + _i3.MeasurementCategory findCategoryById(int? id) => + (super.noSuchMethod(Invocation.method(#findCategoryById, [id]), + returnValue: _FakeMeasurementCategory_1()) as _i3.MeasurementCategory); @override _i5.Future fetchAndSetCategories() => (super.noSuchMethod(Invocation.method(#fetchAndSetCategories, []), @@ -66,10 +61,10 @@ class MockMeasurementProvider extends _i1.Mock returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i5.Future); @override - _i5.Future fetchAndSetAllCategoriesAndEntries() => (super.noSuchMethod( - Invocation.method(#fetchAndSetAllCategoriesAndEntries, []), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i5.Future); + _i5.Future fetchAndSetAllCategoriesAndEntries() => + (super.noSuchMethod(Invocation.method(#fetchAndSetAllCategoriesAndEntries, []), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i5.Future); @override _i5.Future addCategory(_i3.MeasurementCategory? category) => (super.noSuchMethod(Invocation.method(#addCategory, [category]), @@ -82,8 +77,7 @@ class MockMeasurementProvider extends _i1.Mock returnValueForMissingStub: Future.value()) as _i5.Future); @override _i5.Future editCategory(int? id, String? newName, String? newUnit) => - (super.noSuchMethod( - Invocation.method(#editCategory, [id, newName, newUnit]), + (super.noSuchMethod(Invocation.method(#editCategory, [id, newName, newUnit]), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i5.Future); @override @@ -97,28 +91,25 @@ class MockMeasurementProvider extends _i1.Mock returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i5.Future); @override - _i5.Future editEntry(int? id, int? categoryId, num? newValue, - String? newNotes, DateTime? newDate) => + _i5.Future editEntry( + int? id, int? categoryId, num? newValue, String? newNotes, DateTime? newDate) => (super.noSuchMethod( - Invocation.method( - #editEntry, [id, categoryId, newValue, newNotes, newDate]), + Invocation.method(#editEntry, [id, categoryId, newValue, newNotes, newDate]), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i5.Future); @override String toString() => super.toString(); @override - void addListener(_i7.VoidCallback? listener) => - super.noSuchMethod(Invocation.method(#addListener, [listener]), - returnValueForMissingStub: null); + void addListener(_i7.VoidCallback? listener) => super + .noSuchMethod(Invocation.method(#addListener, [listener]), returnValueForMissingStub: null); @override void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod(Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null); @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); + void dispose() => + super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null); @override void notifyListeners() => - super.noSuchMethod(Invocation.method(#notifyListeners, []), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null); } diff --git a/test/measurements/measurement_provider_test.mocks.dart b/test/measurements/measurement_provider_test.mocks.dart index 1f87fba2..45ea064b 100644 --- a/test/measurements/measurement_provider_test.mocks.dart +++ b/test/measurements/measurement_provider_test.mocks.dart @@ -35,49 +35,43 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { } @override - _i2.AuthProvider get auth => (super.noSuchMethod(Invocation.getter(#auth), - returnValue: _FakeAuthProvider_0()) as _i2.AuthProvider); + _i2.AuthProvider get auth => + (super.noSuchMethod(Invocation.getter(#auth), returnValue: _FakeAuthProvider_0()) + as _i2.AuthProvider); @override set auth(_i2.AuthProvider? _auth) => - super.noSuchMethod(Invocation.setter(#auth, _auth), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#auth, _auth), returnValueForMissingStub: null); @override - _i3.Client get client => (super.noSuchMethod(Invocation.getter(#client), - returnValue: _FakeClient_1()) as _i3.Client); + _i3.Client get client => + (super.noSuchMethod(Invocation.getter(#client), returnValue: _FakeClient_1()) as _i3.Client); @override set client(_i3.Client? _client) => - super.noSuchMethod(Invocation.setter(#client, _client), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#client, _client), returnValueForMissingStub: null); @override - Uri makeUrl(String? path, - {int? id, String? objectMethod, Map? query}) => + Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => (super.noSuchMethod( - Invocation.method(#makeUrl, [path], - {#id: id, #objectMethod: objectMethod, #query: query}), + Invocation.method( + #makeUrl, [path], {#id: id, #objectMethod: objectMethod, #query: query}), returnValue: _FakeUri_2()) as Uri); @override - _i5.Future> fetch(Uri? uri) => (super.noSuchMethod( - Invocation.method(#fetch, [uri]), - returnValue: Future>.value({})) - as _i5.Future>); + _i5.Future> fetch(Uri? uri) => + (super.noSuchMethod(Invocation.method(#fetch, [uri]), + returnValue: Future>.value({})) + as _i5.Future>); @override _i5.Future> post(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#post, [data, uri]), - returnValue: - Future>.value({})) + returnValue: Future>.value({})) as _i5.Future>); @override - _i5.Future> patch( - Map? data, Uri? uri) => + _i5.Future> patch(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#patch, [data, uri]), - returnValue: - Future>.value({})) + returnValue: Future>.value({})) as _i5.Future>); @override _i5.Future<_i3.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod(Invocation.method(#deleteRequest, [url, id]), - returnValue: Future<_i3.Response>.value(_FakeResponse_3())) - as _i5.Future<_i3.Response>); + returnValue: Future<_i3.Response>.value(_FakeResponse_3())) as _i5.Future<_i3.Response>); @override String toString() => super.toString(); } diff --git a/test/nutrition/nutritional_plan_form_test.mocks.dart b/test/nutrition/nutritional_plan_form_test.mocks.dart index b2b8f158..ab76647c 100644 --- a/test/nutrition/nutritional_plan_form_test.mocks.dart +++ b/test/nutrition/nutritional_plan_form_test.mocks.dart @@ -42,41 +42,38 @@ class _FakeResponse_7 extends _i1.Fake implements _i3.Response {} /// A class which mocks [NutritionPlansProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockNutritionPlansProvider extends _i1.Mock - implements _i8.NutritionPlansProvider { +class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansProvider { MockNutritionPlansProvider() { _i1.throwOnMissingStub(this); } @override List<_i4.NutritionalPlan> get items => - (super.noSuchMethod(Invocation.getter(#items), - returnValue: <_i4.NutritionalPlan>[]) as List<_i4.NutritionalPlan>); + (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i4.NutritionalPlan>[]) + as List<_i4.NutritionalPlan>); @override - _i2.AuthProvider get auth => (super.noSuchMethod(Invocation.getter(#auth), - returnValue: _FakeAuthProvider_0()) as _i2.AuthProvider); + _i2.AuthProvider get auth => + (super.noSuchMethod(Invocation.getter(#auth), returnValue: _FakeAuthProvider_0()) + as _i2.AuthProvider); @override set auth(_i2.AuthProvider? _auth) => - super.noSuchMethod(Invocation.setter(#auth, _auth), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#auth, _auth), returnValueForMissingStub: null); @override - _i3.Client get client => (super.noSuchMethod(Invocation.getter(#client), - returnValue: _FakeClient_1()) as _i3.Client); + _i3.Client get client => + (super.noSuchMethod(Invocation.getter(#client), returnValue: _FakeClient_1()) as _i3.Client); @override set client(_i3.Client? _client) => - super.noSuchMethod(Invocation.setter(#client, _client), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#client, _client), returnValueForMissingStub: null); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override - void clear() => super.noSuchMethod(Invocation.method(#clear, []), - returnValueForMissingStub: null); + void clear() => + super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); @override _i4.NutritionalPlan findById(int? id) => - (super.noSuchMethod(Invocation.method(#findById, [id]), - returnValue: _FakeNutritionalPlan_2()) as _i4.NutritionalPlan); + (super.noSuchMethod(Invocation.method(#findById, [id]), returnValue: _FakeNutritionalPlan_2()) + as _i4.NutritionalPlan); @override _i5.Meal? findMealById(int? id) => (super.noSuchMethod(Invocation.method(#findMealById, [id])) as _i5.Meal?); @@ -93,20 +90,17 @@ class MockNutritionPlansProvider extends _i1.Mock @override _i9.Future<_i4.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(Invocation.method(#fetchAndSetPlanSparse, [planId]), - returnValue: - Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2())) + returnValue: Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2())) as _i9.Future<_i4.NutritionalPlan>); @override _i9.Future<_i4.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod(Invocation.method(#fetchAndSetPlanFull, [planId]), - returnValue: - Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2())) + returnValue: Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2())) as _i9.Future<_i4.NutritionalPlan>); @override _i9.Future<_i4.NutritionalPlan> addPlan(_i4.NutritionalPlan? planData) => (super.noSuchMethod(Invocation.method(#addPlan, [planData]), - returnValue: - Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2())) + returnValue: Future<_i4.NutritionalPlan>.value(_FakeNutritionalPlan_2())) as _i9.Future<_i4.NutritionalPlan>); @override _i9.Future editPlan(_i4.NutritionalPlan? plan) => @@ -114,31 +108,26 @@ class MockNutritionPlansProvider extends _i1.Mock returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i9.Future); @override - _i9.Future deletePlan(int? id) => - (super.noSuchMethod(Invocation.method(#deletePlan, [id]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i9.Future); + _i9.Future deletePlan(int? id) => (super.noSuchMethod(Invocation.method(#deletePlan, [id]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i9.Future); @override _i9.Future<_i5.Meal> addMeal(_i5.Meal? meal, int? planId) => (super.noSuchMethod(Invocation.method(#addMeal, [meal, planId]), - returnValue: Future<_i5.Meal>.value(_FakeMeal_3())) - as _i9.Future<_i5.Meal>); + returnValue: Future<_i5.Meal>.value(_FakeMeal_3())) as _i9.Future<_i5.Meal>); @override _i9.Future<_i5.Meal> editMeal(_i5.Meal? meal) => (super.noSuchMethod(Invocation.method(#editMeal, [meal]), - returnValue: Future<_i5.Meal>.value(_FakeMeal_3())) - as _i9.Future<_i5.Meal>); + returnValue: Future<_i5.Meal>.value(_FakeMeal_3())) as _i9.Future<_i5.Meal>); @override _i9.Future deleteMeal(_i5.Meal? meal) => (super.noSuchMethod(Invocation.method(#deleteMeal, [meal]), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i9.Future); @override - _i9.Future<_i6.MealItem> addMealItem( - _i6.MealItem? mealItem, _i5.Meal? meal) => + _i9.Future<_i6.MealItem> addMealItem(_i6.MealItem? mealItem, _i5.Meal? meal) => (super.noSuchMethod(Invocation.method(#addMealItem, [mealItem, meal]), - returnValue: Future<_i6.MealItem>.value(_FakeMealItem_4())) - as _i9.Future<_i6.MealItem>); + returnValue: Future<_i6.MealItem>.value(_FakeMealItem_4())) as _i9.Future<_i6.MealItem>); @override _i9.Future deleteMealItem(_i6.MealItem? mealItem) => (super.noSuchMethod(Invocation.method(#deleteMealItem, [mealItem]), @@ -155,22 +144,17 @@ class MockNutritionPlansProvider extends _i1.Mock returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i9.Future); @override - _i9.Future> searchIngredient(String? name, - [String? languageCode = r'en']) => - (super.noSuchMethod( - Invocation.method(#searchIngredient, [name, languageCode]), - returnValue: Future>.value([])) - as _i9.Future>); + _i9.Future> searchIngredient(String? name, [String? languageCode = r'en']) => + (super.noSuchMethod(Invocation.method(#searchIngredient, [name, languageCode]), + returnValue: Future>.value([])) as _i9.Future>); @override _i9.Future logMealToDiary(_i5.Meal? meal) => (super.noSuchMethod(Invocation.method(#logMealToDiary, [meal]), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i9.Future); @override - _i9.Future logIngredentToDiary(_i6.MealItem? mealItem, int? planId, - [DateTime? dateTime]) => - (super.noSuchMethod( - Invocation.method(#logIngredentToDiary, [mealItem, planId, dateTime]), + _i9.Future logIngredentToDiary(_i6.MealItem? mealItem, int? planId, [DateTime? dateTime]) => + (super.noSuchMethod(Invocation.method(#logIngredentToDiary, [mealItem, planId, dateTime]), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i9.Future); @override @@ -184,50 +168,43 @@ class MockNutritionPlansProvider extends _i1.Mock returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i9.Future); @override - Uri makeUrl(String? path, - {int? id, String? objectMethod, Map? query}) => + Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => (super.noSuchMethod( - Invocation.method(#makeUrl, [path], - {#id: id, #objectMethod: objectMethod, #query: query}), + Invocation.method( + #makeUrl, [path], {#id: id, #objectMethod: objectMethod, #query: query}), returnValue: _FakeUri_6()) as Uri); @override - _i9.Future> fetch(Uri? uri) => (super.noSuchMethod( - Invocation.method(#fetch, [uri]), - returnValue: Future>.value({})) - as _i9.Future>); + _i9.Future> fetch(Uri? uri) => + (super.noSuchMethod(Invocation.method(#fetch, [uri]), + returnValue: Future>.value({})) + as _i9.Future>); @override _i9.Future> post(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#post, [data, uri]), - returnValue: - Future>.value({})) + returnValue: Future>.value({})) as _i9.Future>); @override - _i9.Future> patch( - Map? data, Uri? uri) => + _i9.Future> patch(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#patch, [data, uri]), - returnValue: - Future>.value({})) + returnValue: Future>.value({})) as _i9.Future>); @override _i9.Future<_i3.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod(Invocation.method(#deleteRequest, [url, id]), - returnValue: Future<_i3.Response>.value(_FakeResponse_7())) - as _i9.Future<_i3.Response>); + returnValue: Future<_i3.Response>.value(_FakeResponse_7())) as _i9.Future<_i3.Response>); @override String toString() => super.toString(); @override - void addListener(_i10.VoidCallback? listener) => - super.noSuchMethod(Invocation.method(#addListener, [listener]), - returnValueForMissingStub: null); + void addListener(_i10.VoidCallback? listener) => super + .noSuchMethod(Invocation.method(#addListener, [listener]), returnValueForMissingStub: null); @override void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod(Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null); @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); + void dispose() => + super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null); @override void notifyListeners() => - super.noSuchMethod(Invocation.method(#notifyListeners, []), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null); } diff --git a/test/other/base_provider_test.mocks.dart b/test/other/base_provider_test.mocks.dart index de3e7152..c052da81 100644 --- a/test/other/base_provider_test.mocks.dart +++ b/test/other/base_provider_test.mocks.dart @@ -23,8 +23,7 @@ import 'package:mockito/mockito.dart' as _i1; class _FakeResponse_0 extends _i1.Fake implements _i2.Response {} -class _FakeStreamedResponse_1 extends _i1.Fake implements _i3.StreamedResponse { -} +class _FakeStreamedResponse_1 extends _i1.Fake implements _i3.StreamedResponse {} /// A class which mocks [Client]. /// @@ -37,73 +36,51 @@ class MockClient extends _i1.Mock implements _i4.Client { @override _i5.Future<_i2.Response> head(Uri? url, {Map? headers}) => (super.noSuchMethod(Invocation.method(#head, [url], {#headers: headers}), - returnValue: Future<_i2.Response>.value(_FakeResponse_0())) - as _i5.Future<_i2.Response>); + returnValue: Future<_i2.Response>.value(_FakeResponse_0())) as _i5.Future<_i2.Response>); @override _i5.Future<_i2.Response> get(Uri? url, {Map? headers}) => (super.noSuchMethod(Invocation.method(#get, [url], {#headers: headers}), - returnValue: Future<_i2.Response>.value(_FakeResponse_0())) - as _i5.Future<_i2.Response>); + returnValue: Future<_i2.Response>.value(_FakeResponse_0())) as _i5.Future<_i2.Response>); @override _i5.Future<_i2.Response> post(Uri? url, - {Map? headers, - Object? body, - _i6.Encoding? encoding}) => + {Map? headers, Object? body, _i6.Encoding? encoding}) => (super.noSuchMethod( - Invocation.method(#post, [url], - {#headers: headers, #body: body, #encoding: encoding}), - returnValue: Future<_i2.Response>.value(_FakeResponse_0())) - as _i5.Future<_i2.Response>); + Invocation.method(#post, [url], {#headers: headers, #body: body, #encoding: encoding}), + returnValue: Future<_i2.Response>.value(_FakeResponse_0())) as _i5.Future<_i2.Response>); @override _i5.Future<_i2.Response> put(Uri? url, - {Map? headers, - Object? body, - _i6.Encoding? encoding}) => + {Map? headers, Object? body, _i6.Encoding? encoding}) => (super.noSuchMethod( - Invocation.method(#put, [url], - {#headers: headers, #body: body, #encoding: encoding}), - returnValue: Future<_i2.Response>.value(_FakeResponse_0())) - as _i5.Future<_i2.Response>); + Invocation.method(#put, [url], {#headers: headers, #body: body, #encoding: encoding}), + returnValue: Future<_i2.Response>.value(_FakeResponse_0())) as _i5.Future<_i2.Response>); @override _i5.Future<_i2.Response> patch(Uri? url, - {Map? headers, - Object? body, - _i6.Encoding? encoding}) => + {Map? headers, Object? body, _i6.Encoding? encoding}) => (super.noSuchMethod( - Invocation.method(#patch, [url], - {#headers: headers, #body: body, #encoding: encoding}), - returnValue: Future<_i2.Response>.value(_FakeResponse_0())) - as _i5.Future<_i2.Response>); + Invocation.method(#patch, [url], {#headers: headers, #body: body, #encoding: encoding}), + returnValue: Future<_i2.Response>.value(_FakeResponse_0())) as _i5.Future<_i2.Response>); @override _i5.Future<_i2.Response> delete(Uri? url, - {Map? headers, - Object? body, - _i6.Encoding? encoding}) => + {Map? headers, Object? body, _i6.Encoding? encoding}) => (super.noSuchMethod( - Invocation.method(#delete, [url], - {#headers: headers, #body: body, #encoding: encoding}), - returnValue: Future<_i2.Response>.value(_FakeResponse_0())) - as _i5.Future<_i2.Response>); + Invocation.method(#delete, [url], {#headers: headers, #body: body, #encoding: encoding}), + returnValue: Future<_i2.Response>.value(_FakeResponse_0())) as _i5.Future<_i2.Response>); @override _i5.Future read(Uri? url, {Map? headers}) => (super.noSuchMethod(Invocation.method(#read, [url], {#headers: headers}), returnValue: Future.value('')) as _i5.Future); @override - _i5.Future<_i7.Uint8List> readBytes(Uri? url, - {Map? headers}) => - (super.noSuchMethod( - Invocation.method(#readBytes, [url], {#headers: headers}), - returnValue: Future<_i7.Uint8List>.value(_i7.Uint8List(0))) - as _i5.Future<_i7.Uint8List>); + _i5.Future<_i7.Uint8List> readBytes(Uri? url, {Map? headers}) => + (super.noSuchMethod(Invocation.method(#readBytes, [url], {#headers: headers}), + returnValue: Future<_i7.Uint8List>.value(_i7.Uint8List(0))) as _i5.Future<_i7.Uint8List>); @override _i5.Future<_i3.StreamedResponse> send(_i8.BaseRequest? request) => (super.noSuchMethod(Invocation.method(#send, [request]), - returnValue: - Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_1())) + returnValue: Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_1())) as _i5.Future<_i3.StreamedResponse>); @override - void close() => super.noSuchMethod(Invocation.method(#close, []), - returnValueForMissingStub: null); + void close() => + super.noSuchMethod(Invocation.method(#close, []), returnValueForMissingStub: null); @override String toString() => super.toString(); } diff --git a/test/workout/workout_form_test.mocks.dart b/test/workout/workout_form_test.mocks.dart index 0e935afc..00b22094 100644 --- a/test/workout/workout_form_test.mocks.dart +++ b/test/workout/workout_form_test.mocks.dart @@ -55,79 +55,73 @@ class _FakeResponse_11 extends _i1.Fake implements _i5.Response {} /// A class which mocks [WorkoutPlansProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockWorkoutPlansProvider extends _i1.Mock - implements _i12.WorkoutPlansProvider { +class MockWorkoutPlansProvider extends _i1.Mock implements _i12.WorkoutPlansProvider { MockWorkoutPlansProvider() { _i1.throwOnMissingStub(this); } @override List<_i6.WorkoutPlan> get items => - (super.noSuchMethod(Invocation.getter(#items), - returnValue: <_i6.WorkoutPlan>[]) as List<_i6.WorkoutPlan>); + (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i6.WorkoutPlan>[]) + as List<_i6.WorkoutPlan>); @override List<_i2.WeightUnit> get weightUnits => - (super.noSuchMethod(Invocation.getter(#weightUnits), - returnValue: <_i2.WeightUnit>[]) as List<_i2.WeightUnit>); + (super.noSuchMethod(Invocation.getter(#weightUnits), returnValue: <_i2.WeightUnit>[]) + as List<_i2.WeightUnit>); @override _i2.WeightUnit get defaultWeightUnit => - (super.noSuchMethod(Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_0()) as _i2.WeightUnit); + (super.noSuchMethod(Invocation.getter(#defaultWeightUnit), returnValue: _FakeWeightUnit_0()) + as _i2.WeightUnit); @override List<_i3.RepetitionUnit> get repetitionUnits => - (super.noSuchMethod(Invocation.getter(#repetitionUnits), - returnValue: <_i3.RepetitionUnit>[]) as List<_i3.RepetitionUnit>); + (super.noSuchMethod(Invocation.getter(#repetitionUnits), returnValue: <_i3.RepetitionUnit>[]) + as List<_i3.RepetitionUnit>); @override _i3.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod(Invocation.getter(#defaultRepetitionUnit), returnValue: _FakeRepetitionUnit_1()) as _i3.RepetitionUnit); @override - _i4.AuthProvider get auth => (super.noSuchMethod(Invocation.getter(#auth), - returnValue: _FakeAuthProvider_2()) as _i4.AuthProvider); + _i4.AuthProvider get auth => + (super.noSuchMethod(Invocation.getter(#auth), returnValue: _FakeAuthProvider_2()) + as _i4.AuthProvider); @override set auth(_i4.AuthProvider? _auth) => - super.noSuchMethod(Invocation.setter(#auth, _auth), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#auth, _auth), returnValueForMissingStub: null); @override - _i5.Client get client => (super.noSuchMethod(Invocation.getter(#client), - returnValue: _FakeClient_3()) as _i5.Client); + _i5.Client get client => + (super.noSuchMethod(Invocation.getter(#client), returnValue: _FakeClient_3()) as _i5.Client); @override set client(_i5.Client? _client) => - super.noSuchMethod(Invocation.setter(#client, _client), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#client, _client), returnValueForMissingStub: null); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override - void clear() => super.noSuchMethod(Invocation.method(#clear, []), - returnValueForMissingStub: null); + void clear() => + super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null); @override _i6.WorkoutPlan findById(int? id) => - (super.noSuchMethod(Invocation.method(#findById, [id]), - returnValue: _FakeWorkoutPlan_4()) as _i6.WorkoutPlan); + (super.noSuchMethod(Invocation.method(#findById, [id]), returnValue: _FakeWorkoutPlan_4()) + as _i6.WorkoutPlan); @override - int findIndexById(int? id) => (super - .noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) - as int); + int findIndexById(int? id) => + (super.noSuchMethod(Invocation.method(#findIndexById, [id]), returnValue: 0) as int); @override void setCurrentPlan(int? id) => - super.noSuchMethod(Invocation.method(#setCurrentPlan, [id]), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#setCurrentPlan, [id]), returnValueForMissingStub: null); @override void resetCurrentPlan() => - super.noSuchMethod(Invocation.method(#resetCurrentPlan, []), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#resetCurrentPlan, []), returnValueForMissingStub: null); @override - _i13.Future fetchAndSetAllPlansFull() => (super.noSuchMethod( - Invocation.method(#fetchAndSetAllPlansFull, []), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future fetchAndSetAllPlansFull() => + (super.noSuchMethod(Invocation.method(#fetchAndSetAllPlansFull, []), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override - _i13.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( - Invocation.method(#fetchAndSetAllPlansSparse, []), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future fetchAndSetAllPlansSparse() => + (super.noSuchMethod(Invocation.method(#fetchAndSetAllPlansSparse, []), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override _i13.Future<_i6.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod(Invocation.method(#fetchAndSetPlanSparse, [planId]), @@ -135,8 +129,7 @@ class MockWorkoutPlansProvider extends _i1.Mock as _i13.Future<_i6.WorkoutPlan>); @override _i13.Future<_i6.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => - (super.noSuchMethod( - Invocation.method(#fetchAndSetWorkoutPlanFull, [workoutId]), + (super.noSuchMethod(Invocation.method(#fetchAndSetWorkoutPlanFull, [workoutId]), returnValue: Future<_i6.WorkoutPlan>.value(_FakeWorkoutPlan_4())) as _i13.Future<_i6.WorkoutPlan>); @override @@ -147,89 +140,78 @@ class MockWorkoutPlansProvider extends _i1.Mock @override _i13.Future editWorkout(_i6.WorkoutPlan? workout) => (super.noSuchMethod(Invocation.method(#editWorkout, [workout]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) - as _i13.Future); + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override - _i13.Future deleteWorkout(int? id) => (super.noSuchMethod( - Invocation.method(#deleteWorkout, [id]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future deleteWorkout(int? id) => + (super.noSuchMethod(Invocation.method(#deleteWorkout, [id]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override _i13.Future> fetchLogData( _i6.WorkoutPlan? workout, _i14.Exercise? exercise) => (super.noSuchMethod(Invocation.method(#fetchLogData, [workout, exercise]), - returnValue: - Future>.value({})) + returnValue: Future>.value({})) as _i13.Future>); @override - _i13.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( - Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future fetchAndSetRepetitionUnits() => + (super.noSuchMethod(Invocation.method(#fetchAndSetRepetitionUnits, []), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override - _i13.Future fetchAndSetWeightUnits() => (super.noSuchMethod( - Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future fetchAndSetWeightUnits() => + (super.noSuchMethod(Invocation.method(#fetchAndSetWeightUnits, []), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override - _i13.Future fetchAndSetUnits() => (super.noSuchMethod( - Invocation.method(#fetchAndSetUnits, []), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future fetchAndSetUnits() => + (super.noSuchMethod(Invocation.method(#fetchAndSetUnits, []), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override _i13.Future<_i7.Day> addDay(_i7.Day? day, _i6.WorkoutPlan? workout) => (super.noSuchMethod(Invocation.method(#addDay, [day, workout]), - returnValue: Future<_i7.Day>.value(_FakeDay_5())) - as _i13.Future<_i7.Day>); + returnValue: Future<_i7.Day>.value(_FakeDay_5())) as _i13.Future<_i7.Day>); @override - _i13.Future editDay(_i7.Day? day) => (super.noSuchMethod( - Invocation.method(#editDay, [day]), + _i13.Future editDay(_i7.Day? day) => (super.noSuchMethod(Invocation.method(#editDay, [day]), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i13.Future); @override - _i13.Future deleteDay(_i7.Day? day) => (super.noSuchMethod( - Invocation.method(#deleteDay, [day]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future deleteDay(_i7.Day? day) => + (super.noSuchMethod(Invocation.method(#deleteDay, [day]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override _i13.Future<_i8.Set> addSet(_i8.Set? workoutSet) => (super.noSuchMethod(Invocation.method(#addSet, [workoutSet]), - returnValue: Future<_i8.Set>.value(_FakeSet_6())) - as _i13.Future<_i8.Set>); + returnValue: Future<_i8.Set>.value(_FakeSet_6())) as _i13.Future<_i8.Set>); @override - _i13.Future editSet(_i8.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#editSet, [workoutSet]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future editSet(_i8.Set? workoutSet) => + (super.noSuchMethod(Invocation.method(#editSet, [workoutSet]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override - _i13.Future> reorderSets( - List<_i8.Set>? sets, int? startIndex) => + _i13.Future> reorderSets(List<_i8.Set>? sets, int? startIndex) => (super.noSuchMethod(Invocation.method(#reorderSets, [sets, startIndex]), - returnValue: Future>.value(<_i8.Set>[])) - as _i13.Future>); + returnValue: Future>.value(<_i8.Set>[])) as _i13.Future>); @override - _i13.Future fetchComputedSettings(_i8.Set? workoutSet) => (super - .noSuchMethod(Invocation.method(#fetchComputedSettings, [workoutSet]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) - as _i13.Future); + _i13.Future fetchComputedSettings(_i8.Set? workoutSet) => + (super.noSuchMethod(Invocation.method(#fetchComputedSettings, [workoutSet]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override - _i13.Future fetchSmartText( - _i8.Set? workoutSet, _i14.Exercise? exercise) => - (super.noSuchMethod( - Invocation.method(#fetchSmartText, [workoutSet, exercise]), + _i13.Future fetchSmartText(_i8.Set? workoutSet, _i14.Exercise? exercise) => + (super.noSuchMethod(Invocation.method(#fetchSmartText, [workoutSet, exercise]), returnValue: Future.value('')) as _i13.Future); @override - _i13.Future deleteSet(_i8.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#deleteSet, [workoutSet]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future deleteSet(_i8.Set? workoutSet) => + (super.noSuchMethod(Invocation.method(#deleteSet, [workoutSet]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override _i13.Future<_i9.Setting> addSetting(_i9.Setting? workoutSetting) => (super.noSuchMethod(Invocation.method(#addSetting, [workoutSetting]), - returnValue: Future<_i9.Setting>.value(_FakeSetting_7())) - as _i13.Future<_i9.Setting>); + returnValue: Future<_i9.Setting>.value(_FakeSetting_7())) as _i13.Future<_i9.Setting>); @override _i13.Future fetchSessionData() => (super.noSuchMethod(Invocation.method(#fetchSessionData, []), @@ -237,65 +219,55 @@ class MockWorkoutPlansProvider extends _i1.Mock @override _i13.Future<_i10.WorkoutSession> addSession(_i10.WorkoutSession? session) => (super.noSuchMethod(Invocation.method(#addSession, [session]), - returnValue: - Future<_i10.WorkoutSession>.value(_FakeWorkoutSession_8())) + returnValue: Future<_i10.WorkoutSession>.value(_FakeWorkoutSession_8())) as _i13.Future<_i10.WorkoutSession>); @override _i13.Future<_i11.Log> addLog(_i11.Log? log) => (super.noSuchMethod(Invocation.method(#addLog, [log]), - returnValue: Future<_i11.Log>.value(_FakeLog_9())) - as _i13.Future<_i11.Log>); + returnValue: Future<_i11.Log>.value(_FakeLog_9())) as _i13.Future<_i11.Log>); @override - _i13.Future deleteLog(_i11.Log? log) => (super.noSuchMethod( - Invocation.method(#deleteLog, [log]), - returnValue: Future.value(), - returnValueForMissingStub: Future.value()) as _i13.Future); + _i13.Future deleteLog(_i11.Log? log) => + (super.noSuchMethod(Invocation.method(#deleteLog, [log]), + returnValue: Future.value(), + returnValueForMissingStub: Future.value()) as _i13.Future); @override - Uri makeUrl(String? path, - {int? id, String? objectMethod, Map? query}) => + Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => (super.noSuchMethod( - Invocation.method(#makeUrl, [path], - {#id: id, #objectMethod: objectMethod, #query: query}), + Invocation.method( + #makeUrl, [path], {#id: id, #objectMethod: objectMethod, #query: query}), returnValue: _FakeUri_10()) as Uri); @override - _i13.Future> fetch(Uri? uri) => (super.noSuchMethod( - Invocation.method(#fetch, [uri]), - returnValue: Future>.value({})) - as _i13.Future>); + _i13.Future> fetch(Uri? uri) => + (super.noSuchMethod(Invocation.method(#fetch, [uri]), + returnValue: Future>.value({})) + as _i13.Future>); @override - _i13.Future> post( - Map? data, Uri? uri) => + _i13.Future> post(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#post, [data, uri]), - returnValue: - Future>.value({})) + returnValue: Future>.value({})) as _i13.Future>); @override - _i13.Future> patch( - Map? data, Uri? uri) => + _i13.Future> patch(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#patch, [data, uri]), - returnValue: - Future>.value({})) + returnValue: Future>.value({})) as _i13.Future>); @override - _i13.Future<_i5.Response> deleteRequest(String? url, int? id) => - (super.noSuchMethod(Invocation.method(#deleteRequest, [url, id]), - returnValue: Future<_i5.Response>.value(_FakeResponse_11())) - as _i13.Future<_i5.Response>); + _i13.Future<_i5.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod( + Invocation.method(#deleteRequest, [url, id]), + returnValue: Future<_i5.Response>.value(_FakeResponse_11())) as _i13.Future<_i5.Response>); @override String toString() => super.toString(); @override - void addListener(_i15.VoidCallback? listener) => - super.noSuchMethod(Invocation.method(#addListener, [listener]), - returnValueForMissingStub: null); + void addListener(_i15.VoidCallback? listener) => super + .noSuchMethod(Invocation.method(#addListener, [listener]), returnValueForMissingStub: null); @override void removeListener(_i15.VoidCallback? listener) => super.noSuchMethod(Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null); @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); + void dispose() => + super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null); @override void notifyListeners() => - super.noSuchMethod(Invocation.method(#notifyListeners, []), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null); } diff --git a/test/workout/workout_set_form_test.mocks.dart b/test/workout/workout_set_form_test.mocks.dart index 3c5a2667..87955720 100644 --- a/test/workout/workout_set_form_test.mocks.dart +++ b/test/workout/workout_set_form_test.mocks.dart @@ -39,30 +39,29 @@ class MockExercisesProvider extends _i1.Mock implements _i5.ExercisesProvider { } @override - List<_i4.Exercise> get items => (super.noSuchMethod(Invocation.getter(#items), - returnValue: <_i4.Exercise>[]) as List<_i4.Exercise>); + List<_i4.Exercise> get items => + (super.noSuchMethod(Invocation.getter(#items), returnValue: <_i4.Exercise>[]) + as List<_i4.Exercise>); @override - _i2.AuthProvider get auth => (super.noSuchMethod(Invocation.getter(#auth), - returnValue: _FakeAuthProvider_0()) as _i2.AuthProvider); + _i2.AuthProvider get auth => + (super.noSuchMethod(Invocation.getter(#auth), returnValue: _FakeAuthProvider_0()) + as _i2.AuthProvider); @override set auth(_i2.AuthProvider? _auth) => - super.noSuchMethod(Invocation.setter(#auth, _auth), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#auth, _auth), returnValueForMissingStub: null); @override - _i3.Client get client => (super.noSuchMethod(Invocation.getter(#client), - returnValue: _FakeClient_1()) as _i3.Client); + _i3.Client get client => + (super.noSuchMethod(Invocation.getter(#client), returnValue: _FakeClient_1()) as _i3.Client); @override set client(_i3.Client? _client) => - super.noSuchMethod(Invocation.setter(#client, _client), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.setter(#client, _client), returnValueForMissingStub: null); @override bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @override - _i4.Exercise findById(int? exerciseId) => - (super.noSuchMethod(Invocation.method(#findById, [exerciseId]), - returnValue: _FakeExercise_2()) as _i4.Exercise); + _i4.Exercise findById(int? exerciseId) => (super + .noSuchMethod(Invocation.method(#findById, [exerciseId]), returnValue: _FakeExercise_2()) + as _i4.Exercise); @override _i6.Future fetchAndSetCategories() => (super.noSuchMethod(Invocation.method(#fetchAndSetCategories, []), @@ -81,65 +80,54 @@ class MockExercisesProvider extends _i1.Mock implements _i5.ExercisesProvider { @override _i6.Future<_i4.Exercise> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod(Invocation.method(#fetchAndSetExercise, [exerciseId]), - returnValue: Future<_i4.Exercise>.value(_FakeExercise_2())) - as _i6.Future<_i4.Exercise>); + returnValue: Future<_i4.Exercise>.value(_FakeExercise_2())) as _i6.Future<_i4.Exercise>); @override _i6.Future fetchAndSetExercises() => (super.noSuchMethod(Invocation.method(#fetchAndSetExercises, []), returnValue: Future.value(), returnValueForMissingStub: Future.value()) as _i6.Future); @override - _i6.Future> searchExercise(String? name, - [String? languageCode = r'en']) => - (super.noSuchMethod( - Invocation.method(#searchExercise, [name, languageCode]), - returnValue: Future>.value([])) - as _i6.Future>); + _i6.Future> searchExercise(String? name, [String? languageCode = r'en']) => + (super.noSuchMethod(Invocation.method(#searchExercise, [name, languageCode]), + returnValue: Future>.value([])) as _i6.Future>); @override - Uri makeUrl(String? path, - {int? id, String? objectMethod, Map? query}) => + Uri makeUrl(String? path, {int? id, String? objectMethod, Map? query}) => (super.noSuchMethod( - Invocation.method(#makeUrl, [path], - {#id: id, #objectMethod: objectMethod, #query: query}), + Invocation.method( + #makeUrl, [path], {#id: id, #objectMethod: objectMethod, #query: query}), returnValue: _FakeUri_3()) as Uri); @override - _i6.Future> fetch(Uri? uri) => (super.noSuchMethod( - Invocation.method(#fetch, [uri]), - returnValue: Future>.value({})) - as _i6.Future>); + _i6.Future> fetch(Uri? uri) => + (super.noSuchMethod(Invocation.method(#fetch, [uri]), + returnValue: Future>.value({})) + as _i6.Future>); @override _i6.Future> post(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#post, [data, uri]), - returnValue: - Future>.value({})) + returnValue: Future>.value({})) as _i6.Future>); @override - _i6.Future> patch( - Map? data, Uri? uri) => + _i6.Future> patch(Map? data, Uri? uri) => (super.noSuchMethod(Invocation.method(#patch, [data, uri]), - returnValue: - Future>.value({})) + returnValue: Future>.value({})) as _i6.Future>); @override _i6.Future<_i3.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod(Invocation.method(#deleteRequest, [url, id]), - returnValue: Future<_i3.Response>.value(_FakeResponse_4())) - as _i6.Future<_i3.Response>); + returnValue: Future<_i3.Response>.value(_FakeResponse_4())) as _i6.Future<_i3.Response>); @override String toString() => super.toString(); @override - void addListener(_i7.VoidCallback? listener) => - super.noSuchMethod(Invocation.method(#addListener, [listener]), - returnValueForMissingStub: null); + void addListener(_i7.VoidCallback? listener) => super + .noSuchMethod(Invocation.method(#addListener, [listener]), returnValueForMissingStub: null); @override void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod(Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null); @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); + void dispose() => + super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null); @override void notifyListeners() => - super.noSuchMethod(Invocation.method(#notifyListeners, []), - returnValueForMissingStub: null); + super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null); } From 814e1d182a2e36535a465ce29e96768f2ec5dd23 Mon Sep 17 00:00:00 2001 From: Milo Ivir Date: Wed, 10 Nov 2021 14:14:40 +0000 Subject: [PATCH 41/49] Translated using Weblate (Croatian) Currently translated at 100.0% (152 of 152 strings) Translation: wger Workout Manager/Mobile App Translate-URL: https://hosted.weblate.org/projects/wger/mobile/hr/ --- lib/l10n/app_hr.arb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/l10n/app_hr.arb b/lib/l10n/app_hr.arb index b1f50e7b..2a802be0 100644 --- a/lib/l10n/app_hr.arb +++ b/lib/l10n/app_hr.arb @@ -514,5 +514,11 @@ "recentlyUsedIngredients": "Nedavno dodani sastojci", "@recentlyUsedIngredients": { "description": "A message when a user adds a new ingredient to a meal." + }, + "logIngredient": "Spremi u dnevnik prehrane", + "@logIngredient": {}, + "searchIngredient": "Traži sastojak", + "@searchIngredient": { + "description": "Label on ingredient search form" } } From 67e4563cbc5f0e07adf99f4ae12c59d329b99ff3 Mon Sep 17 00:00:00 2001 From: Cenk Cidecio Date: Sat, 13 Nov 2021 14:08:48 +0000 Subject: [PATCH 42/49] Translated using Weblate (Turkish) Currently translated at 71.7% (109 of 152 strings) Translation: wger Workout Manager/Mobile App Translate-URL: https://hosted.weblate.org/projects/wger/mobile/tr/ --- lib/l10n/app_tr.arb | 196 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 195 insertions(+), 1 deletion(-) diff --git a/lib/l10n/app_tr.arb b/lib/l10n/app_tr.arb index 630e4769..41aea826 100644 --- a/lib/l10n/app_tr.arb +++ b/lib/l10n/app_tr.arb @@ -164,5 +164,199 @@ "placeholders": { "nr": {} } - } + }, + "sameRepetitions": "Eğer tüm setler için aynı ağırlıklarla aynı setleri yapıyorsanız, sadece bir satır doldurabilirsiniz. Örneğin, 4 set için sadece 10 girin, bu otomatik olarak \"4 x 10\"a dönüşüyor.", + "@sameRepetitions": {}, + "selectExercises": "Eğer bir süper set yapmak istiyorsanız, birkaç egzersiz için arama yapabilirsiniz, birlikte gruplanacaklardır", + "@selectExercises": {}, + "logHelpEntries": "Tek bir günde, aynı sayıda tekrara sahip ancak farklı ağırlıklara sahip birden fazla giriş varsa, diyagramda yalnızca daha yüksek ağırlığa sahip giriş gösterilir.", + "@logHelpEntries": {}, + "addSet": "Set ekle", + "@addSet": { + "description": "Label for the button that adds a set (to a workout day)" + }, + "date": "Tarih", + "@date": { + "description": "The date of a workout log or body weight entry" + }, + "time": "Zaman", + "@time": { + "description": "The time of a meal or workout" + }, + "logHelpEntriesUnits": "Yalnızca ağırlık birimi (kg veya lb) ve tekrarları olan girişlerin çizelgelendirildiğini, zaman veya arızaya kadar olan diğer kombinasyonların burada göz ardı edildiğini unutmayın.", + "@logHelpEntriesUnits": {}, + "nutritionalPlans": "Beslenme planları", + "@nutritionalPlans": {}, + "energyShort": "E", + "@energyShort": { + "description": "The first letter or short name of the word 'Energy', used in overviews" + }, + "total": "Toplam", + "@total": { + "description": "Label used for total sums of e.g. calories or similar" + }, + "kJ": "kilo joule", + "@kJ": { + "description": "Energy in a meal in kilo joules, kJ" + }, + "anErrorOccurred": "Bir hata oluştu!", + "@anErrorOccurred": {}, + "plateCalculator": "Tabaklar", + "@plateCalculator": { + "description": "Label used for the plate calculator in the gym mode" + }, + "logIngredient": "Beslenme günlüğüne kaydet", + "@logIngredient": {}, + "comment": "Yorum", + "@comment": { + "description": "Comment, additional information" + }, + "notes": "Notlar", + "@notes": { + "description": "Personal notes, e.g. for a workout session" + }, + "workoutSession": "Egzersiz Seansı", + "@workoutSession": { + "description": "A (logged) workout session" + }, + "newDay": "Yeni gün", + "@newDay": {}, + "newSet": "Yeni set", + "@newSet": { + "description": "Header when adding a new set to a workout day" + }, + "gymMode": "Spor salonu modu", + "@gymMode": { + "description": "Label when starting the gym mode" + }, + "plateCalculatorNotDivisible": "Varolan tabaklar ile istenilen ağırlığa ulaşmak mümkün değil", + "@plateCalculatorNotDivisible": { + "description": "Error message when the current weight is not reachable with plates (e.g. 33.1 kg)" + }, + "pause": "Duraklat", + "@pause": { + "description": "Noun, not an imperative! Label used for the pause when using the gym mode" + }, + "jumpTo": "Buraya git", + "@jumpTo": { + "description": "Imperative. Label used in popup allowing the user to jump to a specific exercise while in the gym mode" + }, + "todaysWorkout": "Günlük antrenmanınız", + "@todaysWorkout": {}, + "description": "Açıklama", + "@description": {}, + "name": "İsim", + "@name": { + "description": "Name for a workout or nutritional plan" + }, + "ingredient": "Bileşen", + "@ingredient": {}, + "save": "Kaydet", + "@save": {}, + "addMeal": "Yemek ekle", + "@addMeal": {}, + "mealLogged": "Günlüğe kaydedilen yemek", + "@mealLogged": {}, + "logMeal": "Bu yemeği kaydet", + "@logMeal": {}, + "addIngredient": "Malzeme ekle", + "@addIngredient": {}, + "measurements": "Ölçümler", + "@measurements": { + "description": "Categories for the measurements such as biceps size, body fat, etc." + }, + "measurement": "Ölçüm", + "@measurement": {}, + "searchIngredient": "İçerik ara", + "@searchIngredient": { + "description": "Label on ingredient search form" + }, + "nutritionalPlan": "Beslenme planı", + "@nutritionalPlan": {}, + "nutritionalDiary": "Beslenme Günlüğü", + "@nutritionalDiary": {}, + "noNutritionalPlans": "Beslenme planınız yok", + "@noNutritionalPlans": { + "description": "Message shown when the user has no nutritional plans" + }, + "weight": "Ağırlık", + "@weight": { + "description": "The weight of a workout log or body weight entry" + }, + "measurementCategoriesHelpText": "\"Pazı\" veya \"vücut yağı\" gibi ölçüm kategorisi", + "@measurementCategoriesHelpText": {}, + "measurementEntriesHelpText": "'cm' veya '%' gibi kategoriyi ölçmek için kullanılan birim", + "@measurementEntriesHelpText": {}, + "value": "Değer", + "@value": { + "description": "The value of a measurement entry" + }, + "start": "Başlangıç", + "@start": { + "description": "Label on button to start the gym mode (i.e., an imperative)" + }, + "timeStart": "Başlangıç zamanı", + "@timeStart": { + "description": "The starting time of a workout" + }, + "timeEnd": "Bitiş zamanı", + "@timeEnd": { + "description": "The end time of a workout" + }, + "timeStartAhead": "Başlangıç zamanı, bitiş zamanından önce olamaz", + "@timeStartAhead": {}, + "energy": "Enerji", + "@energy": { + "description": "Energy in a meal, ingredient etc. e.g. in kJ" + }, + "kcal": "kilo kalori", + "@kcal": { + "description": "Energy in a meal in kilocalories, kcal" + }, + "macronutrients": "Makrobesinler", + "@macronutrients": {}, + "planned": "Planlı", + "@planned": { + "description": "Header for the column of 'planned' nutritional values, i.e. what should be eaten" + }, + "logged": "Kaydedildi", + "@logged": { + "description": "Header for the column of 'logged' nutritional values, i.e. what was eaten" + }, + "difference": "Fark", + "@difference": {}, + "percentEnergy": "Enerji Yüzdesi", + "@percentEnergy": {}, + "gPerBodyKg": "vücut kg başına düşen g", + "@gPerBodyKg": { + "description": "Label used for total sums of e.g. calories or similar in grams per Kg of body weight" + }, + "g": "gram", + "@g": { + "description": "Abbreviation for gram" + }, + "protein": "Protein", + "@protein": {}, + "proteinShort": "P", + "@proteinShort": { + "description": "The first letter or short name of the word 'Protein', used in overviews" + }, + "carbohydrates": "Karbonhidratlar", + "@carbohydrates": {}, + "carbohydratesShort": "carb", + "@carbohydratesShort": { + "description": "The first letter or short name of the word 'Carbohydrates', used in overviews" + }, + "sugars": "Şekerler", + "@sugars": {}, + "fat": "Yağ", + "@fat": {}, + "fatShort": "fat", + "@fatShort": { + "description": "The first letter or short name of the word 'Fat', used in overviews" + }, + "saturatedFat": "Doymuş yağ", + "@saturatedFat": {}, + "fibres": "Lif", + "@fibres": {} } From 708753a5da7ef9d7433f72b0621359211d82d2e9 Mon Sep 17 00:00:00 2001 From: Cenk Cidecio Date: Sat, 13 Nov 2021 14:25:02 +0000 Subject: [PATCH 43/49] Translated using Weblate (Turkish) Currently translated at 100.0% (4 of 4 strings) Translation: wger Workout Manager/Play Store Translate-URL: https://hosted.weblate.org/projects/wger/play-store/tr/ --- .../metadata/android/tr/full_description.txt | 39 +++++++++++++++++++ .../metadata/android/tr/short_description.txt | 1 + 2 files changed, 40 insertions(+) create mode 100644 android/fastlane/metadata/android/tr/full_description.txt create mode 100644 android/fastlane/metadata/android/tr/short_description.txt diff --git a/android/fastlane/metadata/android/tr/full_description.txt b/android/fastlane/metadata/android/tr/full_description.txt new file mode 100644 index 00000000..1b22733e --- /dev/null +++ b/android/fastlane/metadata/android/tr/full_description.txt @@ -0,0 +1,39 @@ +Fitness tutkunlarından fitness severlere - Egzersiz Yöneticiniz WGER ile sağlığınızı organize edin! + +1 numaralı fitness uygulamanızı zaten buldunuz mu ve kendi spor rutinlerinizi oluşturmayı seviyor musunuz? Ne tür bir sportif canavar olursanız olun - hepimizin ortak bir yanı var: Sağlık verilerimizi takip etmeyi seviyoruz <3 + +Bu nedenle, fitness yolculuğunuzu kullanışlı küçük egzersiz kayıt defterinizle hala yönettiğiniz için sizi yargılamıyoruz, ancak 2021'e hoş geldiniz! + +Sizin için hayatınızı kolaylaştırmak için en alakalı özelliklere göre boyutlandırılmış %100 ücretsiz bir dijital sağlık ve fitness takip uygulaması geliştirdik. Başlayın, antrenmana devam edin ve ilerlemenizi kutlayın! + +wger bir Açık Kaynak projesidir ve her şey: +* Vucüdun +* Antrenmanlarınız +* Senin ilerlemen +* Verileriniz + +Vucüdun: +En sevdiğiniz ikramların içeriğini Google'da aramanıza gerek yok - 78000'den fazla ürün arasından günlük öğünlerinizi seçin ve besin değerlerini görün. Beslenme planına yemek ekleyin ve takvimde diyetinizin bir özetini tutun. + +Antrenmanlarınız: +Vücudunuz için en iyisini siz bilirsiniz. 200 farklı egzersizden artan çeşitlilikten kendi egzersiz programlarınızı oluşturun. Ardından, ağırlıklarınızı tek dokunuşla kaydederken egzersiz boyunca size rehberlik etmesi için Spor Salonu Modunu kullanın. + +Senin ilerlemen: +Hedeflerinizi asla gözden kaçırmayın. Kilonuzu takip edin ve istatistiklerinizi saklayın. + +Verileriniz: +wger, kişiselleştirilmiş fitness günlüğünüzdür - ancak verilerinizin sahibi sizsiniz. Erişmek ve onunla harika şeyler yapmak için REST API'yi kullanın. + +Lütfen dikkat: Bu ücretsiz uygulama ek fonlara dayalı değildir ve sizden para bağışlamanızı istemiyoruz. Dahası, sürekli büyüyen bir topluluk projesidir. Bu yüzden her zaman yeni özelliklere hazır olun! + +#OpenSource – bu ne anlama geliyor? + +Açık Kaynak, bu uygulamanın ve konuştuğu sunucunun tüm kaynak kodunun ücretsiz ve herkes tarafından kullanılabilir olduğu anlamına gelir: +* Kendi sunucunuzda veya yerel spor salonunuz için wger çalıştırmak ister misiniz? Devam etmek! +* Bir özelliği özlüyor ve uygulamak istiyor musunuz? Şimdi başla! +* Hiçbir şeyin hiçbir yere gönderilmediğini kontrol etmek ister misiniz? Yapabilirsiniz! + +Topluluğumuza katılın ve dünyanın her yerinden spor meraklılarının ve BT meraklılarının bir parçası olun. İhtiyaçlarımıza göre özelleştirilmiş uygulamayı ayarlamak ve optimize etmek için çalışmaya devam ediyoruz. Katkılarınızı seviyoruz, bu yüzden istediğiniz zaman atlamaktan ve dilekleriniz ve fikirlerinizle katkıda bulunmaktan çekinmeyin! + +-> https://github.com/wger-project adresinde kaynak kodunu bulun +-> sorularınızı sorun veya sadece discord sunucumuzda merhaba deyin https://discord.gg/rPWFv6W diff --git a/android/fastlane/metadata/android/tr/short_description.txt b/android/fastlane/metadata/android/tr/short_description.txt new file mode 100644 index 00000000..2e719d78 --- /dev/null +++ b/android/fastlane/metadata/android/tr/short_description.txt @@ -0,0 +1 @@ +Fitness/egzersiz, beslenme ve kilo takibi From 60589bfa1d69b624e8294acb54b3b7a009fd86b5 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 23 Nov 2021 15:48:13 +0100 Subject: [PATCH 44/49] Remove app_drawer.dart file, this was not used any more --- lib/widgets/app_drawer.dart | 58 ------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 lib/widgets/app_drawer.dart diff --git a/lib/widgets/app_drawer.dart b/lib/widgets/app_drawer.dart deleted file mode 100644 index 6c53d093..00000000 --- a/lib/widgets/app_drawer.dart +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of wger Workout Manager . - * 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 . - */ - -import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:provider/provider.dart'; -import 'package:wger/providers/auth.dart'; -import 'package:wger/providers/body_weight.dart'; -import 'package:wger/providers/gallery.dart'; -import 'package:wger/providers/nutrition.dart'; -import 'package:wger/providers/workout_plans.dart'; -import 'package:wger/widgets/core/about.dart'; - -class AppDrawer extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Drawer( - child: Column( - children: [ - AppBar( - title: const Text('wger'), - automaticallyImplyLeading: false, - ), - ListTile( - //dense: true, - leading: const Icon(Icons.exit_to_app), - title: Text(AppLocalizations.of(context).logout), - onTap: () { - Provider.of(context, listen: false).logout(); - Provider.of(context, listen: false).clear(); - Provider.of(context, listen: false).clear(); - Provider.of(context, listen: false).clear(); - Provider.of(context, listen: false).clear(); - Navigator.of(context).pop(); - Navigator.of(context).pushReplacementNamed('/'); - }, - ), - WgerAboutListTile() - ], - ), - ); - } -} From 672799287f766683436e25132edbb46507367ac3 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 23 Nov 2021 15:48:50 +0100 Subject: [PATCH 45/49] Use convenience methods to GET exercise data --- lib/providers/exercises.dart | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/lib/providers/exercises.dart b/lib/providers/exercises.dart index 4cdd33c7..080196dc 100644 --- a/lib/providers/exercises.dart +++ b/lib/providers/exercises.dart @@ -19,7 +19,6 @@ import 'dart:async'; import 'dart:convert'; import 'dart:developer'; -import 'dart:io'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; @@ -65,8 +64,7 @@ class ExercisesProvider extends WgerBaseProvider with ChangeNotifier { } Future fetchAndSetCategories() async { - final response = await client.get(makeUrl(categoriesUrlPath)); - final categories = json.decode(response.body) as Map; + final categories = await fetch(makeUrl(categoriesUrlPath)); try { for (final category in categories['results']) { _categories.add(ExerciseCategory.fromJson(category)); @@ -77,8 +75,7 @@ class ExercisesProvider extends WgerBaseProvider with ChangeNotifier { } Future fetchAndSetMuscles() async { - final response = await client.get(makeUrl(musclesUrlPath)); - final muscles = json.decode(response.body) as Map; + final muscles = await fetch(makeUrl(musclesUrlPath)); try { for (final muscle in muscles['results']) { _muscles.add(Muscle.fromJson(muscle)); @@ -89,8 +86,7 @@ class ExercisesProvider extends WgerBaseProvider with ChangeNotifier { } Future fetchAndSetEquipment() async { - final response = await client.get(makeUrl(equipmentUrlPath)); - final equipments = json.decode(response.body) as Map; + final equipments = await fetch(makeUrl(equipmentUrlPath)); try { for (final equipment in equipments['results']) { _equipment.add(Equipment.fromJson(equipment)); @@ -142,16 +138,7 @@ class ExercisesProvider extends WgerBaseProvider with ChangeNotifier { await fetchAndSetCategories(); await fetchAndSetMuscles(); await fetchAndSetEquipment(); - - final response = await client.get( - makeUrl( - exerciseInfoUrlPath, - query: {'limit': '1000'}, - ), - headers: { - HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8', - }); - final exercisesData = json.decode(utf8.decode(response.bodyBytes)) as Map; + final exercisesData = await fetch(makeUrl(exerciseInfoUrlPath, query: {'limit': '1000'})); try { // Load exercises From 3b158d92bb41d518eefc6aa72bdf9f86cb3c0aa3 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 23 Nov 2021 15:49:07 +0100 Subject: [PATCH 46/49] Commit current pubspec.lock --- pubspec.lock | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index d179f097..321b0a41 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -77,7 +77,7 @@ packages: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" build_runner: dependency: "direct dev" description: @@ -112,7 +112,7 @@ packages: name: camera url: "https://pub.dartlang.org" source: hosted - version: "0.9.4+3" + version: "0.9.4+5" camera_platform_interface: dependency: transitive description: @@ -306,7 +306,7 @@ packages: name: flutter_calendar_carousel url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.1.0" flutter_html: dependency: "direct main" description: @@ -374,7 +374,7 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" flutter_svg: dependency: transitive description: @@ -393,7 +393,7 @@ packages: name: flutter_typeahead url: "https://pub.dartlang.org" source: hosted - version: "3.2.1" + version: "3.2.3" flutter_web_plugins: dependency: transitive description: flutter @@ -545,7 +545,7 @@ packages: name: markdown url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.0.1" marker: dependency: transitive description: @@ -643,7 +643,7 @@ packages: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" path_provider_platform_interface: dependency: transitive description: @@ -657,7 +657,7 @@ packages: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" pedantic: dependency: transitive description: @@ -748,6 +748,20 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted + version: "2.0.9" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.9" + shared_preferences_ios: + dependency: transitive + description: + name: shared_preferences_ios + url: "https://pub.dartlang.org" + source: hosted version: "2.0.8" shared_preferences_linux: dependency: transitive @@ -755,7 +769,7 @@ packages: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" shared_preferences_macos: dependency: transitive description: @@ -783,7 +797,7 @@ packages: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" shelf: dependency: transitive description: @@ -907,7 +921,7 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.12" + version: "6.0.15" url_launcher_linux: dependency: transitive description: @@ -1040,35 +1054,35 @@ packages: name: webview_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.3.1" webview_flutter_android: dependency: transitive description: name: webview_flutter_android url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.3.0" webview_flutter_platform_interface: dependency: transitive description: name: webview_flutter_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.5.1" webview_flutter_wkwebview: dependency: transitive description: name: webview_flutter_wkwebview url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.4.0" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.2.10" + version: "2.3.0" xdg_directories: dependency: transitive description: From c6bcc3779c1cee6aeacf16302ff4287656de0f6a Mon Sep 17 00:00:00 2001 From: mondstern Date: Tue, 30 Nov 2021 21:58:04 +0000 Subject: [PATCH 47/49] Translated using Weblate (German) Currently translated at 100.0% (152 of 152 strings) Translation: wger Workout Manager/Mobile App Translate-URL: https://hosted.weblate.org/projects/wger/mobile/de/ --- lib/l10n/app_de.arb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index e38f9204..0b3d7c30 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -531,5 +531,11 @@ "recentlyUsedIngredients": "Kürzlich hinzugefügte Zutaten", "@recentlyUsedIngredients": { "description": "A message when a user adds a new ingredient to a meal." - } + }, + "searchIngredient": "Zutat suchen", + "@searchIngredient": { + "description": "Label on ingredient search form" + }, + "logIngredient": "Im Nährwerttagebuch speichern", + "@logIngredient": {} } From d17717cb1ac56358e33e0f0d273561eba7f88761 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 3 Dec 2021 12:04:51 +0100 Subject: [PATCH 48/49] Move fastlane folder to root This is needed to be able to publish on f-droid #84 --- .github/workflows/android-release.yml | 2 +- .gitignore | 10 ++++++---- android/.gitignore | 4 ---- android/app/build.gradle | 8 ++++---- android/fastlane/Appfile | 2 -- android/fastlane/envfiles/key.properties.gpg | Bin 621 -> 0 bytes fastlane/Appfile | 2 ++ {android/fastlane => fastlane}/Fastfile | 16 ++++++++++++++-- {android/fastlane => fastlane}/Pluginfile | 0 {android/fastlane => fastlane}/README.md | 12 ++++++------ .../metadata/android/README.md | 0 .../metadata/android/de-DE/full_description.txt | 0 .../android/de-DE/short_description.txt | 0 .../metadata/android/de-DE/title.txt | 0 .../metadata/android/en-US/full_description.txt | 0 fastlane/metadata/android/en-US/images/logo.png | Bin 0 -> 13020 bytes .../phoneScreenshots/01 - workout plan.png | Bin .../phoneScreenshots/02 - workout log.png | Bin .../images/phoneScreenshots/03 - gym mode.png | Bin .../phoneScreenshots/04 - nutritional plan.png | Bin .../images/phoneScreenshots/05 - weight.png | Bin .../android/en-US/short_description.txt | 0 .../metadata/android/en-US/title.txt | 0 .../metadata/android/en-US/video.txt | 0 .../android}/envfiles/decrypt_secrets.sh | 3 +++ .../android/envfiles/key.properties.gpg | Bin 0 -> 629 bytes .../metadata/android}/envfiles/keys.jks.gpg | Bin .../android}/envfiles/playstore.json.gpg | Bin .../metadata/android/es-ES/full_description.txt | 0 .../android/es-ES/short_description.txt | 0 .../metadata/android/es-ES/title.txt | 0 .../metadata/android/fr-FR/full_description.txt | 0 .../android/fr-FR/short_description.txt | 0 .../metadata/android/fr-FR/title.txt | 0 .../metadata/android/hr/full_description.txt | 0 .../metadata/android/hr/short_description.txt | 0 .../metadata/android/hr/title.txt | 0 .../metadata/android/it-IT/full_description.txt | 0 .../android/it-IT/short_description.txt | 0 .../metadata/android/it-IT/title.txt | 0 .../metadata/android/nb-NO/full_description.txt | 0 .../android/nb-NO/short_description.txt | 0 .../metadata/android/nb-NO/title.txt | 0 .../metadata/android/tr/full_description.txt | 0 .../metadata/android/tr/short_description.txt | 0 .../metadata/android/uk/full_description.txt | 0 .../metadata/android/uk/short_description.txt | 0 .../metadata/android/uk/title.txt | 0 {android/fastlane => fastlane}/report.xml | 0 pubspec.lock | 7 +++++++ 50 files changed, 43 insertions(+), 23 deletions(-) delete mode 100644 android/fastlane/Appfile delete mode 100644 android/fastlane/envfiles/key.properties.gpg create mode 100644 fastlane/Appfile rename {android/fastlane => fastlane}/Fastfile (75%) rename {android/fastlane => fastlane}/Pluginfile (100%) rename {android/fastlane => fastlane}/README.md (85%) rename {android/fastlane => fastlane}/metadata/android/README.md (100%) rename {android/fastlane => fastlane}/metadata/android/de-DE/full_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/de-DE/short_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/de-DE/title.txt (100%) rename {android/fastlane => fastlane}/metadata/android/en-US/full_description.txt (100%) create mode 100644 fastlane/metadata/android/en-US/images/logo.png rename {android/fastlane => fastlane}/metadata/android/en-US/images/phoneScreenshots/01 - workout plan.png (100%) rename {android/fastlane => fastlane}/metadata/android/en-US/images/phoneScreenshots/02 - workout log.png (100%) rename {android/fastlane => fastlane}/metadata/android/en-US/images/phoneScreenshots/03 - gym mode.png (100%) rename {android/fastlane => fastlane}/metadata/android/en-US/images/phoneScreenshots/04 - nutritional plan.png (100%) rename {android/fastlane => fastlane}/metadata/android/en-US/images/phoneScreenshots/05 - weight.png (100%) rename {android/fastlane => fastlane}/metadata/android/en-US/short_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/en-US/title.txt (100%) rename {android/fastlane => fastlane}/metadata/android/en-US/video.txt (100%) rename {android/fastlane => fastlane/metadata/android}/envfiles/decrypt_secrets.sh (84%) create mode 100644 fastlane/metadata/android/envfiles/key.properties.gpg rename {android/fastlane => fastlane/metadata/android}/envfiles/keys.jks.gpg (100%) rename {android/fastlane => fastlane/metadata/android}/envfiles/playstore.json.gpg (100%) rename {android/fastlane => fastlane}/metadata/android/es-ES/full_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/es-ES/short_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/es-ES/title.txt (100%) rename {android/fastlane => fastlane}/metadata/android/fr-FR/full_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/fr-FR/short_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/fr-FR/title.txt (100%) rename {android/fastlane => fastlane}/metadata/android/hr/full_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/hr/short_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/hr/title.txt (100%) rename {android/fastlane => fastlane}/metadata/android/it-IT/full_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/it-IT/short_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/it-IT/title.txt (100%) rename {android/fastlane => fastlane}/metadata/android/nb-NO/full_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/nb-NO/short_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/nb-NO/title.txt (100%) rename {android/fastlane => fastlane}/metadata/android/tr/full_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/tr/short_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/uk/full_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/uk/short_description.txt (100%) rename {android/fastlane => fastlane}/metadata/android/uk/title.txt (100%) rename {android/fastlane => fastlane}/report.xml (100%) diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 367dca86..86c1da99 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -29,7 +29,7 @@ jobs: - name: Decrypt config files run: | - cd ./android/fastlane/envfiles + cd ./fastlane/android/envfiles chmod +x ./decrypt_secrets.sh ./decrypt_secrets.sh env: diff --git a/.gitignore b/.gitignore index 8317ac5e..eb18a5b7 100644 --- a/.gitignore +++ b/.gitignore @@ -40,8 +40,10 @@ app.*.symbols # Obfuscation related app.*.map.json -# Exceptions to above rules. +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages -/android/fastlane/envfiles/playstore.json -/android/fastlane/envfiles/wger.properties -/android/fastlane/envfiles/keys.jks +/fastlane/metadata/android/envfiles/playstore.json +/fastlane/metadata/android/envfiles/wger.properties +/fastlane/metadata/android/envfiles/keys.jks +/fastlane/metadata/android/envfiles/key.properties diff --git a/android/.gitignore b/android/.gitignore index 60658c9a..bc2100d8 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -5,7 +5,3 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java - -# Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app -fastlane/envfiles/key.properties diff --git a/android/app/build.gradle b/android/app/build.gradle index 58146be7..8633bbe8 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -27,14 +27,14 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" // Keys for the android play store def keystoreProperties = new Properties() -def keystorePropertiesFile = rootProject.file('fastlane/envfiles/key.properties') +def keystorePropertiesFile = rootProject.file('../fastlane/metadata/android/envfiles/key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } // Key for wger.de REST API def wgerProperties = new Properties() -def localMapsPropertiesFile = rootProject.file('fastlane/envfiles/wger.properties') +def localMapsPropertiesFile = rootProject.file('../fastlane/metadata/android/envfiles/wger.properties') if (localMapsPropertiesFile.exists()) { project.logger.info('Load maps properties from local file') localMapsPropertiesFile.withReader('UTF-8') { reader -> @@ -55,7 +55,7 @@ if(wgerApiKey == null){ } android { - compileSdkVersion 29 + compileSdkVersion 31 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -69,7 +69,7 @@ android { // Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "de.wger.flutter" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName manifestPlaceholders = [WGER_API_KEY: wgerApiKey] diff --git a/android/fastlane/Appfile b/android/fastlane/Appfile deleted file mode 100644 index f469745a..00000000 --- a/android/fastlane/Appfile +++ /dev/null @@ -1,2 +0,0 @@ -json_key_file("fastlane/envfiles/playstore.json") -package_name("de.wger.flutter") diff --git a/android/fastlane/envfiles/key.properties.gpg b/android/fastlane/envfiles/key.properties.gpg deleted file mode 100644 index 09b057b9a2b4e9a1f07b4faf56a11e7ef314dfee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 621 zcmV-z0+RiV4Fm}T0^d5oL0>=P$N$pl0k(~<3ek8&=DKt0h-O!8AU|(YkD|-iB#yx? z2h<4}X#{0uj81pw!=?vKJ;_FaAIT=HT#IN z?m9{?<X8x(Uh+o`z7H)OgT7K z5T@y)W9+?blkYBC5Nb^idzI0+VD7s6%Llh*lSRUefdoIc0Fan|fRHi@_6e?*4ElXB zO^@C6)0rWZC*063Y(;;PyGhTzXqz1aquh`K_oz|-*~qO|D9SI5G$-S~=Mi%2IF$7o z^PYwue|=`+y||1$bL)3J^cf_$Z4jaOIJ)j_-ccxg5Gdo#koA4ge^8v*sQsuUbkDk? z$4g3klb#!o{oWo=IqhZyk+;%oQ($ehH~~=Pt#)vgx*xtT$c)HWu)$KrAcC2Xu3rST zNf!QL8mYu~I{dk=g{~6QTN>sWHK|oLQWCfo-@>NLO5jvmR4BVgU3oh|(3(BiuF?aw zJdO`aK8^J$tHQ}EfpOvueiWq2lx2?F(?`C04eJq(|NXnlAE0a*He-?p+BlmUZ9j&4 z7Z;Qv!2-cKA2rU1OdsbgTfUu*nE&AMjbOILI|W;n1uOk|VB)F`X4Kp4DNxXs8MTNl zV5VBq4qT)qv@^M|jWl+UZF!jO>qn3t>g73l#!6ziO;BXf8n-D5;gNDpWnF%ZaudV+ H(!;Q)a^y8` diff --git a/fastlane/Appfile b/fastlane/Appfile new file mode 100644 index 00000000..9a5da25e --- /dev/null +++ b/fastlane/Appfile @@ -0,0 +1,2 @@ +json_key_file("fastlane/metadata/android/envfiles/playstore.json") +package_name("de.wger.flutter") diff --git a/android/fastlane/Fastfile b/fastlane/Fastfile similarity index 75% rename from android/fastlane/Fastfile rename to fastlane/Fastfile index 6be66427..13edb534 100644 --- a/android/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -25,12 +25,24 @@ end platform :android do + desc "Check playstore configuration" + lane :test_configuration do + begin + upload_to_play_store( + track: 'production', + validate_only: true, + aab: './build/app/outputs/bundle/release/app-release.aab', + ) + end + end + + desc "Upload app to production" lane :production do begin upload_to_play_store( track: 'production', - aab: '../build/app/outputs/bundle/release/app-release.aab', + aab: './build/app/outputs/bundle/release/app-release.aab', skip_upload_metadata: false, skip_upload_images: false, skip_upload_screenshots: false, @@ -45,7 +57,7 @@ platform :android do begin upload_to_play_store( track: 'alpha', - aab: '../build/app/outputs/bundle/release/app-release.aab', + aab: './build/app/outputs/bundle/release/app-release.aab', skip_upload_metadata: true, skip_upload_images: true, skip_upload_screenshots: true, diff --git a/android/fastlane/Pluginfile b/fastlane/Pluginfile similarity index 100% rename from android/fastlane/Pluginfile rename to fastlane/Pluginfile diff --git a/android/fastlane/README.md b/fastlane/README.md similarity index 85% rename from android/fastlane/README.md rename to fastlane/README.md index b925fd02..1134b660 100644 --- a/android/fastlane/README.md +++ b/fastlane/README.md @@ -24,6 +24,11 @@ fastlane playstore ---- ## Android +### android test_configuration +``` +fastlane android test_configuration +``` +Check configuration ### android production ``` fastlane android production @@ -34,14 +39,9 @@ Upload app to production fastlane android update_alpha ``` Upload closed alpha app and update store entry -### android deploy -``` -fastlane android deploy -``` -Deploy a new version to the Google Play ---- -This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. +This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). diff --git a/android/fastlane/metadata/android/README.md b/fastlane/metadata/android/README.md similarity index 100% rename from android/fastlane/metadata/android/README.md rename to fastlane/metadata/android/README.md diff --git a/android/fastlane/metadata/android/de-DE/full_description.txt b/fastlane/metadata/android/de-DE/full_description.txt similarity index 100% rename from android/fastlane/metadata/android/de-DE/full_description.txt rename to fastlane/metadata/android/de-DE/full_description.txt diff --git a/android/fastlane/metadata/android/de-DE/short_description.txt b/fastlane/metadata/android/de-DE/short_description.txt similarity index 100% rename from android/fastlane/metadata/android/de-DE/short_description.txt rename to fastlane/metadata/android/de-DE/short_description.txt diff --git a/android/fastlane/metadata/android/de-DE/title.txt b/fastlane/metadata/android/de-DE/title.txt similarity index 100% rename from android/fastlane/metadata/android/de-DE/title.txt rename to fastlane/metadata/android/de-DE/title.txt diff --git a/android/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt similarity index 100% rename from android/fastlane/metadata/android/en-US/full_description.txt rename to fastlane/metadata/android/en-US/full_description.txt diff --git a/fastlane/metadata/android/en-US/images/logo.png b/fastlane/metadata/android/en-US/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..9897116e099a55964a7ba1b462654c3648fe3c43 GIT binary patch literal 13020 zcmcJWcT|&2+u(1yQk9|zQdD{gNLPe_inIU$MMSDf5$P>-2%sP+f&mEugdjx(0qIRC zBE9z(dhZHIFFW`=@AvH4-E+RP@4Nd)PIAJPnYm}Kx$2J)q^2?rB?~14K{To=w{;+h z7`DR)H@sxF|hvxodCX;`YeN9CCAWgIU>G zJ3o2kU=Fi)vW#23!2&^?km_y4d+zZoBOYiYSD)=)?c4FPgVmf@IXNGvs`4;gmPBGR zZcqDT8p#F|e!M@Q{2=p=p%`wunv#4uSyzGI%!2+U z`rPF>j9lb&!iLXLiTEXCwEpUQ=QX*tevTu5=k`NVp6%_@xr1}3A;|1aDjTHW@xI4> zO97%s~J*e?OZ!^@qmb5$|JnRce%^Qf2l%xg|b}A<|XBo zJzgT@eMSi1)Eet*WwfRp3Fqp5AtpPPdc|;$~hKvJ`VO#^&XD?-JBpe zwNJ!%g%Uz4SOoyn|GKIaJKhy)8GytcWkXvY5~?V(ZLNmLWku`T&MD zRg;g6+W7ua168W7tfJ=9;JjZD!^n$iarI(;F37(6QY!WR>8dIugr<~|96KoLSfRwi zB&`a#1bufkWe3%9jOAYAlzliagYB}S#55plo%tpFEQFEB$~C{wX~LOLl_lfsmtwy` zr+R$lG}d=KZA*jAb~^<~3MNAkQ;Iytx9%Ip0t=td#`NfElBr&k9!Zw5TG20_9xWgt za_0w6M5NiI-2GUjKo#Ym@}O7tXXTGeZlqE%nT6%~E6P@u#K_x3kdDL@A+4B8wPQK^ zRp4aSQ7rS0N!xU8^G&QTeT=l5Yr)ui6c6VTAEZE;Hl3`RgxTe()X9z)FuilE;;wqu z!FqAg@SvtZoJb#>^qmgXuzvQl!|9nL2b86E^xq*?1tqcdJXG8xOzvG}xz3H@-EE|1 zG-MDnQND%I!+x(#Z4Ngp976eJrPpC-B$*NXbnAIr!{LfcD+&tte_kSu8r<|=D%Ej{ zB#at+x7Z(i^TGv2l4%_CaA(P}sUKZgK`3NR1)k!I4029hP&IsDl_&m+ciDUcb&M~e z%$sB*qAQ5-Aw{nzK@hjp@A&zcj;W>TvfH)7Ue-<)e)_+eh;Xa-KPxQ@or+>7gZSR+ z?>;rO*C}afeK;a96mNgPjlALC;Zp38_r-bzlbFhODxHZDGTpK9e6sYyqN2;FzG25p zmzPF9Q0_9&_{=J$#1r7ifYKuO@J%;WRiat-;^0Dv1>fEq9D#-0*@ZBup3QY z>Z7@ypXuFxl+h#oNz9@9x_F^Wj@7=>5Dxw977;|A^hndCAo$mBC!@zY->VX{D`o=y zQ|t|xi%>oyi<+_wNMSyx3i>KjttAX&t-(};-i`3$>t=%qFX|5;Jst8#t0@yf#_Eh@ z-D~PF(*Toq4on0y{{w6Pxevjz$@N`tNbd>Ax1ja3#|FIboEd0cy{>8zLcopdakns* zH=CCU7yaC8wf>L=)I7}(2i7xpZ1kZE4iKD-&!GhojMx6GxF46=q%t#-vKvyaEy5p=%RE;P zVRB<4OzN;IL4|LK(Xl8U`Pg$_Ng8=nT(ytK>zC#$#m%~S+^knt4G*#=;pET2!X>Th zN;T|NG5A5F^Awo;6uQ7(Kjo@a3gW@vM%L%u!1d+hri7j~MR`l`-xC{~)@ynf8AAwu zB*?C4v&EtKLCNU-E58^NC!UcHN&?%T_e z^{T((=SAXP^t-v_dWI3YN0pg4yf>jx@gvpq>d)lwG5je0w@VyOt`nHx3I@42 z6wi1e5<)I~eq^^~sJa46Y+Ut8cY$$Z)~L*+duP7K$#|T37fOr{)ddnD5>Us0(_0y`l?vzxYEIxN;WYN@mAJ*DjG+-NMSWjBDesWfli z6IoW5J;SLDAr)EHHP)O5=}UbSvIAa^>>~vU`}aTDNcR6Wnvxo6x<;bHN(Oz3>m1k| zSrzp(wTVG6evYw15N(muG_w>xgjSAB}M8rBfU?n+8_WZ`KSwdDHAk!bf zi+KdA3u9mo9yZhm4cU{|NV>FITs7P*hr_#QpD*Kq3?i=EN$1S`b=A37$sYc`3(G`VsA4Vu@WYb$ckZ`3Dc7_E0GXue1E*P;uOXWmW-gn!etL^!a5|P5- z#l5gf`)eE|a8bx7ypCXKf}nKtYJacp7m4EOVW))D?CP#{w#dK?EiL9k><_9UPOjrk zPJ>jEiO_7>_q_X;~|)<4bYPJ+`9j)vN$LXyk5U53AgWYk?3--yVhD}4{SXfMjSphZ3nZ!B)D~A~-tj*> zzUspk=xv4ua)IZS3ETCdi5vCyS3Vtfk|c(N@O$2yny;o*{Abt0 zIMOu^%PE@z44fK|nCRSKewS7dD(A^KYb@d!S`nBM-L732cinYg{1%SBbOlo&M(b%m z^mR7qJ=nwRd?1ROuM*J{nqq}VD8d%VoGTTloCM47EAMyHK7Xr3)NqE}7ZT|##zmwY zi|Kjwf11D!Aoyg#?>a<_XV_qcFa0^H1Wm=0Y(79eqChrqVtv3YNgaM#NWY^ucY3V5 z?K$vbJ@}w&osH~2S}|={##j1>5cx+=e%?VN)k!_Ohy7a)L;grlMl_2~qP=JFji*-^ zY{0fMR|F7lk!@u?@NJ!avsDk)(**`XFE~FOok=D1r=`y0vx~vB$hfq-d z`g&Ww-7NV;4A)Z`jP|undtsFSJx4GUQ*hUuhRl?-1z3O2$nWNqHc92Q=Z{B;6ztSm zm|~WbxH=9JBwrm1uORflE8M&DU%?jEDz}`c+0ZBJJk;?KY#eYX**_N(-ptQgSvC=q zCp*3TV7lkiNQN2X>^?1~KHawB3%T2psU}Ukk>+NPlvEsIttc|g8PW8a_BQf0LJ#7^*WeI!sH)@TMnrL*%NK7xh+F5sta|D|%pe_98?QFj&4Df2!^`qE%_zMK%oum_CsCj7B${ytOvhG(BJ z2pJH)p~RvJ-E9W$DNKvmQrjLdX`o>$;i_b7vaX`42TdAFL+qNecMFrCuWvvgNEqd+ zxHoMa-wH61jh_)` ziCbdGmr^}{kq}D{A&pKV8mr9G?6vEX2lT--hi;6J>fKo>wzzz}ZnpYf^ky#Dk&O7b z$IdT!)>Lnllznt|v>d_-sHRa>wTRD!hcDH6*R?)0VrgCVfskG@HuLYy^PrXlwwVN0 zj^lT6(Ip2ePn93yQbKH6MKpWxXR>O$T+f&tMSkB`zB6{1bZld5`fHR0=ivovhzrc9;b*H@XL4 zMt4c$8;%`_J*`NSTu0mepaSuC2CYo!pjRKXhZv4iTcS(7KMa(eheQ=b^sh!d$8Nja zVeM|a2P?b>{Rz>FL zch@^p;_HQBKG!3fapM#aU*&C`@h%d7Zao)Qq228Q5*lS)CiK5j3XPLM{h=>Zr6TUJ zoY!IW{@RPgtUflf%w*`cHqy`U064zna-PNvE@=pFfn)UgrCl`^-t?kh?oR-XBTt^B z=-R8B6>nKSr%GcpLIuJii;zY)fnVkqCjC6#w)A;y(^0#OhtC=9493NI}Wj z4Tnn+<|)sxUYUGTaOGPh1`hMOdwbpU%brTbNiSDZ`}sXKnS{b zUcA(-D_*tIZ)j_d|_KzpJ0Ai2TZE^ zQXfH3l)q|Hd0m{%NF&D^9@=fs8rCl&WqgP`wIe=oSx!QmHQ*4D76v>R6QjuxSiyOjN>bdK;5=elO@7~1vILq{dKi(R5l3sha`6j82 zg1L(gjk8p)=gu4E+C>`EfoHEaiVEG!0a zsi^aGWs*H}1|m}1A~Z9t5TtM#N6$TUZm}xlBourkD#F$yy~ALk{DgQrb+Qkr%7QZ) zrNmX*JCZb8seuB}RNeWbq1495li<+aRWqsh>fe&T?kg(7>Ods(Yq|MOv(4L`Enpp$ z`0eQLy(Hg=B|4ApEWI+TcKxCEJ_UsTP$K9uSfAEndmV+(x!^$LupJ(gDO&Ipg7EPz zX0GQ9Z;U5$G|*|tSyn%KB(`@=H90t*8tm$D_sA1zwvWA;Q~mqZL?c8E+)pfCRdYaS zH8+=AYf;YL<3_VArh#*Mk9bYb-rGbt%9V%IB_4g3_iU3o5M&z22JfxNR zA`4|-r9K7*&XX$V1yDYMI0N~>N3%0z z5QL@%m9hU@;nD&UJnG^#$ADR%gO-9P)Pos02MX;6DCME6$UDkx9wo5jfeTjk%z1G~ zyZd`9MMhTj3Sl7eHRE~Bn&qqozqZ1B3pLDktVxva7#zlNx3@C+cqhz@58}JP4wm=t zFWvE+LRic}U5%N4YV1Tq2t&|j8C&_*v$YBm?&hl&_uh{>3=Ck5=msjBb3C`Pt8OmK z^ViwrAN{OMR@RJ1c3r$R5wbKmwt|o(Q41tSUb%iWksm8+=Q4CP$ZQwex8&s}_aJXc zGC}IDbW7zIvwo83gC`%auX&`K^~-MG;0 zt^6PD_g^PjgAQ6~Z}$ivMG;a8o;=-5uRi|x)qaX$uM$4=Adg!4qP%9}?)(CGIXfD= zH|$qxAhJAgH*e|i*S_U^&jnuUMag94nV!8*-i>0^y;EB9Im7)2Tr14FVZ@>c4)6YZ z->hfXQrVuU6df#H@bMXGS3`X(W_RWS6}Dv8ZTZh8wuiQj*>01+>{(oh(wkrGMdoV> z>jx$6E!+y%hJr%=vqy|4iwKa>EU<2`z!-1*JpIJXg8Lf}^fkWRx;}dpW9vcI5Z?KtrXD1Va%gY4sNf0y^&8v` z?aq(wC->a6`-#@ltcagqN6zrUPPe(r-S^-miq;63$J-mifxaWP=fCEhoTQ1%@k0aO zLz|P61#wo9$+Q2j?DT)DXaBYb_+LlH8x9fWrBD2LvN@F_EVLk5 zAI_%RwM0}Ucma;O*9fl!hTo`b>5(ZP#DA(r!CuA&JUL|A(ek=Iho$-oc;0{CQMC~> zr*Ry)>f|O&uD%T=-C=#FQ;~F-Nq3uRC6{sTyU@uI&gEAcfc4ANq z+NwB*oZQN(q2fw>t>4&N6m=974%Yvlde>m0-j@fwa1kn@Ug~;H`J2FrxOe1~Z(;IX zcM}t}^DaKQ)BA4uA(~6l=Y#f!yst%Lwlr$9!&mwEAlBe_PrgW$P(9Lp@>2y|Ef{#N zgu{`xf-BS><8t2L9{>+$6VeT(ZUoiTEz+nRyKNQ^qZV*;ZYgXek^%qOMTsXvV+IQ? z6D!=d15Z5u`*N@DH)yfp((>XAKV`R-K`e^2=L{%*&Vo6uI-Bf2vXQv!f>?o~GFgG+ zKlAqg$Ec>~6qQXCTpffF_&X(rFt10P@Ho~ECX$u4axn->zh~!qjw_C0J(;A8#56>1 zu5AR^KY`ft`mXJhFIjpRcJD;Ks8I)@QB$oU8UKU)(&WQm{s#wWN`;a1pLVK^Uob=v zI?wTLTfk18{}K4U>eg6D!n+0b$jKyS5(t_ZUw^PVw!HXYeT~GYl`~;!U)pf;Do~Mk zKcZp+MigVbQGX&#W~SMSi7wjQb07$7(vD9#{uE{%EiWE}rP*OU?2eP#WS9Icp}H55 z;=d*Ve%xun{vA^Icz;$6%J#gA~Bm^38hrPkcJwv$8Gk^ml1e_*Y_0Vy8ULc zaCy<)ZLMKg{sD6IBSb@zxQ7 zY|fBERi{KhnRexD@lJ5peCvy_pRhM9o<8b0xQvZg^#{|xFXz{$PpAaR<&%>0tbKLz z?eb1*S0eq63wX^@ZyvCmf)uXdN{tAGt9!EQj=7K4mbVGX+eeSPdgvGtC{KQ3uRgzSP9L=n!=_i!HulGJ?4@&UjdwL=?{~?n zyPjlAEhz&t@R4h%eh=9r-(7zlJsiWaw*P~H6*C9- z+;iiB&)8!YdUQ-cH2-i`M`+=b-~G@P2%hFcGe#uS;~YNfyq)qXKT)FlVyR)>AW-bD^y0M` zx%)_`hoBGrvFXTn#+O7jR{rCR(Yg6@mT_O6_!RTrI3T<>QlI zD^_OAxw2ri)wf>7?C{^426QS68rOTLL(B*?U=I}^=Vd8k;(JF1kNmnR-|iK!1$l2Q ztdA!e9u=uIkN{?Z5&I+VfYr;3&U-SKLIXI*=^n)dP|;>L8(v~x!zeY5NW^#Zw3s2 zfD?=a!l!X#eCP7oH$NL4gca0K-`72d_N8%-J(fAWd@eGrtUOL%_t*n0u016{Jqd9v zAwZqu@w2?Ms6d=Xsh2J$-%`2MlJ=E|JOAxm-eTZ-`pumlwLY!HnOdKIo+5h&$}-23zgJYsQ^< z;95G02u4zfTJ?DJa8Cp)ye!YXqo<^eL1pNCDg}}cD`pBh3Y${hULFEl8u%zW#@gV6 znWL!GHeK(R&-P!Q6+tSP4}3Ace(UFXOrjfj<6^i@LGG@0YSR^3=LqijGlY`A3Rp9k z5F*F>@+|#vj474SEntA=}V1tjkbc)%X=JIB3g)$b7K z=k|%b9s}wDgZCpC)qI21UwMM+NGuBf7W3(3c~6=@R~6`V?Z2{=a0Z?;FU3za5#h!g za?WPa#*1?WaYZUbw+W%#Hy8zkBeW16nd}nYo>tGwkv36WX*u#6p7rKXm)42 zM+(*QE}S$9lEI|p*#QQQs)@A|u0~5AK6byk7s3bSaEAu$?N7m}QdmcpRn$OfAv^Hn zX5-oy&f+iD8U@@dh#o+%J9 zKR+q#u$`jHnk~C+kt_4`6x7w@*7oY~W>@cs_4%=PDEzaVM9cvfoMSarzmK0QJ!(ja z$$CL#%Jo}hA)mMPTNqgPEh6TipwcW4>~U7g)S${KsHuI%u1m@}%T#sjr>H5--5RCN zbTj*jNQ=JJY{$AgHz6c#i2A;Mm)>>I^uVD;zh4O?DZP)CXJfRd5CwIhphmM7x9u#- zB)^onPQ|9Sr@a4k9|@^_uDBX|>6N|M0wS`0neP-7IJZ7v=#MyNiHntXD}aM1dU%V7 zFLGhGFMq@*RrRis)6|$G^fmj4+sAIt_e^lVOV%rPgzVj{$4G&X6=Ba2W%?G%U*4X9 zzGj>hnMH^y2;_%v zt#DM`R)lc6H&R6gU|KS%BA~g#DA8iOS980l$!x8!`u%5!la*F3)qZT$r3 zal(wuup4%EU$8~Uo&n9YCx5u95~VK7&oY8Rmm&PnZ@J0M#70}+zq{z?L01k@Lx^_c z>JsK@Me)zRfzZ$H5^}~`QZzz_4-(pH-&Vc(sR4h%W1Y%A1PyiWZ`udj#K=#G5CRIvt6m&Fe7Jk!pyNENI7k11xjv2ExZ{hK-YL?(2?OOdjUaUYnREje=GOx8T8p6zX#z6H-n39Q(qDm zm59=f!LNWyvh_{D>2Ab~^_K1gTTy)fDf;wY>EEq_*J010sQPMM6|J(Kp8TQ})F=CF zcm@j@{!UL~;e4xf9bKGzpDzpwFpc7_aJClSx8u`N@f-=%*t2_LQ8 z=ed8%@O*NV3Sk+bZFfa<|Ev0Mr)$o@cve-{cnZ|3R`rMSGBCh zrytmr(f0l&E)<=lj{Qn!?a3JxykYR%PXDq z{W(=*Pi}G+(yb7f!qCKXfZz(n-9YK#t18|-p9s(x3rkRuWe@;FkH}S9O$qK(liV2C zy|FHQ)DCJbMBzYhG zPc(zIhvNtQX7nvuG9o1Z-u?A|`k0en*r}nh#h(wqmOKA?7Dl7xvdaV;PMsV9uwT^- ztX~Ri@+)m*qF}YHHnVm-oM>|RBKhZk+4II6F}?B6%upAm#5+-F$NQf~D-zUim1bxZ*?&IvL z6b%dC-*s=c3IX4-k_1`^C-k6ef&^$djSyrU&oIB9)G>%WQctrkw|HSP_k}$Q?6rAk zMED!6uN^jduXN*2tkrm74EOBNC9P=CS-e9G1SI9gy2i6v5wTbF6z`mcXwBDU-m*mu zX83q*3wte72o`;Oe|k`XsOn|Kf4tgqR-un+nmu+Q^985d%3u7)B?GWC zs#4!_f8WIUX?7V5K4jK6TQ6}RN*j5{0J^~24fB(yIetX`jhf?5UN5n%#$ zK24!S_cCwi8Np2QoR_mjZj^e?oPeGp%0vpapW3Cr8Q4kVmcIqxkR}r_20oZFZ#>#C z&#$)TeX|MBD!mZyEHH^BCW^o(!9L#dFl%?5MF9g$E(mf1MBe-ad zHwI)Es{2Nxcuc>5sRVc>jlFK$B*U-=&#-sI;n0=Fe}Np+^BaG4yW8oP(h zjI&%9Y-PHx1ev=!^fv(qUtvv1Gbr?QjYkQX%76i%(d^E<>k;k|ZYit^vE2^&7p3%1 z+`@pQWQ2O2|A}C!Y%xZh{O6RQ8f-~{iA5$YV?e4wpRz3A;iBjPrDr}A9~~Kh>~D1S zA3&VCHC{{15740hB05N;NKR0`J5Rd381k7g-_~lo`_X!q*#XVBaI2>t8uZ{FIDJ7Iwl_p(eoX)AwQ(W8} z)i9{cxwJ=>6gR@b^|0fQ2e2f*0~R)TR;hY(A4Ao0z=IuiYUqNQHNGNqcttqp>IOTC z-qTzq$$L%*H)}hcpL}(SPS9J2U4mEbji{P})K0bHk(Fxe$dr^1uJE8iOnxUqpXR(0 zL%~OfRAPhiY{$o56AzljvOlF|=s~I(o_d+=;H-dXD4BUcnMG5cT{E6Q%eY6SbNXz9A-q zl-62r<_iSETB4IPHBPoJsYHK_<5336C*0#fbAZSnL1|0j3#rB7rvv`j&NoCK!Hm0>B>nVSVr!(VJ-r z`Qu+WFZ|Z?CwoQk$tx#_8I!g!dQJM{Dl)i=@zzG0E7+>s zW8kq+Qf05fNjVH!%#bZO8vs{E6uO1aZG8U3S)>y+b zTh!+2@hau6277r%(yi^y8K)%ykt(;=tB1rQ5%@PWzTmQ0VN#TM3Qn3}>Vbys@u)!LdD zAy9-zahyN0E0?-p8h9D~25xWj$j!zmFV)42pEOiQXvgq+aE z8YyMvu7h&HCq_S7=t?*-)D!W?9k^g{tx?`V)4b&ppVna2=#n1Rk~NoZaf}>nL61jn zHG98~e1e3|<+fMTjxr>A6Fl`fLl@<1bI z1DolmgL#XS_I3#?f>^C#fH1zt)4?$>!})&5cSbwyHol~Kx%-!!K}K!cV>-(0NSf!J zv!79k@^b@|c0FRfXGC%nQr1@`~FbYo=m!ez5xoA;LNm zSI|=X&XE0ZyxtW#&Eq0wsRe{SRvm-$rY5emtpe zjY3fyiw&gprKb_=9<>blM8~LWe$`6>~IwHU^wZoMnJ>G*S5KyWQZtB+1a&UG@Df*RG$ZV(R%Gb!BMeI_!1DAbAtmXG4aQZi>fJ zR287W14Bv(attc4tlZfEV+C$P&hvf^VYXW%K%b+GXjlJnZ1AeZqD64!x>KnsqpxU& z?TD&HFJ=&w{jodC%B@k5s@~S$+$)cUo%oc^$k`JpkSROzNNVi`<-?B-e)6<0_!{ft PDl4Pz%6bvtBom0%+*Uhe literal 0 HcmV?d00001 diff --git a/android/fastlane/envfiles/keys.jks.gpg b/fastlane/metadata/android/envfiles/keys.jks.gpg similarity index 100% rename from android/fastlane/envfiles/keys.jks.gpg rename to fastlane/metadata/android/envfiles/keys.jks.gpg diff --git a/android/fastlane/envfiles/playstore.json.gpg b/fastlane/metadata/android/envfiles/playstore.json.gpg similarity index 100% rename from android/fastlane/envfiles/playstore.json.gpg rename to fastlane/metadata/android/envfiles/playstore.json.gpg diff --git a/android/fastlane/metadata/android/es-ES/full_description.txt b/fastlane/metadata/android/es-ES/full_description.txt similarity index 100% rename from android/fastlane/metadata/android/es-ES/full_description.txt rename to fastlane/metadata/android/es-ES/full_description.txt diff --git a/android/fastlane/metadata/android/es-ES/short_description.txt b/fastlane/metadata/android/es-ES/short_description.txt similarity index 100% rename from android/fastlane/metadata/android/es-ES/short_description.txt rename to fastlane/metadata/android/es-ES/short_description.txt diff --git a/android/fastlane/metadata/android/es-ES/title.txt b/fastlane/metadata/android/es-ES/title.txt similarity index 100% rename from android/fastlane/metadata/android/es-ES/title.txt rename to fastlane/metadata/android/es-ES/title.txt diff --git a/android/fastlane/metadata/android/fr-FR/full_description.txt b/fastlane/metadata/android/fr-FR/full_description.txt similarity index 100% rename from android/fastlane/metadata/android/fr-FR/full_description.txt rename to fastlane/metadata/android/fr-FR/full_description.txt diff --git a/android/fastlane/metadata/android/fr-FR/short_description.txt b/fastlane/metadata/android/fr-FR/short_description.txt similarity index 100% rename from android/fastlane/metadata/android/fr-FR/short_description.txt rename to fastlane/metadata/android/fr-FR/short_description.txt diff --git a/android/fastlane/metadata/android/fr-FR/title.txt b/fastlane/metadata/android/fr-FR/title.txt similarity index 100% rename from android/fastlane/metadata/android/fr-FR/title.txt rename to fastlane/metadata/android/fr-FR/title.txt diff --git a/android/fastlane/metadata/android/hr/full_description.txt b/fastlane/metadata/android/hr/full_description.txt similarity index 100% rename from android/fastlane/metadata/android/hr/full_description.txt rename to fastlane/metadata/android/hr/full_description.txt diff --git a/android/fastlane/metadata/android/hr/short_description.txt b/fastlane/metadata/android/hr/short_description.txt similarity index 100% rename from android/fastlane/metadata/android/hr/short_description.txt rename to fastlane/metadata/android/hr/short_description.txt diff --git a/android/fastlane/metadata/android/hr/title.txt b/fastlane/metadata/android/hr/title.txt similarity index 100% rename from android/fastlane/metadata/android/hr/title.txt rename to fastlane/metadata/android/hr/title.txt diff --git a/android/fastlane/metadata/android/it-IT/full_description.txt b/fastlane/metadata/android/it-IT/full_description.txt similarity index 100% rename from android/fastlane/metadata/android/it-IT/full_description.txt rename to fastlane/metadata/android/it-IT/full_description.txt diff --git a/android/fastlane/metadata/android/it-IT/short_description.txt b/fastlane/metadata/android/it-IT/short_description.txt similarity index 100% rename from android/fastlane/metadata/android/it-IT/short_description.txt rename to fastlane/metadata/android/it-IT/short_description.txt diff --git a/android/fastlane/metadata/android/it-IT/title.txt b/fastlane/metadata/android/it-IT/title.txt similarity index 100% rename from android/fastlane/metadata/android/it-IT/title.txt rename to fastlane/metadata/android/it-IT/title.txt diff --git a/android/fastlane/metadata/android/nb-NO/full_description.txt b/fastlane/metadata/android/nb-NO/full_description.txt similarity index 100% rename from android/fastlane/metadata/android/nb-NO/full_description.txt rename to fastlane/metadata/android/nb-NO/full_description.txt diff --git a/android/fastlane/metadata/android/nb-NO/short_description.txt b/fastlane/metadata/android/nb-NO/short_description.txt similarity index 100% rename from android/fastlane/metadata/android/nb-NO/short_description.txt rename to fastlane/metadata/android/nb-NO/short_description.txt diff --git a/android/fastlane/metadata/android/nb-NO/title.txt b/fastlane/metadata/android/nb-NO/title.txt similarity index 100% rename from android/fastlane/metadata/android/nb-NO/title.txt rename to fastlane/metadata/android/nb-NO/title.txt diff --git a/android/fastlane/metadata/android/tr/full_description.txt b/fastlane/metadata/android/tr/full_description.txt similarity index 100% rename from android/fastlane/metadata/android/tr/full_description.txt rename to fastlane/metadata/android/tr/full_description.txt diff --git a/android/fastlane/metadata/android/tr/short_description.txt b/fastlane/metadata/android/tr/short_description.txt similarity index 100% rename from android/fastlane/metadata/android/tr/short_description.txt rename to fastlane/metadata/android/tr/short_description.txt diff --git a/android/fastlane/metadata/android/uk/full_description.txt b/fastlane/metadata/android/uk/full_description.txt similarity index 100% rename from android/fastlane/metadata/android/uk/full_description.txt rename to fastlane/metadata/android/uk/full_description.txt diff --git a/android/fastlane/metadata/android/uk/short_description.txt b/fastlane/metadata/android/uk/short_description.txt similarity index 100% rename from android/fastlane/metadata/android/uk/short_description.txt rename to fastlane/metadata/android/uk/short_description.txt diff --git a/android/fastlane/metadata/android/uk/title.txt b/fastlane/metadata/android/uk/title.txt similarity index 100% rename from android/fastlane/metadata/android/uk/title.txt rename to fastlane/metadata/android/uk/title.txt diff --git a/android/fastlane/report.xml b/fastlane/report.xml similarity index 100% rename from android/fastlane/report.xml rename to fastlane/report.xml diff --git a/pubspec.lock b/pubspec.lock index 321b0a41..6fe7ae66 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -300,6 +300,13 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_barcode_scanner: + dependency: "direct main" + description: + name: flutter_barcode_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" flutter_calendar_carousel: dependency: "direct main" description: From 98651ad8fe86e61b08d772909a4e670ea0163c19 Mon Sep 17 00:00:00 2001 From: tony Date: Mon, 6 Dec 2021 16:46:53 +0000 Subject: [PATCH 49/49] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (4 of 4 strings) Translation: wger Workout Manager/Play Store Translate-URL: https://hosted.weblate.org/projects/wger/play-store/zh_Hans/ --- .../android/zh-CN/full_description.txt | 39 +++++++++++++++++++ .../android/zh-CN/short_description.txt | 1 + 2 files changed, 40 insertions(+) create mode 100644 fastlane/metadata/android/zh-CN/full_description.txt create mode 100644 fastlane/metadata/android/zh-CN/short_description.txt diff --git a/fastlane/metadata/android/zh-CN/full_description.txt b/fastlane/metadata/android/zh-CN/full_description.txt new file mode 100644 index 00000000..ba92c243 --- /dev/null +++ b/fastlane/metadata/android/zh-CN/full_description.txt @@ -0,0 +1,39 @@ +每一个健身爱好者 - 与您的健身教练 WGER 一起,让你更健康! + +你是否已经找到了排名第一的健身应用程序,并且喜欢创建自己的运动习惯? 无论你是哪种运动野兽——我们都有一个共同点:我们喜欢跟踪我们的健康数据 + +因此,我们不会因为你仍然使用小笔记本来管理你的健身旅程而评判你,但欢迎来到 2021 年! + +我们为你开发了 100% 免费的数字健康和健身追踪器应用程序,压缩到最相关的功能,让你的生活更轻松。开始吧,继续训练并庆祝你的进步! + +wger 是一个开源项目,关于: +* 你的身体 +* 你的锻炼 +* 你的进步 +* 你的数据 + +你的身体: +无需在谷歌上搜索你最喜欢的食物的成分——从 78000 多种产品中选择你的日常膳食并查看营养价值。将膳食添加到营养计划中,并在日历中概述你的饮食。 + +你的锻炼: +你知道什么对你的身体最好。从 200 种不同的练习中选择越来越多的练习来创建你自己的锻炼。然后,使用健身房模式指导你完成训练,同时一键记录你的体重。 + +你的进步: +永远不要忘记你的目标。跟踪你的体重并保留你的统计数据。 + +你的数据: +wger 是你的个性化健身日记——但你拥有自己的数据。使用 REST API 来访问它并用它做惊人的事情。 + +请注意:这个免费的应用程序不是基于额外的资金,我们不要求你捐款。不仅如此,它还是一个不断发展的社区项目。因此,请随时为新功能做好准备! + +#OpenSource – 这是什么意思? + +开源意味着这个应用程序的整个源代码和它与之通信的服务器都是免费的,任何人都可以使用: +* 你想在自己的服务器上为你还是为你当地的健身房运行 wger?都可以! +* 你是否错过了某个功能并想要实现它?现在开始! +* 你想检查任何地方都没有发送任何东西吗?你可以! + +加入我们的社区,成为来自世界各地的体育爱好者和 IT 极客的一份子。我们一直致力于调整和优化根据我们的需求定制的应用程序。我们喜欢你的意见,因此请随时加入并贡献你的愿望和想法! + +-> 在 https://github.com/wger-project 上找到源代码 +-> 在我们的 Discord 服务器上提问或打个招呼 https://discord.gg/rPWFv6W diff --git a/fastlane/metadata/android/zh-CN/short_description.txt b/fastlane/metadata/android/zh-CN/short_description.txt new file mode 100644 index 00000000..46c8b60f --- /dev/null +++ b/fastlane/metadata/android/zh-CN/short_description.txt @@ -0,0 +1 @@ +健身/锻炼、营养和体重追踪器