From caa40b18dbda7a92287028022790044567e68b95 Mon Sep 17 00:00:00 2001 From: Ketan Choyal Date: Fri, 15 Mar 2024 13:53:31 -0400 Subject: [PATCH] Added OpenAI service to fetch macros --- .gitignore | 2 + .vscode/settings.json | 2 +- ios/Flutter/AppFrameworkInfo.plist | 2 +- ios/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- lib/app/app.dart | 13 + lib/core/enums/serving_type.enum.dart | 29 + lib/core/models/food/food.freezed.dart | 72 ++- .../models/food_log/food_log.freezed.dart | 83 ++- lib/core/models/profile/profile.freezed.dart | 70 ++- .../services/open_ai/open_ai_serice.impl.dart | 111 ++++ .../services/open_ai/open_ai_service.dart | 9 + lib/gen/assets.gen.dart | 76 --- lib/ui/blocs/auth/auth_bloc.freezed.dart | 209 ++++--- lib/ui/blocs/goals/goals_bloc.freezed.dart | 75 +-- .../light_dark_color/theme+extension.dart | 2 +- .../theme+extension.freezed.dart | 55 +- .../bloc/add_colories_bloc.freezed.dart | 279 +++++---- .../add_calories/view/add_calories.form.dart | 16 + .../add_calories/view/add_calories.view.dart | 38 +- .../bloc/add_recipe_bloc.freezed.dart | 401 ++++++------ lib/ui/views/home/bloc/home_bloc.freezed.dart | 263 ++++---- .../bloc/search_food_macro.cubit.dart | 43 ++ .../bloc/search_macro_state.dart | 16 + .../bloc/search_macro_state.freezed.dart | 592 ++++++++++++++++++ .../view/search_food_macro.view.dart | 449 +++++++++++++ pubspec.lock | 398 ++++++------ pubspec.yaml | 23 +- .../flutter/generated_plugin_registrant.cc | 6 + windows/flutter/generated_plugins.cmake | 2 + 30 files changed, 2330 insertions(+), 1010 deletions(-) create mode 100644 lib/core/enums/serving_type.enum.dart create mode 100644 lib/core/services/open_ai/open_ai_serice.impl.dart create mode 100644 lib/core/services/open_ai/open_ai_service.dart create mode 100644 lib/ui/views/search_food_macro/bloc/search_food_macro.cubit.dart create mode 100644 lib/ui/views/search_food_macro/bloc/search_macro_state.dart create mode 100644 lib/ui/views/search_food_macro/bloc/search_macro_state.freezed.dart create mode 100644 lib/ui/views/search_food_macro/view/search_food_macro.view.dart diff --git a/.gitignore b/.gitignore index bdab1fd..4e06c72 100644 --- a/.gitignore +++ b/.gitignore @@ -132,3 +132,5 @@ firebase_app_id_file.json GoogleService-Info.plist .firebase/* *.cache + +keys.dart \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 8b8f30a..aa4a652 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "dart.flutterSdkPath": "/Users/ketanchoyal/fvm/versions/stable", + "dart.flutterSdkPath": "~/fvm/versions/3.13.0", } \ No newline at end of file diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 4f8d4d2..8c6e561 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 11d09f9..e3742bc 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -176,7 +176,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a..a6b826d 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ ( create: (context) => OpenFoodAPIServiceImpl(), ), + RepositoryProvider( + create: (context) => OpenAIServiceImpl()..init(), + ), RepositoryProvider( create: (context) => FirebaseAuthServiceImpl(), ), @@ -57,6 +63,13 @@ class App extends StatelessWidget { RepositoryProvider.of(context), )..getGoals(), ), + BlocProvider( + create: (context) => SearchMacroCubit( + openAIService: RepositoryProvider.of(context), + firebaseService: + RepositoryProvider.of(context), + ), + ) ], child: const AppView(), ), diff --git a/lib/core/enums/serving_type.enum.dart b/lib/core/enums/serving_type.enum.dart new file mode 100644 index 0000000..e02cd17 --- /dev/null +++ b/lib/core/enums/serving_type.enum.dart @@ -0,0 +1,29 @@ +enum ServingType { + hundreedGrams('100g'), + onePiece('1pc'), + oneCup('1cup'), + smallSized('small-sized'), + mediumSized('medium-sized'), + largeSized('large-sized'); + + final String value; + + String get displayValue { + switch (this) { + case ServingType.hundreedGrams: + return '100 grams'; + case ServingType.onePiece: + return '1 Piece'; + case ServingType.oneCup: + return '1 Cup'; + case ServingType.smallSized: + return 'Small Sized'; + case ServingType.mediumSized: + return 'Medium Sized'; + case ServingType.largeSized: + return 'Large Sized'; + } + } + + const ServingType(this.value); +} diff --git a/lib/core/models/food/food.freezed.dart b/lib/core/models/food/food.freezed.dart index 1a3380d..fed7e32 100644 --- a/lib/core/models/food/food.freezed.dart +++ b/lib/core/models/food/food.freezed.dart @@ -12,7 +12,7 @@ part of 'food.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$Food { @@ -136,9 +136,10 @@ class _$FoodCopyWithImpl<$Res, $Val extends Food> } /// @nodoc -abstract class _$$_FoodCopyWith<$Res> implements $FoodCopyWith<$Res> { - factory _$$_FoodCopyWith(_$_Food value, $Res Function(_$_Food) then) = - __$$_FoodCopyWithImpl<$Res>; +abstract class _$$FoodImplCopyWith<$Res> implements $FoodCopyWith<$Res> { + factory _$$FoodImplCopyWith( + _$FoodImpl value, $Res Function(_$FoodImpl) then) = + __$$FoodImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -159,9 +160,10 @@ abstract class _$$_FoodCopyWith<$Res> implements $FoodCopyWith<$Res> { } /// @nodoc -class __$$_FoodCopyWithImpl<$Res> extends _$FoodCopyWithImpl<$Res, _$_Food> - implements _$$_FoodCopyWith<$Res> { - __$$_FoodCopyWithImpl(_$_Food _value, $Res Function(_$_Food) _then) +class __$$FoodImplCopyWithImpl<$Res> + extends _$FoodCopyWithImpl<$Res, _$FoodImpl> + implements _$$FoodImplCopyWith<$Res> { + __$$FoodImplCopyWithImpl(_$FoodImpl _value, $Res Function(_$FoodImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -179,7 +181,7 @@ class __$$_FoodCopyWithImpl<$Res> extends _$FoodCopyWithImpl<$Res, _$_Food> Object? incredients = freezed, Object? isRecipe = freezed, }) { - return _then(_$_Food( + return _then(_$FoodImpl( id: freezed == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -230,8 +232,8 @@ class __$$_FoodCopyWithImpl<$Res> extends _$FoodCopyWithImpl<$Res, _$_Food> /// @nodoc -class _$_Food extends _Food { - _$_Food( +class _$FoodImpl extends _Food { + _$FoodImpl( {this.id, required this.name, this.description, @@ -284,10 +286,10 @@ class _$_Food extends _Food { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Food && + other is _$FoodImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.description, description) || @@ -326,8 +328,8 @@ class _$_Food extends _Food { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_FoodCopyWith<_$_Food> get copyWith => - __$$_FoodCopyWithImpl<_$_Food>(this, _$identity); + _$$FoodImplCopyWith<_$FoodImpl> get copyWith => + __$$FoodImplCopyWithImpl<_$FoodImpl>(this, _$identity); } abstract class _Food extends Food { @@ -342,7 +344,7 @@ abstract class _Food extends Food { final DateTime? dateTime, final double? quantity, final List? incredients, - final bool? isRecipe}) = _$_Food; + final bool? isRecipe}) = _$FoodImpl; _Food._() : super._(); @override @@ -369,7 +371,8 @@ abstract class _Food extends Food { bool? get isRecipe; @override @JsonKey(ignore: true) - _$$_FoodCopyWith<_$_Food> get copyWith => throw _privateConstructorUsedError; + _$$FoodImplCopyWith<_$FoodImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc @@ -432,21 +435,22 @@ class _$NutritionCopyWithImpl<$Res, $Val extends Nutrition> } /// @nodoc -abstract class _$$_NutritionCopyWith<$Res> implements $NutritionCopyWith<$Res> { - factory _$$_NutritionCopyWith( - _$_Nutrition value, $Res Function(_$_Nutrition) then) = - __$$_NutritionCopyWithImpl<$Res>; +abstract class _$$NutritionImplCopyWith<$Res> + implements $NutritionCopyWith<$Res> { + factory _$$NutritionImplCopyWith( + _$NutritionImpl value, $Res Function(_$NutritionImpl) then) = + __$$NutritionImplCopyWithImpl<$Res>; @override @useResult $Res call({double calories, double? fat, double? carbs, double? protein}); } /// @nodoc -class __$$_NutritionCopyWithImpl<$Res> - extends _$NutritionCopyWithImpl<$Res, _$_Nutrition> - implements _$$_NutritionCopyWith<$Res> { - __$$_NutritionCopyWithImpl( - _$_Nutrition _value, $Res Function(_$_Nutrition) _then) +class __$$NutritionImplCopyWithImpl<$Res> + extends _$NutritionCopyWithImpl<$Res, _$NutritionImpl> + implements _$$NutritionImplCopyWith<$Res> { + __$$NutritionImplCopyWithImpl( + _$NutritionImpl _value, $Res Function(_$NutritionImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -457,7 +461,7 @@ class __$$_NutritionCopyWithImpl<$Res> Object? carbs = freezed, Object? protein = freezed, }) { - return _then(_$_Nutrition( + return _then(_$NutritionImpl( calories: null == calories ? _value.calories : calories // ignore: cast_nullable_to_non_nullable @@ -480,8 +484,8 @@ class __$$_NutritionCopyWithImpl<$Res> /// @nodoc -class _$_Nutrition extends _Nutrition { - _$_Nutrition( +class _$NutritionImpl extends _Nutrition { + _$NutritionImpl( {required this.calories, required this.fat, required this.carbs, @@ -503,10 +507,10 @@ class _$_Nutrition extends _Nutrition { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Nutrition && + other is _$NutritionImpl && (identical(other.calories, calories) || other.calories == calories) && (identical(other.fat, fat) || other.fat == fat) && @@ -520,8 +524,8 @@ class _$_Nutrition extends _Nutrition { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_NutritionCopyWith<_$_Nutrition> get copyWith => - __$$_NutritionCopyWithImpl<_$_Nutrition>(this, _$identity); + _$$NutritionImplCopyWith<_$NutritionImpl> get copyWith => + __$$NutritionImplCopyWithImpl<_$NutritionImpl>(this, _$identity); } abstract class _Nutrition extends Nutrition { @@ -529,7 +533,7 @@ abstract class _Nutrition extends Nutrition { {required final double calories, required final double? fat, required final double? carbs, - required final double? protein}) = _$_Nutrition; + required final double? protein}) = _$NutritionImpl; _Nutrition._() : super._(); @override @@ -542,6 +546,6 @@ abstract class _Nutrition extends Nutrition { double? get protein; @override @JsonKey(ignore: true) - _$$_NutritionCopyWith<_$_Nutrition> get copyWith => + _$$NutritionImplCopyWith<_$NutritionImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/core/models/food_log/food_log.freezed.dart b/lib/core/models/food_log/food_log.freezed.dart index 30c711e..f5e152a 100644 --- a/lib/core/models/food_log/food_log.freezed.dart +++ b/lib/core/models/food_log/food_log.freezed.dart @@ -12,7 +12,7 @@ part of 'food_log.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$FoodLog { @@ -55,21 +55,19 @@ abstract class $FoodLogCopyWith<$Res> { {String? id, String name, double caloriesPerServing, - @JsonEnum() - FoodType foodType, + @JsonEnum() FoodType foodType, double? protein, double? carbs, double? fat, DateTime date, DateTime foodLogDate, @JsonKey(defaultValue: false, nullable: false) - bool isCarbsAddedToHealthKit, + bool isCarbsAddedToHealthKit, + @JsonKey(defaultValue: false, nullable: false) bool isFatAddedToHealthKit, @JsonKey(defaultValue: false, nullable: false) - bool isFatAddedToHealthKit, + bool isProteinAddedToHealthKit, @JsonKey(defaultValue: false, nullable: false) - bool isProteinAddedToHealthKit, - @JsonKey(defaultValue: false, nullable: false) - bool isCaloriesAddedToHealthKit, + bool isCaloriesAddedToHealthKit, String? foodReference, double servingEaten}); } @@ -169,40 +167,39 @@ class _$FoodLogCopyWithImpl<$Res, $Val extends FoodLog> } /// @nodoc -abstract class _$$_FoodLogCopyWith<$Res> implements $FoodLogCopyWith<$Res> { - factory _$$_FoodLogCopyWith( - _$_FoodLog value, $Res Function(_$_FoodLog) then) = - __$$_FoodLogCopyWithImpl<$Res>; +abstract class _$$FoodLogImplCopyWith<$Res> implements $FoodLogCopyWith<$Res> { + factory _$$FoodLogImplCopyWith( + _$FoodLogImpl value, $Res Function(_$FoodLogImpl) then) = + __$$FoodLogImplCopyWithImpl<$Res>; @override @useResult $Res call( {String? id, String name, double caloriesPerServing, - @JsonEnum() - FoodType foodType, + @JsonEnum() FoodType foodType, double? protein, double? carbs, double? fat, DateTime date, DateTime foodLogDate, @JsonKey(defaultValue: false, nullable: false) - bool isCarbsAddedToHealthKit, - @JsonKey(defaultValue: false, nullable: false) - bool isFatAddedToHealthKit, + bool isCarbsAddedToHealthKit, + @JsonKey(defaultValue: false, nullable: false) bool isFatAddedToHealthKit, @JsonKey(defaultValue: false, nullable: false) - bool isProteinAddedToHealthKit, + bool isProteinAddedToHealthKit, @JsonKey(defaultValue: false, nullable: false) - bool isCaloriesAddedToHealthKit, + bool isCaloriesAddedToHealthKit, String? foodReference, double servingEaten}); } /// @nodoc -class __$$_FoodLogCopyWithImpl<$Res> - extends _$FoodLogCopyWithImpl<$Res, _$_FoodLog> - implements _$$_FoodLogCopyWith<$Res> { - __$$_FoodLogCopyWithImpl(_$_FoodLog _value, $Res Function(_$_FoodLog) _then) +class __$$FoodLogImplCopyWithImpl<$Res> + extends _$FoodLogCopyWithImpl<$Res, _$FoodLogImpl> + implements _$$FoodLogImplCopyWith<$Res> { + __$$FoodLogImplCopyWithImpl( + _$FoodLogImpl _value, $Res Function(_$FoodLogImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -224,7 +221,7 @@ class __$$_FoodLogCopyWithImpl<$Res> Object? foodReference = freezed, Object? servingEaten = null, }) { - return _then(_$_FoodLog( + return _then(_$FoodLogImpl( id: freezed == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -291,26 +288,25 @@ class __$$_FoodLogCopyWithImpl<$Res> /// @nodoc -class _$_FoodLog extends _FoodLog { - _$_FoodLog( +class _$FoodLogImpl extends _FoodLog { + _$FoodLogImpl( {this.id, required this.name, required this.caloriesPerServing, - @JsonEnum() - this.foodType = FoodType.other, + @JsonEnum() this.foodType = FoodType.other, this.protein, this.carbs, this.fat, required this.date, required this.foodLogDate, @JsonKey(defaultValue: false, nullable: false) - this.isCarbsAddedToHealthKit = false, + this.isCarbsAddedToHealthKit = false, @JsonKey(defaultValue: false, nullable: false) - this.isFatAddedToHealthKit = false, + this.isFatAddedToHealthKit = false, @JsonKey(defaultValue: false, nullable: false) - this.isProteinAddedToHealthKit = false, + this.isProteinAddedToHealthKit = false, @JsonKey(defaultValue: false, nullable: false) - this.isCaloriesAddedToHealthKit = false, + this.isCaloriesAddedToHealthKit = false, this.foodReference, required this.servingEaten}) : super._(); @@ -363,10 +359,10 @@ class _$_FoodLog extends _FoodLog { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_FoodLog && + other is _$FoodLogImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.caloriesPerServing, caloriesPerServing) || @@ -419,8 +415,8 @@ class _$_FoodLog extends _FoodLog { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_FoodLogCopyWith<_$_FoodLog> get copyWith => - __$$_FoodLogCopyWithImpl<_$_FoodLog>(this, _$identity); + _$$FoodLogImplCopyWith<_$FoodLogImpl> get copyWith => + __$$FoodLogImplCopyWithImpl<_$FoodLogImpl>(this, _$identity); } abstract class _FoodLog extends FoodLog { @@ -428,23 +424,22 @@ abstract class _FoodLog extends FoodLog { {final String? id, required final String name, required final double caloriesPerServing, - @JsonEnum() - final FoodType foodType, + @JsonEnum() final FoodType foodType, final double? protein, final double? carbs, final double? fat, required final DateTime date, required final DateTime foodLogDate, @JsonKey(defaultValue: false, nullable: false) - final bool isCarbsAddedToHealthKit, + final bool isCarbsAddedToHealthKit, @JsonKey(defaultValue: false, nullable: false) - final bool isFatAddedToHealthKit, + final bool isFatAddedToHealthKit, @JsonKey(defaultValue: false, nullable: false) - final bool isProteinAddedToHealthKit, + final bool isProteinAddedToHealthKit, @JsonKey(defaultValue: false, nullable: false) - final bool isCaloriesAddedToHealthKit, + final bool isCaloriesAddedToHealthKit, final String? foodReference, - required final double servingEaten}) = _$_FoodLog; + required final double servingEaten}) = _$FoodLogImpl; _FoodLog._() : super._(); @override @@ -488,6 +483,6 @@ abstract class _FoodLog extends FoodLog { double get servingEaten; @override @JsonKey(ignore: true) - _$$_FoodLogCopyWith<_$_FoodLog> get copyWith => + _$$FoodLogImplCopyWith<_$FoodLogImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/core/models/profile/profile.freezed.dart b/lib/core/models/profile/profile.freezed.dart index 6fd3f00..dda1dae 100644 --- a/lib/core/models/profile/profile.freezed.dart +++ b/lib/core/models/profile/profile.freezed.dart @@ -12,7 +12,7 @@ part of 'profile.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$Profile { @@ -69,10 +69,10 @@ class _$ProfileCopyWithImpl<$Res, $Val extends Profile> } /// @nodoc -abstract class _$$_ProfileCopyWith<$Res> implements $ProfileCopyWith<$Res> { - factory _$$_ProfileCopyWith( - _$_Profile value, $Res Function(_$_Profile) then) = - __$$_ProfileCopyWithImpl<$Res>; +abstract class _$$ProfileImplCopyWith<$Res> implements $ProfileCopyWith<$Res> { + factory _$$ProfileImplCopyWith( + _$ProfileImpl value, $Res Function(_$ProfileImpl) then) = + __$$ProfileImplCopyWithImpl<$Res>; @override @useResult $Res call({Goals? goals}); @@ -82,10 +82,11 @@ abstract class _$$_ProfileCopyWith<$Res> implements $ProfileCopyWith<$Res> { } /// @nodoc -class __$$_ProfileCopyWithImpl<$Res> - extends _$ProfileCopyWithImpl<$Res, _$_Profile> - implements _$$_ProfileCopyWith<$Res> { - __$$_ProfileCopyWithImpl(_$_Profile _value, $Res Function(_$_Profile) _then) +class __$$ProfileImplCopyWithImpl<$Res> + extends _$ProfileCopyWithImpl<$Res, _$ProfileImpl> + implements _$$ProfileImplCopyWith<$Res> { + __$$ProfileImplCopyWithImpl( + _$ProfileImpl _value, $Res Function(_$ProfileImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -93,7 +94,7 @@ class __$$_ProfileCopyWithImpl<$Res> $Res call({ Object? goals = freezed, }) { - return _then(_$_Profile( + return _then(_$ProfileImpl( goals: freezed == goals ? _value.goals : goals // ignore: cast_nullable_to_non_nullable @@ -104,8 +105,8 @@ class __$$_ProfileCopyWithImpl<$Res> /// @nodoc -class _$_Profile extends _Profile { - _$_Profile({this.goals}) : super._(); +class _$ProfileImpl extends _Profile { + _$ProfileImpl({this.goals}) : super._(); @override final Goals? goals; @@ -116,10 +117,10 @@ class _$_Profile extends _Profile { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Profile && + other is _$ProfileImpl && (identical(other.goals, goals) || other.goals == goals)); } @@ -129,19 +130,19 @@ class _$_Profile extends _Profile { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ProfileCopyWith<_$_Profile> get copyWith => - __$$_ProfileCopyWithImpl<_$_Profile>(this, _$identity); + _$$ProfileImplCopyWith<_$ProfileImpl> get copyWith => + __$$ProfileImplCopyWithImpl<_$ProfileImpl>(this, _$identity); } abstract class _Profile extends Profile { - factory _Profile({final Goals? goals}) = _$_Profile; + factory _Profile({final Goals? goals}) = _$ProfileImpl; _Profile._() : super._(); @override Goals? get goals; @override @JsonKey(ignore: true) - _$$_ProfileCopyWith<_$_Profile> get copyWith => + _$$ProfileImplCopyWith<_$ProfileImpl> get copyWith => throw _privateConstructorUsedError; } @@ -204,18 +205,21 @@ class _$GoalsCopyWithImpl<$Res, $Val extends Goals> } /// @nodoc -abstract class _$$_GoalsCopyWith<$Res> implements $GoalsCopyWith<$Res> { - factory _$$_GoalsCopyWith(_$_Goals value, $Res Function(_$_Goals) then) = - __$$_GoalsCopyWithImpl<$Res>; +abstract class _$$GoalsImplCopyWith<$Res> implements $GoalsCopyWith<$Res> { + factory _$$GoalsImplCopyWith( + _$GoalsImpl value, $Res Function(_$GoalsImpl) then) = + __$$GoalsImplCopyWithImpl<$Res>; @override @useResult $Res call({double calories, double protein, double fat, double carbs}); } /// @nodoc -class __$$_GoalsCopyWithImpl<$Res> extends _$GoalsCopyWithImpl<$Res, _$_Goals> - implements _$$_GoalsCopyWith<$Res> { - __$$_GoalsCopyWithImpl(_$_Goals _value, $Res Function(_$_Goals) _then) +class __$$GoalsImplCopyWithImpl<$Res> + extends _$GoalsCopyWithImpl<$Res, _$GoalsImpl> + implements _$$GoalsImplCopyWith<$Res> { + __$$GoalsImplCopyWithImpl( + _$GoalsImpl _value, $Res Function(_$GoalsImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -226,7 +230,7 @@ class __$$_GoalsCopyWithImpl<$Res> extends _$GoalsCopyWithImpl<$Res, _$_Goals> Object? fat = null, Object? carbs = null, }) { - return _then(_$_Goals( + return _then(_$GoalsImpl( calories: null == calories ? _value.calories : calories // ignore: cast_nullable_to_non_nullable @@ -249,8 +253,8 @@ class __$$_GoalsCopyWithImpl<$Res> extends _$GoalsCopyWithImpl<$Res, _$_Goals> /// @nodoc -class _$_Goals extends _Goals { - _$_Goals( +class _$GoalsImpl extends _Goals { + _$GoalsImpl( {required this.calories, required this.protein, required this.fat, @@ -272,10 +276,10 @@ class _$_Goals extends _Goals { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Goals && + other is _$GoalsImpl && (identical(other.calories, calories) || other.calories == calories) && (identical(other.protein, protein) || other.protein == protein) && @@ -289,8 +293,8 @@ class _$_Goals extends _Goals { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_GoalsCopyWith<_$_Goals> get copyWith => - __$$_GoalsCopyWithImpl<_$_Goals>(this, _$identity); + _$$GoalsImplCopyWith<_$GoalsImpl> get copyWith => + __$$GoalsImplCopyWithImpl<_$GoalsImpl>(this, _$identity); } abstract class _Goals extends Goals { @@ -298,7 +302,7 @@ abstract class _Goals extends Goals { {required final double calories, required final double protein, required final double fat, - required final double carbs}) = _$_Goals; + required final double carbs}) = _$GoalsImpl; _Goals._() : super._(); @override @@ -311,6 +315,6 @@ abstract class _Goals extends Goals { double get carbs; @override @JsonKey(ignore: true) - _$$_GoalsCopyWith<_$_Goals> get copyWith => + _$$GoalsImplCopyWith<_$GoalsImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/core/services/open_ai/open_ai_serice.impl.dart b/lib/core/services/open_ai/open_ai_serice.impl.dart new file mode 100644 index 0000000..a7352b2 --- /dev/null +++ b/lib/core/services/open_ai/open_ai_serice.impl.dart @@ -0,0 +1,111 @@ +import 'dart:convert'; + +import 'package:calorie_tracker/core/enums/serving_type.enum.dart'; +import 'package:calorie_tracker/core/models/food/food.dart'; +import 'package:calorie_tracker/core/services/open_ai/open_ai_service.dart'; +import 'package:calorie_tracker/keys.dart'; +import 'package:dart_openai/dart_openai.dart'; + +class OpenAIServiceImpl extends OpenAIService { + OpenAIServiceImpl(); + + init() { + OpenAI.showLogs = true; + OpenAI.showResponsesLogs = true; + OpenAI.organization = orogId; + OpenAI.apiKey = openAiToken; + } + + // the system message that will be sent to the request. + OpenAIChatCompletionChoiceMessageModel get _systemMessage => + OpenAIChatCompletionChoiceMessageModel( + content: [ + OpenAIChatCompletionChoiceMessageContentItemModel.text( + "return any message you are given as JSON.", + ), + //context for the user message + OpenAIChatCompletionChoiceMessageContentItemModel.text( + "Related to protein and nutrition.", + ), + OpenAIChatCompletionChoiceMessageContentItemModel.text( + "return nutrition information in grams", + ), + OpenAIChatCompletionChoiceMessageContentItemModel.text( + "return using format: {protein: 20, fat: 10, carbs: 5, calories: 200}", + ), + ], + role: OpenAIChatMessageRole.assistant, + ); + + @override + Future> getMacros({ + required String food, + required ServingType servingType, + }) async { + // the user message that will be sent to the request. + OpenAIChatCompletionChoiceMessageModel userMessage = + OpenAIChatCompletionChoiceMessageModel( + content: [ + OpenAIChatCompletionChoiceMessageContentItemModel.text( + "Macros in a ${servingType.value} $food.", + ), + ], + role: OpenAIChatMessageRole.user, + ); + + // List models = await OpenAI.instance.model.list(); + + // print(models); + // all messages to be sent. + final requestMessages = [ + _systemMessage, + userMessage, + ]; + +// the actual request. + OpenAIChatCompletionModel chatCompletion = + await OpenAI.instance.chat.create( + model: "gpt-3.5-turbo-1106", + responseFormat: {"type": "json_object"}, + seed: 6, + messages: requestMessages, + temperature: 0.2, + maxTokens: 500, + ); + + final data = + jsonDecode(chatCompletion.choices.first.message.content!.first.text!) + as Map; + final rawNutritionData = data; + + final List foods = []; + + //check if rawNutritionData Map have another Map inside + for (final key in rawNutritionData.keys) { + if (rawNutritionData[key] is Map) { + try { + final foodName = key; + final Nutrition nutrition = + Nutrition.fromJson(rawNutritionData[foodName]); + foods.add(Food(name: foodName, nutrition: nutrition)); + } catch (e) { + print("From AI Service, Error parsing food: $e"); + } + } else { + final foodName = food; + final Nutrition nutrition = Nutrition.fromJson(rawNutritionData); + foods.add( + Food( + name: foodName, + nutrition: nutrition, + notes: "Serving type: ${servingType.displayValue}", + isRecipe: false, + ), + ); + break; + } + } + + return foods; + } +} diff --git a/lib/core/services/open_ai/open_ai_service.dart b/lib/core/services/open_ai/open_ai_service.dart new file mode 100644 index 0000000..7b2db13 --- /dev/null +++ b/lib/core/services/open_ai/open_ai_service.dart @@ -0,0 +1,9 @@ +import 'package:calorie_tracker/core/enums/serving_type.enum.dart'; +import 'package:calorie_tracker/core/models/food/food.dart'; + +abstract class OpenAIService { + Future> getMacros({ + required String food, + required ServingType servingType, + }); +} diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index b3a0cd3..bb3579b 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -7,8 +7,6 @@ // ignore_for_file: type=lint // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use -import 'package:flutter/widgets.dart'; - class $AssetsThemeGen { const $AssetsThemeGen(); @@ -27,77 +25,3 @@ class Assets { static const $AssetsThemeGen theme = $AssetsThemeGen(); } - -class AssetGenImage { - const AssetGenImage(this._assetName); - - final String _assetName; - - Image image({ - Key? key, - AssetBundle? bundle, - ImageFrameBuilder? frameBuilder, - ImageErrorWidgetBuilder? errorBuilder, - String? semanticLabel, - bool excludeFromSemantics = false, - double? scale, - double? width, - double? height, - Color? color, - Animation? opacity, - BlendMode? colorBlendMode, - BoxFit? fit, - AlignmentGeometry alignment = Alignment.center, - ImageRepeat repeat = ImageRepeat.noRepeat, - Rect? centerSlice, - bool matchTextDirection = false, - bool gaplessPlayback = false, - bool isAntiAlias = false, - String? package, - FilterQuality filterQuality = FilterQuality.low, - int? cacheWidth, - int? cacheHeight, - }) { - return Image.asset( - _assetName, - key: key, - bundle: bundle, - frameBuilder: frameBuilder, - errorBuilder: errorBuilder, - semanticLabel: semanticLabel, - excludeFromSemantics: excludeFromSemantics, - scale: scale, - width: width, - height: height, - color: color, - opacity: opacity, - colorBlendMode: colorBlendMode, - fit: fit, - alignment: alignment, - repeat: repeat, - centerSlice: centerSlice, - matchTextDirection: matchTextDirection, - gaplessPlayback: gaplessPlayback, - isAntiAlias: isAntiAlias, - package: package, - filterQuality: filterQuality, - cacheWidth: cacheWidth, - cacheHeight: cacheHeight, - ); - } - - ImageProvider provider({ - AssetBundle? bundle, - String? package, - }) { - return AssetImage( - _assetName, - bundle: bundle, - package: package, - ); - } - - String get path => _assetName; - - String get keyName => _assetName; -} diff --git a/lib/ui/blocs/auth/auth_bloc.freezed.dart b/lib/ui/blocs/auth/auth_bloc.freezed.dart index dd37a35..165ab87 100644 --- a/lib/ui/blocs/auth/auth_bloc.freezed.dart +++ b/lib/ui/blocs/auth/auth_bloc.freezed.dart @@ -12,7 +12,7 @@ part of 'auth_bloc.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$AuthState { @@ -80,25 +80,25 @@ class _$AuthStateCopyWithImpl<$Res, $Val extends AuthState> } /// @nodoc -abstract class _$$LogedOutAuthStateCopyWith<$Res> { - factory _$$LogedOutAuthStateCopyWith( - _$LogedOutAuthState value, $Res Function(_$LogedOutAuthState) then) = - __$$LogedOutAuthStateCopyWithImpl<$Res>; +abstract class _$$LogedOutAuthStateImplCopyWith<$Res> { + factory _$$LogedOutAuthStateImplCopyWith(_$LogedOutAuthStateImpl value, + $Res Function(_$LogedOutAuthStateImpl) then) = + __$$LogedOutAuthStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$LogedOutAuthStateCopyWithImpl<$Res> - extends _$AuthStateCopyWithImpl<$Res, _$LogedOutAuthState> - implements _$$LogedOutAuthStateCopyWith<$Res> { - __$$LogedOutAuthStateCopyWithImpl( - _$LogedOutAuthState _value, $Res Function(_$LogedOutAuthState) _then) +class __$$LogedOutAuthStateImplCopyWithImpl<$Res> + extends _$AuthStateCopyWithImpl<$Res, _$LogedOutAuthStateImpl> + implements _$$LogedOutAuthStateImplCopyWith<$Res> { + __$$LogedOutAuthStateImplCopyWithImpl(_$LogedOutAuthStateImpl _value, + $Res Function(_$LogedOutAuthStateImpl) _then) : super(_value, _then); } /// @nodoc -class _$LogedOutAuthState implements LogedOutAuthState { - const _$LogedOutAuthState(); +class _$LogedOutAuthStateImpl implements LogedOutAuthState { + const _$LogedOutAuthStateImpl(); @override String toString() { @@ -106,9 +106,9 @@ class _$LogedOutAuthState implements LogedOutAuthState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$LogedOutAuthState); + (other.runtimeType == runtimeType && other is _$LogedOutAuthStateImpl); } @override @@ -184,29 +184,29 @@ class _$LogedOutAuthState implements LogedOutAuthState { } abstract class LogedOutAuthState implements AuthState { - const factory LogedOutAuthState() = _$LogedOutAuthState; + const factory LogedOutAuthState() = _$LogedOutAuthStateImpl; } /// @nodoc -abstract class _$$LogedInAuthStateCopyWith<$Res> { - factory _$$LogedInAuthStateCopyWith( - _$LogedInAuthState value, $Res Function(_$LogedInAuthState) then) = - __$$LogedInAuthStateCopyWithImpl<$Res>; +abstract class _$$LogedInAuthStateImplCopyWith<$Res> { + factory _$$LogedInAuthStateImplCopyWith(_$LogedInAuthStateImpl value, + $Res Function(_$LogedInAuthStateImpl) then) = + __$$LogedInAuthStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$LogedInAuthStateCopyWithImpl<$Res> - extends _$AuthStateCopyWithImpl<$Res, _$LogedInAuthState> - implements _$$LogedInAuthStateCopyWith<$Res> { - __$$LogedInAuthStateCopyWithImpl( - _$LogedInAuthState _value, $Res Function(_$LogedInAuthState) _then) +class __$$LogedInAuthStateImplCopyWithImpl<$Res> + extends _$AuthStateCopyWithImpl<$Res, _$LogedInAuthStateImpl> + implements _$$LogedInAuthStateImplCopyWith<$Res> { + __$$LogedInAuthStateImplCopyWithImpl(_$LogedInAuthStateImpl _value, + $Res Function(_$LogedInAuthStateImpl) _then) : super(_value, _then); } /// @nodoc -class _$LogedInAuthState implements LogedInAuthState { - const _$LogedInAuthState(); +class _$LogedInAuthStateImpl implements LogedInAuthState { + const _$LogedInAuthStateImpl(); @override String toString() { @@ -214,9 +214,9 @@ class _$LogedInAuthState implements LogedInAuthState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$LogedInAuthState); + (other.runtimeType == runtimeType && other is _$LogedInAuthStateImpl); } @override @@ -292,29 +292,29 @@ class _$LogedInAuthState implements LogedInAuthState { } abstract class LogedInAuthState implements AuthState { - const factory LogedInAuthState() = _$LogedInAuthState; + const factory LogedInAuthState() = _$LogedInAuthStateImpl; } /// @nodoc -abstract class _$$LoadingAuthStateCopyWith<$Res> { - factory _$$LoadingAuthStateCopyWith( - _$LoadingAuthState value, $Res Function(_$LoadingAuthState) then) = - __$$LoadingAuthStateCopyWithImpl<$Res>; +abstract class _$$LoadingAuthStateImplCopyWith<$Res> { + factory _$$LoadingAuthStateImplCopyWith(_$LoadingAuthStateImpl value, + $Res Function(_$LoadingAuthStateImpl) then) = + __$$LoadingAuthStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$LoadingAuthStateCopyWithImpl<$Res> - extends _$AuthStateCopyWithImpl<$Res, _$LoadingAuthState> - implements _$$LoadingAuthStateCopyWith<$Res> { - __$$LoadingAuthStateCopyWithImpl( - _$LoadingAuthState _value, $Res Function(_$LoadingAuthState) _then) +class __$$LoadingAuthStateImplCopyWithImpl<$Res> + extends _$AuthStateCopyWithImpl<$Res, _$LoadingAuthStateImpl> + implements _$$LoadingAuthStateImplCopyWith<$Res> { + __$$LoadingAuthStateImplCopyWithImpl(_$LoadingAuthStateImpl _value, + $Res Function(_$LoadingAuthStateImpl) _then) : super(_value, _then); } /// @nodoc -class _$LoadingAuthState implements LoadingAuthState { - const _$LoadingAuthState(); +class _$LoadingAuthStateImpl implements LoadingAuthState { + const _$LoadingAuthStateImpl(); @override String toString() { @@ -322,9 +322,9 @@ class _$LoadingAuthState implements LoadingAuthState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$LoadingAuthState); + (other.runtimeType == runtimeType && other is _$LoadingAuthStateImpl); } @override @@ -400,7 +400,7 @@ class _$LoadingAuthState implements LoadingAuthState { } abstract class LoadingAuthState implements AuthState { - const factory LoadingAuthState() = _$LoadingAuthState; + const factory LoadingAuthState() = _$LoadingAuthStateImpl; } /// @nodoc @@ -475,25 +475,25 @@ class _$AuthEventCopyWithImpl<$Res, $Val extends AuthEvent> } /// @nodoc -abstract class _$$LogInAnonymouslyEvenCopyWith<$Res> { - factory _$$LogInAnonymouslyEvenCopyWith(_$LogInAnonymouslyEven value, - $Res Function(_$LogInAnonymouslyEven) then) = - __$$LogInAnonymouslyEvenCopyWithImpl<$Res>; +abstract class _$$LogInAnonymouslyEvenImplCopyWith<$Res> { + factory _$$LogInAnonymouslyEvenImplCopyWith(_$LogInAnonymouslyEvenImpl value, + $Res Function(_$LogInAnonymouslyEvenImpl) then) = + __$$LogInAnonymouslyEvenImplCopyWithImpl<$Res>; } /// @nodoc -class __$$LogInAnonymouslyEvenCopyWithImpl<$Res> - extends _$AuthEventCopyWithImpl<$Res, _$LogInAnonymouslyEven> - implements _$$LogInAnonymouslyEvenCopyWith<$Res> { - __$$LogInAnonymouslyEvenCopyWithImpl(_$LogInAnonymouslyEven _value, - $Res Function(_$LogInAnonymouslyEven) _then) +class __$$LogInAnonymouslyEvenImplCopyWithImpl<$Res> + extends _$AuthEventCopyWithImpl<$Res, _$LogInAnonymouslyEvenImpl> + implements _$$LogInAnonymouslyEvenImplCopyWith<$Res> { + __$$LogInAnonymouslyEvenImplCopyWithImpl(_$LogInAnonymouslyEvenImpl _value, + $Res Function(_$LogInAnonymouslyEvenImpl) _then) : super(_value, _then); } /// @nodoc -class _$LogInAnonymouslyEven implements LogInAnonymouslyEven { - const _$LogInAnonymouslyEven(); +class _$LogInAnonymouslyEvenImpl implements LogInAnonymouslyEven { + const _$LogInAnonymouslyEvenImpl(); @override String toString() { @@ -501,9 +501,10 @@ class _$LogInAnonymouslyEven implements LogInAnonymouslyEven { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$LogInAnonymouslyEven); + (other.runtimeType == runtimeType && + other is _$LogInAnonymouslyEvenImpl); } @override @@ -585,29 +586,29 @@ class _$LogInAnonymouslyEven implements LogInAnonymouslyEven { } abstract class LogInAnonymouslyEven implements AuthEvent { - const factory LogInAnonymouslyEven() = _$LogInAnonymouslyEven; + const factory LogInAnonymouslyEven() = _$LogInAnonymouslyEvenImpl; } /// @nodoc -abstract class _$$LogInWithGoogleEventCopyWith<$Res> { - factory _$$LogInWithGoogleEventCopyWith(_$LogInWithGoogleEvent value, - $Res Function(_$LogInWithGoogleEvent) then) = - __$$LogInWithGoogleEventCopyWithImpl<$Res>; +abstract class _$$LogInWithGoogleEventImplCopyWith<$Res> { + factory _$$LogInWithGoogleEventImplCopyWith(_$LogInWithGoogleEventImpl value, + $Res Function(_$LogInWithGoogleEventImpl) then) = + __$$LogInWithGoogleEventImplCopyWithImpl<$Res>; } /// @nodoc -class __$$LogInWithGoogleEventCopyWithImpl<$Res> - extends _$AuthEventCopyWithImpl<$Res, _$LogInWithGoogleEvent> - implements _$$LogInWithGoogleEventCopyWith<$Res> { - __$$LogInWithGoogleEventCopyWithImpl(_$LogInWithGoogleEvent _value, - $Res Function(_$LogInWithGoogleEvent) _then) +class __$$LogInWithGoogleEventImplCopyWithImpl<$Res> + extends _$AuthEventCopyWithImpl<$Res, _$LogInWithGoogleEventImpl> + implements _$$LogInWithGoogleEventImplCopyWith<$Res> { + __$$LogInWithGoogleEventImplCopyWithImpl(_$LogInWithGoogleEventImpl _value, + $Res Function(_$LogInWithGoogleEventImpl) _then) : super(_value, _then); } /// @nodoc -class _$LogInWithGoogleEvent implements LogInWithGoogleEvent { - const _$LogInWithGoogleEvent(); +class _$LogInWithGoogleEventImpl implements LogInWithGoogleEvent { + const _$LogInWithGoogleEventImpl(); @override String toString() { @@ -615,9 +616,10 @@ class _$LogInWithGoogleEvent implements LogInWithGoogleEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$LogInWithGoogleEvent); + (other.runtimeType == runtimeType && + other is _$LogInWithGoogleEventImpl); } @override @@ -699,24 +701,24 @@ class _$LogInWithGoogleEvent implements LogInWithGoogleEvent { } abstract class LogInWithGoogleEvent implements AuthEvent { - const factory LogInWithGoogleEvent() = _$LogInWithGoogleEvent; + const factory LogInWithGoogleEvent() = _$LogInWithGoogleEventImpl; } /// @nodoc -abstract class _$$UpdateUserEventCopyWith<$Res> { - factory _$$UpdateUserEventCopyWith( - _$UpdateUserEvent value, $Res Function(_$UpdateUserEvent) then) = - __$$UpdateUserEventCopyWithImpl<$Res>; +abstract class _$$UpdateUserEventImplCopyWith<$Res> { + factory _$$UpdateUserEventImplCopyWith(_$UpdateUserEventImpl value, + $Res Function(_$UpdateUserEventImpl) then) = + __$$UpdateUserEventImplCopyWithImpl<$Res>; @useResult $Res call({User? user}); } /// @nodoc -class __$$UpdateUserEventCopyWithImpl<$Res> - extends _$AuthEventCopyWithImpl<$Res, _$UpdateUserEvent> - implements _$$UpdateUserEventCopyWith<$Res> { - __$$UpdateUserEventCopyWithImpl( - _$UpdateUserEvent _value, $Res Function(_$UpdateUserEvent) _then) +class __$$UpdateUserEventImplCopyWithImpl<$Res> + extends _$AuthEventCopyWithImpl<$Res, _$UpdateUserEventImpl> + implements _$$UpdateUserEventImplCopyWith<$Res> { + __$$UpdateUserEventImplCopyWithImpl( + _$UpdateUserEventImpl _value, $Res Function(_$UpdateUserEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -724,7 +726,7 @@ class __$$UpdateUserEventCopyWithImpl<$Res> $Res call({ Object? user = freezed, }) { - return _then(_$UpdateUserEvent( + return _then(_$UpdateUserEventImpl( freezed == user ? _value.user : user // ignore: cast_nullable_to_non_nullable @@ -735,8 +737,8 @@ class __$$UpdateUserEventCopyWithImpl<$Res> /// @nodoc -class _$UpdateUserEvent implements UpdateUserEvent { - const _$UpdateUserEvent(this.user); +class _$UpdateUserEventImpl implements UpdateUserEvent { + const _$UpdateUserEventImpl(this.user); @override final User? user; @@ -747,10 +749,10 @@ class _$UpdateUserEvent implements UpdateUserEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$UpdateUserEvent && + other is _$UpdateUserEventImpl && (identical(other.user, user) || other.user == user)); } @@ -760,8 +762,9 @@ class _$UpdateUserEvent implements UpdateUserEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$UpdateUserEventCopyWith<_$UpdateUserEvent> get copyWith => - __$$UpdateUserEventCopyWithImpl<_$UpdateUserEvent>(this, _$identity); + _$$UpdateUserEventImplCopyWith<_$UpdateUserEventImpl> get copyWith => + __$$UpdateUserEventImplCopyWithImpl<_$UpdateUserEventImpl>( + this, _$identity); @override @optionalTypeArgs @@ -839,34 +842,34 @@ class _$UpdateUserEvent implements UpdateUserEvent { } abstract class UpdateUserEvent implements AuthEvent { - const factory UpdateUserEvent(final User? user) = _$UpdateUserEvent; + const factory UpdateUserEvent(final User? user) = _$UpdateUserEventImpl; User? get user; @JsonKey(ignore: true) - _$$UpdateUserEventCopyWith<_$UpdateUserEvent> get copyWith => + _$$UpdateUserEventImplCopyWith<_$UpdateUserEventImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$LogOutEventCopyWith<$Res> { - factory _$$LogOutEventCopyWith( - _$LogOutEvent value, $Res Function(_$LogOutEvent) then) = - __$$LogOutEventCopyWithImpl<$Res>; +abstract class _$$LogOutEventImplCopyWith<$Res> { + factory _$$LogOutEventImplCopyWith( + _$LogOutEventImpl value, $Res Function(_$LogOutEventImpl) then) = + __$$LogOutEventImplCopyWithImpl<$Res>; } /// @nodoc -class __$$LogOutEventCopyWithImpl<$Res> - extends _$AuthEventCopyWithImpl<$Res, _$LogOutEvent> - implements _$$LogOutEventCopyWith<$Res> { - __$$LogOutEventCopyWithImpl( - _$LogOutEvent _value, $Res Function(_$LogOutEvent) _then) +class __$$LogOutEventImplCopyWithImpl<$Res> + extends _$AuthEventCopyWithImpl<$Res, _$LogOutEventImpl> + implements _$$LogOutEventImplCopyWith<$Res> { + __$$LogOutEventImplCopyWithImpl( + _$LogOutEventImpl _value, $Res Function(_$LogOutEventImpl) _then) : super(_value, _then); } /// @nodoc -class _$LogOutEvent implements LogOutEvent { - const _$LogOutEvent(); +class _$LogOutEventImpl implements LogOutEvent { + const _$LogOutEventImpl(); @override String toString() { @@ -874,9 +877,9 @@ class _$LogOutEvent implements LogOutEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$LogOutEvent); + (other.runtimeType == runtimeType && other is _$LogOutEventImpl); } @override @@ -958,5 +961,5 @@ class _$LogOutEvent implements LogOutEvent { } abstract class LogOutEvent implements AuthEvent { - const factory LogOutEvent() = _$LogOutEvent; + const factory LogOutEvent() = _$LogOutEventImpl; } diff --git a/lib/ui/blocs/goals/goals_bloc.freezed.dart b/lib/ui/blocs/goals/goals_bloc.freezed.dart index a6d9c24..625841d 100644 --- a/lib/ui/blocs/goals/goals_bloc.freezed.dart +++ b/lib/ui/blocs/goals/goals_bloc.freezed.dart @@ -12,7 +12,7 @@ part of 'goals_bloc.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$GoalsState { @@ -117,10 +117,11 @@ class _$GoalsStateCopyWithImpl<$Res, $Val extends GoalsState> } /// @nodoc -abstract class _$$_InitialCopyWith<$Res> implements $GoalsStateCopyWith<$Res> { - factory _$$_InitialCopyWith( - _$_Initial value, $Res Function(_$_Initial) then) = - __$$_InitialCopyWithImpl<$Res>; +abstract class _$$InitialImplCopyWith<$Res> + implements $GoalsStateCopyWith<$Res> { + factory _$$InitialImplCopyWith( + _$InitialImpl value, $Res Function(_$InitialImpl) then) = + __$$InitialImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -131,10 +132,11 @@ abstract class _$$_InitialCopyWith<$Res> implements $GoalsStateCopyWith<$Res> { } /// @nodoc -class __$$_InitialCopyWithImpl<$Res> - extends _$GoalsStateCopyWithImpl<$Res, _$_Initial> - implements _$$_InitialCopyWith<$Res> { - __$$_InitialCopyWithImpl(_$_Initial _value, $Res Function(_$_Initial) _then) +class __$$InitialImplCopyWithImpl<$Res> + extends _$GoalsStateCopyWithImpl<$Res, _$InitialImpl> + implements _$$InitialImplCopyWith<$Res> { + __$$InitialImplCopyWithImpl( + _$InitialImpl _value, $Res Function(_$InitialImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -145,7 +147,7 @@ class __$$_InitialCopyWithImpl<$Res> Object? carbsGoal = null, Object? fatGoal = null, }) { - return _then(_$_Initial( + return _then(_$InitialImpl( caloriesGoal: null == caloriesGoal ? _value.caloriesGoal : caloriesGoal // ignore: cast_nullable_to_non_nullable @@ -168,8 +170,8 @@ class __$$_InitialCopyWithImpl<$Res> /// @nodoc -class _$_Initial implements _Initial { - const _$_Initial( +class _$InitialImpl implements _Initial { + const _$InitialImpl( {this.caloriesGoal = 0, this.proteinGoal = 0, this.carbsGoal = 0, @@ -194,10 +196,10 @@ class _$_Initial implements _Initial { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Initial && + other is _$InitialImpl && (identical(other.caloriesGoal, caloriesGoal) || other.caloriesGoal == caloriesGoal) && (identical(other.proteinGoal, proteinGoal) || @@ -214,8 +216,8 @@ class _$_Initial implements _Initial { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_InitialCopyWith<_$_Initial> get copyWith => - __$$_InitialCopyWithImpl<_$_Initial>(this, _$identity); + _$$InitialImplCopyWith<_$InitialImpl> get copyWith => + __$$InitialImplCopyWithImpl<_$InitialImpl>(this, _$identity); @override @optionalTypeArgs @@ -285,7 +287,7 @@ abstract class _Initial implements GoalsState { {final double caloriesGoal, final double proteinGoal, final double carbsGoal, - final double fatGoal}) = _$_Initial; + final double fatGoal}) = _$InitialImpl; @override double get caloriesGoal; @@ -297,7 +299,7 @@ abstract class _Initial implements GoalsState { double get fatGoal; @override @JsonKey(ignore: true) - _$$_InitialCopyWith<_$_Initial> get copyWith => + _$$InitialImplCopyWith<_$InitialImpl> get copyWith => throw _privateConstructorUsedError; } @@ -386,11 +388,11 @@ class _$GoalsEventCopyWithImpl<$Res, $Val extends GoalsEvent> } /// @nodoc -abstract class _$$UpdateGoalsEventCopyWith<$Res> +abstract class _$$UpdateGoalsEventImplCopyWith<$Res> implements $GoalsEventCopyWith<$Res> { - factory _$$UpdateGoalsEventCopyWith( - _$UpdateGoalsEvent value, $Res Function(_$UpdateGoalsEvent) then) = - __$$UpdateGoalsEventCopyWithImpl<$Res>; + factory _$$UpdateGoalsEventImplCopyWith(_$UpdateGoalsEventImpl value, + $Res Function(_$UpdateGoalsEventImpl) then) = + __$$UpdateGoalsEventImplCopyWithImpl<$Res>; @override @useResult $Res call({Goals goals}); @@ -400,11 +402,11 @@ abstract class _$$UpdateGoalsEventCopyWith<$Res> } /// @nodoc -class __$$UpdateGoalsEventCopyWithImpl<$Res> - extends _$GoalsEventCopyWithImpl<$Res, _$UpdateGoalsEvent> - implements _$$UpdateGoalsEventCopyWith<$Res> { - __$$UpdateGoalsEventCopyWithImpl( - _$UpdateGoalsEvent _value, $Res Function(_$UpdateGoalsEvent) _then) +class __$$UpdateGoalsEventImplCopyWithImpl<$Res> + extends _$GoalsEventCopyWithImpl<$Res, _$UpdateGoalsEventImpl> + implements _$$UpdateGoalsEventImplCopyWith<$Res> { + __$$UpdateGoalsEventImplCopyWithImpl(_$UpdateGoalsEventImpl _value, + $Res Function(_$UpdateGoalsEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -412,7 +414,7 @@ class __$$UpdateGoalsEventCopyWithImpl<$Res> $Res call({ Object? goals = null, }) { - return _then(_$UpdateGoalsEvent( + return _then(_$UpdateGoalsEventImpl( goals: null == goals ? _value.goals : goals // ignore: cast_nullable_to_non_nullable @@ -423,8 +425,8 @@ class __$$UpdateGoalsEventCopyWithImpl<$Res> /// @nodoc -class _$UpdateGoalsEvent extends UpdateGoalsEvent { - const _$UpdateGoalsEvent({required this.goals}) : super._(); +class _$UpdateGoalsEventImpl extends UpdateGoalsEvent { + const _$UpdateGoalsEventImpl({required this.goals}) : super._(); @override final Goals goals; @@ -435,10 +437,10 @@ class _$UpdateGoalsEvent extends UpdateGoalsEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$UpdateGoalsEvent && + other is _$UpdateGoalsEventImpl && (identical(other.goals, goals) || other.goals == goals)); } @@ -448,8 +450,9 @@ class _$UpdateGoalsEvent extends UpdateGoalsEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$UpdateGoalsEventCopyWith<_$UpdateGoalsEvent> get copyWith => - __$$UpdateGoalsEventCopyWithImpl<_$UpdateGoalsEvent>(this, _$identity); + _$$UpdateGoalsEventImplCopyWith<_$UpdateGoalsEventImpl> get copyWith => + __$$UpdateGoalsEventImplCopyWithImpl<_$UpdateGoalsEventImpl>( + this, _$identity); @override @optionalTypeArgs @@ -510,13 +513,13 @@ class _$UpdateGoalsEvent extends UpdateGoalsEvent { abstract class UpdateGoalsEvent extends GoalsEvent { const factory UpdateGoalsEvent({required final Goals goals}) = - _$UpdateGoalsEvent; + _$UpdateGoalsEventImpl; const UpdateGoalsEvent._() : super._(); @override Goals get goals; @override @JsonKey(ignore: true) - _$$UpdateGoalsEventCopyWith<_$UpdateGoalsEvent> get copyWith => + _$$UpdateGoalsEventImplCopyWith<_$UpdateGoalsEventImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/ui/extensions/light_dark_color/theme+extension.dart b/lib/ui/extensions/light_dark_color/theme+extension.dart index 2ff507b..7c94a8b 100644 --- a/lib/ui/extensions/light_dark_color/theme+extension.dart +++ b/lib/ui/extensions/light_dark_color/theme+extension.dart @@ -4,7 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'theme+extension.freezed.dart'; @freezed -class _ThemeColor with _$_ThemeColor { +class _ThemeColor with _$ThemeColor { const factory _ThemeColor.light() = _Light; const factory _ThemeColor.dark() = _Dark; } diff --git a/lib/ui/extensions/light_dark_color/theme+extension.freezed.dart b/lib/ui/extensions/light_dark_color/theme+extension.freezed.dart index a4045ae..263f8f5 100644 --- a/lib/ui/extensions/light_dark_color/theme+extension.freezed.dart +++ b/lib/ui/extensions/light_dark_color/theme+extension.freezed.dart @@ -12,10 +12,10 @@ part of 'theme+extension.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc -mixin _$_ThemeColor { +mixin _$ThemeColor { @optionalTypeArgs TResult when({ required TResult Function() light, @@ -75,23 +75,25 @@ class __$ThemeColorCopyWithImpl<$Res, $Val extends _ThemeColor> } /// @nodoc -abstract class _$$_LightCopyWith<$Res> { - factory _$$_LightCopyWith(_$_Light value, $Res Function(_$_Light) then) = - __$$_LightCopyWithImpl<$Res>; +abstract class _$$LightImplCopyWith<$Res> { + factory _$$LightImplCopyWith( + _$LightImpl value, $Res Function(_$LightImpl) then) = + __$$LightImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_LightCopyWithImpl<$Res> - extends __$ThemeColorCopyWithImpl<$Res, _$_Light> - implements _$$_LightCopyWith<$Res> { - __$$_LightCopyWithImpl(_$_Light _value, $Res Function(_$_Light) _then) +class __$$LightImplCopyWithImpl<$Res> + extends __$ThemeColorCopyWithImpl<$Res, _$LightImpl> + implements _$$LightImplCopyWith<$Res> { + __$$LightImplCopyWithImpl( + _$LightImpl _value, $Res Function(_$LightImpl) _then) : super(_value, _then); } /// @nodoc -class _$_Light implements _Light { - const _$_Light(); +class _$LightImpl implements _Light { + const _$LightImpl(); @override String toString() { @@ -99,9 +101,9 @@ class _$_Light implements _Light { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_Light); + (other.runtimeType == runtimeType && other is _$LightImpl); } @override @@ -171,27 +173,28 @@ class _$_Light implements _Light { } abstract class _Light implements _ThemeColor { - const factory _Light() = _$_Light; + const factory _Light() = _$LightImpl; } /// @nodoc -abstract class _$$_DarkCopyWith<$Res> { - factory _$$_DarkCopyWith(_$_Dark value, $Res Function(_$_Dark) then) = - __$$_DarkCopyWithImpl<$Res>; +abstract class _$$DarkImplCopyWith<$Res> { + factory _$$DarkImplCopyWith( + _$DarkImpl value, $Res Function(_$DarkImpl) then) = + __$$DarkImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_DarkCopyWithImpl<$Res> - extends __$ThemeColorCopyWithImpl<$Res, _$_Dark> - implements _$$_DarkCopyWith<$Res> { - __$$_DarkCopyWithImpl(_$_Dark _value, $Res Function(_$_Dark) _then) +class __$$DarkImplCopyWithImpl<$Res> + extends __$ThemeColorCopyWithImpl<$Res, _$DarkImpl> + implements _$$DarkImplCopyWith<$Res> { + __$$DarkImplCopyWithImpl(_$DarkImpl _value, $Res Function(_$DarkImpl) _then) : super(_value, _then); } /// @nodoc -class _$_Dark implements _Dark { - const _$_Dark(); +class _$DarkImpl implements _Dark { + const _$DarkImpl(); @override String toString() { @@ -199,9 +202,9 @@ class _$_Dark implements _Dark { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_Dark); + (other.runtimeType == runtimeType && other is _$DarkImpl); } @override @@ -271,5 +274,5 @@ class _$_Dark implements _Dark { } abstract class _Dark implements _ThemeColor { - const factory _Dark() = _$_Dark; + const factory _Dark() = _$DarkImpl; } diff --git a/lib/ui/views/add_calories/bloc/add_colories_bloc.freezed.dart b/lib/ui/views/add_calories/bloc/add_colories_bloc.freezed.dart index 633bfbe..0e1053f 100644 --- a/lib/ui/views/add_calories/bloc/add_colories_bloc.freezed.dart +++ b/lib/ui/views/add_calories/bloc/add_colories_bloc.freezed.dart @@ -12,7 +12,7 @@ part of 'add_colories_bloc.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$AddColoriesEvent { @@ -117,23 +117,25 @@ class _$AddColoriesEventCopyWithImpl<$Res, $Val extends AddColoriesEvent> } /// @nodoc -abstract class _$$_ResetCopyWith<$Res> { - factory _$$_ResetCopyWith(_$_Reset value, $Res Function(_$_Reset) then) = - __$$_ResetCopyWithImpl<$Res>; +abstract class _$$ResetImplCopyWith<$Res> { + factory _$$ResetImplCopyWith( + _$ResetImpl value, $Res Function(_$ResetImpl) then) = + __$$ResetImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_ResetCopyWithImpl<$Res> - extends _$AddColoriesEventCopyWithImpl<$Res, _$_Reset> - implements _$$_ResetCopyWith<$Res> { - __$$_ResetCopyWithImpl(_$_Reset _value, $Res Function(_$_Reset) _then) +class __$$ResetImplCopyWithImpl<$Res> + extends _$AddColoriesEventCopyWithImpl<$Res, _$ResetImpl> + implements _$$ResetImplCopyWith<$Res> { + __$$ResetImplCopyWithImpl( + _$ResetImpl _value, $Res Function(_$ResetImpl) _then) : super(_value, _then); } /// @nodoc -class _$_Reset implements _Reset { - _$_Reset(); +class _$ResetImpl implements _Reset { + _$ResetImpl(); @override String toString() { @@ -141,9 +143,9 @@ class _$_Reset implements _Reset { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_Reset); + (other.runtimeType == runtimeType && other is _$ResetImpl); } @override @@ -255,14 +257,14 @@ class _$_Reset implements _Reset { } abstract class _Reset implements AddColoriesEvent { - factory _Reset() = _$_Reset; + factory _Reset() = _$ResetImpl; } /// @nodoc -abstract class _$$_SelectFoodEventCopyWith<$Res> { - factory _$$_SelectFoodEventCopyWith( - _$_SelectFoodEvent value, $Res Function(_$_SelectFoodEvent) then) = - __$$_SelectFoodEventCopyWithImpl<$Res>; +abstract class _$$SelectFoodEventImplCopyWith<$Res> { + factory _$$SelectFoodEventImplCopyWith(_$SelectFoodEventImpl value, + $Res Function(_$SelectFoodEventImpl) then) = + __$$SelectFoodEventImplCopyWithImpl<$Res>; @useResult $Res call({Food food}); @@ -270,11 +272,11 @@ abstract class _$$_SelectFoodEventCopyWith<$Res> { } /// @nodoc -class __$$_SelectFoodEventCopyWithImpl<$Res> - extends _$AddColoriesEventCopyWithImpl<$Res, _$_SelectFoodEvent> - implements _$$_SelectFoodEventCopyWith<$Res> { - __$$_SelectFoodEventCopyWithImpl( - _$_SelectFoodEvent _value, $Res Function(_$_SelectFoodEvent) _then) +class __$$SelectFoodEventImplCopyWithImpl<$Res> + extends _$AddColoriesEventCopyWithImpl<$Res, _$SelectFoodEventImpl> + implements _$$SelectFoodEventImplCopyWith<$Res> { + __$$SelectFoodEventImplCopyWithImpl( + _$SelectFoodEventImpl _value, $Res Function(_$SelectFoodEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -282,7 +284,7 @@ class __$$_SelectFoodEventCopyWithImpl<$Res> $Res call({ Object? food = null, }) { - return _then(_$_SelectFoodEvent( + return _then(_$SelectFoodEventImpl( food: null == food ? _value.food : food // ignore: cast_nullable_to_non_nullable @@ -301,8 +303,8 @@ class __$$_SelectFoodEventCopyWithImpl<$Res> /// @nodoc -class _$_SelectFoodEvent implements _SelectFoodEvent { - _$_SelectFoodEvent({required this.food}); +class _$SelectFoodEventImpl implements _SelectFoodEvent { + _$SelectFoodEventImpl({required this.food}); @override final Food food; @@ -313,10 +315,10 @@ class _$_SelectFoodEvent implements _SelectFoodEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_SelectFoodEvent && + other is _$SelectFoodEventImpl && (identical(other.food, food) || other.food == food)); } @@ -326,8 +328,9 @@ class _$_SelectFoodEvent implements _SelectFoodEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_SelectFoodEventCopyWith<_$_SelectFoodEvent> get copyWith => - __$$_SelectFoodEventCopyWithImpl<_$_SelectFoodEvent>(this, _$identity); + _$$SelectFoodEventImplCopyWith<_$SelectFoodEventImpl> get copyWith => + __$$SelectFoodEventImplCopyWithImpl<_$SelectFoodEventImpl>( + this, _$identity); @override @optionalTypeArgs @@ -435,34 +438,34 @@ class _$_SelectFoodEvent implements _SelectFoodEvent { } abstract class _SelectFoodEvent implements AddColoriesEvent { - factory _SelectFoodEvent({required final Food food}) = _$_SelectFoodEvent; + factory _SelectFoodEvent({required final Food food}) = _$SelectFoodEventImpl; Food get food; @JsonKey(ignore: true) - _$$_SelectFoodEventCopyWith<_$_SelectFoodEvent> get copyWith => + _$$SelectFoodEventImplCopyWith<_$SelectFoodEventImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$_QuickAddFoodEventCopyWith<$Res> { - factory _$$_QuickAddFoodEventCopyWith(_$_QuickAddFoodEvent value, - $Res Function(_$_QuickAddFoodEvent) then) = - __$$_QuickAddFoodEventCopyWithImpl<$Res>; +abstract class _$$QuickAddFoodEventImplCopyWith<$Res> { + factory _$$QuickAddFoodEventImplCopyWith(_$QuickAddFoodEventImpl value, + $Res Function(_$QuickAddFoodEventImpl) then) = + __$$QuickAddFoodEventImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_QuickAddFoodEventCopyWithImpl<$Res> - extends _$AddColoriesEventCopyWithImpl<$Res, _$_QuickAddFoodEvent> - implements _$$_QuickAddFoodEventCopyWith<$Res> { - __$$_QuickAddFoodEventCopyWithImpl( - _$_QuickAddFoodEvent _value, $Res Function(_$_QuickAddFoodEvent) _then) +class __$$QuickAddFoodEventImplCopyWithImpl<$Res> + extends _$AddColoriesEventCopyWithImpl<$Res, _$QuickAddFoodEventImpl> + implements _$$QuickAddFoodEventImplCopyWith<$Res> { + __$$QuickAddFoodEventImplCopyWithImpl(_$QuickAddFoodEventImpl _value, + $Res Function(_$QuickAddFoodEventImpl) _then) : super(_value, _then); } /// @nodoc -class _$_QuickAddFoodEvent implements _QuickAddFoodEvent { - _$_QuickAddFoodEvent(); +class _$QuickAddFoodEventImpl implements _QuickAddFoodEvent { + _$QuickAddFoodEventImpl(); @override String toString() { @@ -470,9 +473,9 @@ class _$_QuickAddFoodEvent implements _QuickAddFoodEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_QuickAddFoodEvent); + (other.runtimeType == runtimeType && other is _$QuickAddFoodEventImpl); } @override @@ -584,14 +587,14 @@ class _$_QuickAddFoodEvent implements _QuickAddFoodEvent { } abstract class _QuickAddFoodEvent implements AddColoriesEvent { - factory _QuickAddFoodEvent() = _$_QuickAddFoodEvent; + factory _QuickAddFoodEvent() = _$QuickAddFoodEventImpl; } /// @nodoc -abstract class _$$_SubmitEventCopyWith<$Res> { - factory _$$_SubmitEventCopyWith( - _$_SubmitEvent value, $Res Function(_$_SubmitEvent) then) = - __$$_SubmitEventCopyWithImpl<$Res>; +abstract class _$$SubmitEventImplCopyWith<$Res> { + factory _$$SubmitEventImplCopyWith( + _$SubmitEventImpl value, $Res Function(_$SubmitEventImpl) then) = + __$$SubmitEventImplCopyWithImpl<$Res>; @useResult $Res call( {double servings, @@ -608,11 +611,11 @@ abstract class _$$_SubmitEventCopyWith<$Res> { } /// @nodoc -class __$$_SubmitEventCopyWithImpl<$Res> - extends _$AddColoriesEventCopyWithImpl<$Res, _$_SubmitEvent> - implements _$$_SubmitEventCopyWith<$Res> { - __$$_SubmitEventCopyWithImpl( - _$_SubmitEvent _value, $Res Function(_$_SubmitEvent) _then) +class __$$SubmitEventImplCopyWithImpl<$Res> + extends _$AddColoriesEventCopyWithImpl<$Res, _$SubmitEventImpl> + implements _$$SubmitEventImplCopyWith<$Res> { + __$$SubmitEventImplCopyWithImpl( + _$SubmitEventImpl _value, $Res Function(_$SubmitEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -628,7 +631,7 @@ class __$$_SubmitEventCopyWithImpl<$Res> Object? protein = freezed, Object? foodType = null, }) { - return _then(_$_SubmitEvent( + return _then(_$SubmitEventImpl( servings: null == servings ? _value.servings : servings // ignore: cast_nullable_to_non_nullable @@ -683,8 +686,8 @@ class __$$_SubmitEventCopyWithImpl<$Res> /// @nodoc -class _$_SubmitEvent implements _SubmitEvent { - _$_SubmitEvent( +class _$SubmitEventImpl implements _SubmitEvent { + _$SubmitEventImpl( {required this.servings, required this.caloriesPerServing, required this.foodLogDate, @@ -720,10 +723,10 @@ class _$_SubmitEvent implements _SubmitEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_SubmitEvent && + other is _$SubmitEventImpl && (identical(other.servings, servings) || other.servings == servings) && (identical(other.caloriesPerServing, caloriesPerServing) || @@ -746,8 +749,8 @@ class _$_SubmitEvent implements _SubmitEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_SubmitEventCopyWith<_$_SubmitEvent> get copyWith => - __$$_SubmitEventCopyWithImpl<_$_SubmitEvent>(this, _$identity); + _$$SubmitEventImplCopyWith<_$SubmitEventImpl> get copyWith => + __$$SubmitEventImplCopyWithImpl<_$SubmitEventImpl>(this, _$identity); @override @optionalTypeArgs @@ -867,7 +870,7 @@ abstract class _SubmitEvent implements AddColoriesEvent { final double? fat, final double? carbs, final double? protein, - required final FoodType foodType}) = _$_SubmitEvent; + required final FoodType foodType}) = _$SubmitEventImpl; double get servings; double get caloriesPerServing; @@ -879,7 +882,7 @@ abstract class _SubmitEvent implements AddColoriesEvent { double? get protein; FoodType get foodType; @JsonKey(ignore: true) - _$$_SubmitEventCopyWith<_$_SubmitEvent> get copyWith => + _$$SubmitEventImplCopyWith<_$SubmitEventImpl> get copyWith => throw _privateConstructorUsedError; } @@ -962,25 +965,25 @@ class _$AddColoriesStateCopyWithImpl<$Res, $Val extends AddColoriesState> } /// @nodoc -abstract class _$$InitialStateCopyWith<$Res> { - factory _$$InitialStateCopyWith( - _$InitialState value, $Res Function(_$InitialState) then) = - __$$InitialStateCopyWithImpl<$Res>; +abstract class _$$InitialStateImplCopyWith<$Res> { + factory _$$InitialStateImplCopyWith( + _$InitialStateImpl value, $Res Function(_$InitialStateImpl) then) = + __$$InitialStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$InitialStateCopyWithImpl<$Res> - extends _$AddColoriesStateCopyWithImpl<$Res, _$InitialState> - implements _$$InitialStateCopyWith<$Res> { - __$$InitialStateCopyWithImpl( - _$InitialState _value, $Res Function(_$InitialState) _then) +class __$$InitialStateImplCopyWithImpl<$Res> + extends _$AddColoriesStateCopyWithImpl<$Res, _$InitialStateImpl> + implements _$$InitialStateImplCopyWith<$Res> { + __$$InitialStateImplCopyWithImpl( + _$InitialStateImpl _value, $Res Function(_$InitialStateImpl) _then) : super(_value, _then); } /// @nodoc -class _$InitialState implements InitialState { - const _$InitialState(); +class _$InitialStateImpl implements InitialState { + const _$InitialStateImpl(); @override String toString() { @@ -988,9 +991,9 @@ class _$InitialState implements InitialState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$InitialState); + (other.runtimeType == runtimeType && other is _$InitialStateImpl); } @override @@ -1078,14 +1081,14 @@ class _$InitialState implements InitialState { } abstract class InitialState implements AddColoriesState { - const factory InitialState() = _$InitialState; + const factory InitialState() = _$InitialStateImpl; } /// @nodoc -abstract class _$$SelectFoodStateCopyWith<$Res> { - factory _$$SelectFoodStateCopyWith( - _$SelectFoodState value, $Res Function(_$SelectFoodState) then) = - __$$SelectFoodStateCopyWithImpl<$Res>; +abstract class _$$SelectFoodStateImplCopyWith<$Res> { + factory _$$SelectFoodStateImplCopyWith(_$SelectFoodStateImpl value, + $Res Function(_$SelectFoodStateImpl) then) = + __$$SelectFoodStateImplCopyWithImpl<$Res>; @useResult $Res call({Food food}); @@ -1093,11 +1096,11 @@ abstract class _$$SelectFoodStateCopyWith<$Res> { } /// @nodoc -class __$$SelectFoodStateCopyWithImpl<$Res> - extends _$AddColoriesStateCopyWithImpl<$Res, _$SelectFoodState> - implements _$$SelectFoodStateCopyWith<$Res> { - __$$SelectFoodStateCopyWithImpl( - _$SelectFoodState _value, $Res Function(_$SelectFoodState) _then) +class __$$SelectFoodStateImplCopyWithImpl<$Res> + extends _$AddColoriesStateCopyWithImpl<$Res, _$SelectFoodStateImpl> + implements _$$SelectFoodStateImplCopyWith<$Res> { + __$$SelectFoodStateImplCopyWithImpl( + _$SelectFoodStateImpl _value, $Res Function(_$SelectFoodStateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1105,7 +1108,7 @@ class __$$SelectFoodStateCopyWithImpl<$Res> $Res call({ Object? food = null, }) { - return _then(_$SelectFoodState( + return _then(_$SelectFoodStateImpl( food: null == food ? _value.food : food // ignore: cast_nullable_to_non_nullable @@ -1124,8 +1127,8 @@ class __$$SelectFoodStateCopyWithImpl<$Res> /// @nodoc -class _$SelectFoodState implements SelectFoodState { - const _$SelectFoodState({required this.food}); +class _$SelectFoodStateImpl implements SelectFoodState { + const _$SelectFoodStateImpl({required this.food}); @override final Food food; @@ -1136,10 +1139,10 @@ class _$SelectFoodState implements SelectFoodState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SelectFoodState && + other is _$SelectFoodStateImpl && (identical(other.food, food) || other.food == food)); } @@ -1149,8 +1152,9 @@ class _$SelectFoodState implements SelectFoodState { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$SelectFoodStateCopyWith<_$SelectFoodState> get copyWith => - __$$SelectFoodStateCopyWithImpl<_$SelectFoodState>(this, _$identity); + _$$SelectFoodStateImplCopyWith<_$SelectFoodStateImpl> get copyWith => + __$$SelectFoodStateImplCopyWithImpl<_$SelectFoodStateImpl>( + this, _$identity); @override @optionalTypeArgs @@ -1234,34 +1238,35 @@ class _$SelectFoodState implements SelectFoodState { } abstract class SelectFoodState implements AddColoriesState { - const factory SelectFoodState({required final Food food}) = _$SelectFoodState; + const factory SelectFoodState({required final Food food}) = + _$SelectFoodStateImpl; Food get food; @JsonKey(ignore: true) - _$$SelectFoodStateCopyWith<_$SelectFoodState> get copyWith => + _$$SelectFoodStateImplCopyWith<_$SelectFoodStateImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$QuickAddFoodStateCopyWith<$Res> { - factory _$$QuickAddFoodStateCopyWith( - _$QuickAddFoodState value, $Res Function(_$QuickAddFoodState) then) = - __$$QuickAddFoodStateCopyWithImpl<$Res>; +abstract class _$$QuickAddFoodStateImplCopyWith<$Res> { + factory _$$QuickAddFoodStateImplCopyWith(_$QuickAddFoodStateImpl value, + $Res Function(_$QuickAddFoodStateImpl) then) = + __$$QuickAddFoodStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$QuickAddFoodStateCopyWithImpl<$Res> - extends _$AddColoriesStateCopyWithImpl<$Res, _$QuickAddFoodState> - implements _$$QuickAddFoodStateCopyWith<$Res> { - __$$QuickAddFoodStateCopyWithImpl( - _$QuickAddFoodState _value, $Res Function(_$QuickAddFoodState) _then) +class __$$QuickAddFoodStateImplCopyWithImpl<$Res> + extends _$AddColoriesStateCopyWithImpl<$Res, _$QuickAddFoodStateImpl> + implements _$$QuickAddFoodStateImplCopyWith<$Res> { + __$$QuickAddFoodStateImplCopyWithImpl(_$QuickAddFoodStateImpl _value, + $Res Function(_$QuickAddFoodStateImpl) _then) : super(_value, _then); } /// @nodoc -class _$QuickAddFoodState implements QuickAddFoodState { - const _$QuickAddFoodState(); +class _$QuickAddFoodStateImpl implements QuickAddFoodState { + const _$QuickAddFoodStateImpl(); @override String toString() { @@ -1269,9 +1274,9 @@ class _$QuickAddFoodState implements QuickAddFoodState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$QuickAddFoodState); + (other.runtimeType == runtimeType && other is _$QuickAddFoodStateImpl); } @override @@ -1359,29 +1364,29 @@ class _$QuickAddFoodState implements QuickAddFoodState { } abstract class QuickAddFoodState implements AddColoriesState { - const factory QuickAddFoodState() = _$QuickAddFoodState; + const factory QuickAddFoodState() = _$QuickAddFoodStateImpl; } /// @nodoc -abstract class _$$_AddingStateCopyWith<$Res> { - factory _$$_AddingStateCopyWith( - _$_AddingState value, $Res Function(_$_AddingState) then) = - __$$_AddingStateCopyWithImpl<$Res>; +abstract class _$$AddingStateImplCopyWith<$Res> { + factory _$$AddingStateImplCopyWith( + _$AddingStateImpl value, $Res Function(_$AddingStateImpl) then) = + __$$AddingStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_AddingStateCopyWithImpl<$Res> - extends _$AddColoriesStateCopyWithImpl<$Res, _$_AddingState> - implements _$$_AddingStateCopyWith<$Res> { - __$$_AddingStateCopyWithImpl( - _$_AddingState _value, $Res Function(_$_AddingState) _then) +class __$$AddingStateImplCopyWithImpl<$Res> + extends _$AddColoriesStateCopyWithImpl<$Res, _$AddingStateImpl> + implements _$$AddingStateImplCopyWith<$Res> { + __$$AddingStateImplCopyWithImpl( + _$AddingStateImpl _value, $Res Function(_$AddingStateImpl) _then) : super(_value, _then); } /// @nodoc -class _$_AddingState implements _AddingState { - const _$_AddingState(); +class _$AddingStateImpl implements _AddingState { + const _$AddingStateImpl(); @override String toString() { @@ -1389,9 +1394,9 @@ class _$_AddingState implements _AddingState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_AddingState); + (other.runtimeType == runtimeType && other is _$AddingStateImpl); } @override @@ -1479,29 +1484,29 @@ class _$_AddingState implements _AddingState { } abstract class _AddingState implements AddColoriesState { - const factory _AddingState() = _$_AddingState; + const factory _AddingState() = _$AddingStateImpl; } /// @nodoc -abstract class _$$_SuccessStateCopyWith<$Res> { - factory _$$_SuccessStateCopyWith( - _$_SuccessState value, $Res Function(_$_SuccessState) then) = - __$$_SuccessStateCopyWithImpl<$Res>; +abstract class _$$SuccessStateImplCopyWith<$Res> { + factory _$$SuccessStateImplCopyWith( + _$SuccessStateImpl value, $Res Function(_$SuccessStateImpl) then) = + __$$SuccessStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_SuccessStateCopyWithImpl<$Res> - extends _$AddColoriesStateCopyWithImpl<$Res, _$_SuccessState> - implements _$$_SuccessStateCopyWith<$Res> { - __$$_SuccessStateCopyWithImpl( - _$_SuccessState _value, $Res Function(_$_SuccessState) _then) +class __$$SuccessStateImplCopyWithImpl<$Res> + extends _$AddColoriesStateCopyWithImpl<$Res, _$SuccessStateImpl> + implements _$$SuccessStateImplCopyWith<$Res> { + __$$SuccessStateImplCopyWithImpl( + _$SuccessStateImpl _value, $Res Function(_$SuccessStateImpl) _then) : super(_value, _then); } /// @nodoc -class _$_SuccessState implements _SuccessState { - const _$_SuccessState(); +class _$SuccessStateImpl implements _SuccessState { + const _$SuccessStateImpl(); @override String toString() { @@ -1509,9 +1514,9 @@ class _$_SuccessState implements _SuccessState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_SuccessState); + (other.runtimeType == runtimeType && other is _$SuccessStateImpl); } @override @@ -1599,5 +1604,5 @@ class _$_SuccessState implements _SuccessState { } abstract class _SuccessState implements AddColoriesState { - const factory _SuccessState() = _$_SuccessState; + const factory _SuccessState() = _$SuccessStateImpl; } diff --git a/lib/ui/views/add_calories/view/add_calories.form.dart b/lib/ui/views/add_calories/view/add_calories.form.dart index 7900d5c..f3836e6 100644 --- a/lib/ui/views/add_calories/view/add_calories.form.dart +++ b/lib/ui/views/add_calories/view/add_calories.form.dart @@ -100,6 +100,22 @@ class _AddCaloriesForm extends StatelessWidget { ? const Text('Unmodify Nutrition Values') : const Text('Modify Nutrition Values'), ), + if (food.notes != null && food.notes!.isNotEmpty) ...[ + const SizedBox(height: 16), + Text( + 'Notes: ${food.notes}', + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodySmall, + ), + ], + if (food.description != null && food.description!.isNotEmpty) ...[ + const SizedBox(height: 16), + Text( + 'Description: ${food.description}', + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodySmall, + ), + ], ], ), ), diff --git a/lib/ui/views/add_calories/view/add_calories.view.dart b/lib/ui/views/add_calories/view/add_calories.view.dart index ae4deec..6677706 100644 --- a/lib/ui/views/add_calories/view/add_calories.view.dart +++ b/lib/ui/views/add_calories/view/add_calories.view.dart @@ -6,6 +6,8 @@ import 'package:calorie_tracker/ui/extensions/light_dark_color/theme+extension.d import 'package:calorie_tracker/ui/views/add_calories/bloc/add_colories_bloc.dart'; import 'package:calorie_tracker/ui/views/add_food/add_food.dart'; import 'package:calorie_tracker/ui/views/add_recipe/view/add_recipe.page.dart'; +import 'package:calorie_tracker/ui/views/search_food_macro/bloc/search_food_macro.cubit.dart'; +import 'package:calorie_tracker/ui/views/search_food_macro/view/search_food_macro.view.dart'; import 'package:calorie_tracker/ui/widgets/foodTypeSelector.widget.dart'; import 'package:calorie_tracker/ui/widgets/textfield.widget.dart'; import 'package:drop_down_list/drop_down_list.dart'; @@ -13,6 +15,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_form_bloc/flutter_form_bloc.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:wolt_modal_sheet/wolt_modal_sheet.dart'; part 'add_calories.form.dart'; part 'quick_add_calories.form.dart'; @@ -298,7 +301,7 @@ class _EmptyStateBody extends StatelessWidget { child: Column( children: const [ Icon( - FontAwesomeIcons.boltLightning, + FontAwesomeIcons.bowlFood, size: 70, ), SizedBox(height: 10), @@ -314,6 +317,39 @@ class _EmptyStateBody extends StatelessWidget { ); }, ), + TextButton( + style: TextButton.styleFrom( + minimumSize: const Size.square(180), + // padding: const EdgeInsets.all(16), + backgroundColor: Colors.white10, + ), + child: Column( + children: const [ + Icon( + FontAwesomeIcons.searchengin, + size: 70, + ), + SizedBox(height: 10), + Text('Search Nutrition'), + ], + ), + onPressed: () async { + await WoltModalSheet.show( + context: context, + useSafeArea: true, + routeSettings: const RouteSettings(name: 'SearchNutrition'), + useRootNavigator: true, + modalTypeBuilder: (context) { + return WoltModalType.bottomSheet; + }, + pageListBuilder: (context) { + return [ModalSheetForSearchNutrition.build(context)]; + }, + enableDragForBottomSheet: true, + ); + context.read().clear(); + }, + ), ], ), ); diff --git a/lib/ui/views/add_recipe/bloc/add_recipe_bloc.freezed.dart b/lib/ui/views/add_recipe/bloc/add_recipe_bloc.freezed.dart index 7fe56b8..ea48959 100644 --- a/lib/ui/views/add_recipe/bloc/add_recipe_bloc.freezed.dart +++ b/lib/ui/views/add_recipe/bloc/add_recipe_bloc.freezed.dart @@ -12,7 +12,7 @@ part of 'add_recipe_bloc.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$AddRecipeEvent { @@ -111,25 +111,25 @@ class _$AddRecipeEventCopyWithImpl<$Res, $Val extends AddRecipeEvent> } /// @nodoc -abstract class _$$_AddRecipeEventCopyWith<$Res> { - factory _$$_AddRecipeEventCopyWith( - _$_AddRecipeEvent value, $Res Function(_$_AddRecipeEvent) then) = - __$$_AddRecipeEventCopyWithImpl<$Res>; +abstract class _$$AddRecipeEventImplCopyWith<$Res> { + factory _$$AddRecipeEventImplCopyWith(_$AddRecipeEventImpl value, + $Res Function(_$AddRecipeEventImpl) then) = + __$$AddRecipeEventImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_AddRecipeEventCopyWithImpl<$Res> - extends _$AddRecipeEventCopyWithImpl<$Res, _$_AddRecipeEvent> - implements _$$_AddRecipeEventCopyWith<$Res> { - __$$_AddRecipeEventCopyWithImpl( - _$_AddRecipeEvent _value, $Res Function(_$_AddRecipeEvent) _then) +class __$$AddRecipeEventImplCopyWithImpl<$Res> + extends _$AddRecipeEventCopyWithImpl<$Res, _$AddRecipeEventImpl> + implements _$$AddRecipeEventImplCopyWith<$Res> { + __$$AddRecipeEventImplCopyWithImpl( + _$AddRecipeEventImpl _value, $Res Function(_$AddRecipeEventImpl) _then) : super(_value, _then); } /// @nodoc -class _$_AddRecipeEvent implements _AddRecipeEvent { - const _$_AddRecipeEvent(); +class _$AddRecipeEventImpl implements _AddRecipeEvent { + const _$AddRecipeEventImpl(); @override String toString() { @@ -137,9 +137,9 @@ class _$_AddRecipeEvent implements _AddRecipeEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_AddRecipeEvent); + (other.runtimeType == runtimeType && other is _$AddRecipeEventImpl); } @override @@ -245,14 +245,14 @@ class _$_AddRecipeEvent implements _AddRecipeEvent { } abstract class _AddRecipeEvent implements AddRecipeEvent { - const factory _AddRecipeEvent() = _$_AddRecipeEvent; + const factory _AddRecipeEvent() = _$AddRecipeEventImpl; } /// @nodoc -abstract class _$$_AddIngredientEventCopyWith<$Res> { - factory _$$_AddIngredientEventCopyWith(_$_AddIngredientEvent value, - $Res Function(_$_AddIngredientEvent) then) = - __$$_AddIngredientEventCopyWithImpl<$Res>; +abstract class _$$AddIngredientEventImplCopyWith<$Res> { + factory _$$AddIngredientEventImplCopyWith(_$AddIngredientEventImpl value, + $Res Function(_$AddIngredientEventImpl) then) = + __$$AddIngredientEventImplCopyWithImpl<$Res>; @useResult $Res call({Food food, double quantity}); @@ -260,11 +260,11 @@ abstract class _$$_AddIngredientEventCopyWith<$Res> { } /// @nodoc -class __$$_AddIngredientEventCopyWithImpl<$Res> - extends _$AddRecipeEventCopyWithImpl<$Res, _$_AddIngredientEvent> - implements _$$_AddIngredientEventCopyWith<$Res> { - __$$_AddIngredientEventCopyWithImpl( - _$_AddIngredientEvent _value, $Res Function(_$_AddIngredientEvent) _then) +class __$$AddIngredientEventImplCopyWithImpl<$Res> + extends _$AddRecipeEventCopyWithImpl<$Res, _$AddIngredientEventImpl> + implements _$$AddIngredientEventImplCopyWith<$Res> { + __$$AddIngredientEventImplCopyWithImpl(_$AddIngredientEventImpl _value, + $Res Function(_$AddIngredientEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -273,7 +273,7 @@ class __$$_AddIngredientEventCopyWithImpl<$Res> Object? food = null, Object? quantity = null, }) { - return _then(_$_AddIngredientEvent( + return _then(_$AddIngredientEventImpl( null == food ? _value.food : food // ignore: cast_nullable_to_non_nullable @@ -296,8 +296,8 @@ class __$$_AddIngredientEventCopyWithImpl<$Res> /// @nodoc -class _$_AddIngredientEvent implements _AddIngredientEvent { - const _$_AddIngredientEvent(this.food, this.quantity); +class _$AddIngredientEventImpl implements _AddIngredientEvent { + const _$AddIngredientEventImpl(this.food, this.quantity); @override final Food food; @@ -310,10 +310,10 @@ class _$_AddIngredientEvent implements _AddIngredientEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_AddIngredientEvent && + other is _$AddIngredientEventImpl && (identical(other.food, food) || other.food == food) && (identical(other.quantity, quantity) || other.quantity == quantity)); @@ -325,8 +325,8 @@ class _$_AddIngredientEvent implements _AddIngredientEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_AddIngredientEventCopyWith<_$_AddIngredientEvent> get copyWith => - __$$_AddIngredientEventCopyWithImpl<_$_AddIngredientEvent>( + _$$AddIngredientEventImplCopyWith<_$AddIngredientEventImpl> get copyWith => + __$$AddIngredientEventImplCopyWithImpl<_$AddIngredientEventImpl>( this, _$identity); @override @@ -430,20 +430,21 @@ class _$_AddIngredientEvent implements _AddIngredientEvent { abstract class _AddIngredientEvent implements AddRecipeEvent { const factory _AddIngredientEvent(final Food food, final double quantity) = - _$_AddIngredientEvent; + _$AddIngredientEventImpl; Food get food; double get quantity; @JsonKey(ignore: true) - _$$_AddIngredientEventCopyWith<_$_AddIngredientEvent> get copyWith => + _$$AddIngredientEventImplCopyWith<_$AddIngredientEventImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$_RemoveIngredientEventCopyWith<$Res> { - factory _$$_RemoveIngredientEventCopyWith(_$_RemoveIngredientEvent value, - $Res Function(_$_RemoveIngredientEvent) then) = - __$$_RemoveIngredientEventCopyWithImpl<$Res>; +abstract class _$$RemoveIngredientEventImplCopyWith<$Res> { + factory _$$RemoveIngredientEventImplCopyWith( + _$RemoveIngredientEventImpl value, + $Res Function(_$RemoveIngredientEventImpl) then) = + __$$RemoveIngredientEventImplCopyWithImpl<$Res>; @useResult $Res call({Food food}); @@ -451,11 +452,11 @@ abstract class _$$_RemoveIngredientEventCopyWith<$Res> { } /// @nodoc -class __$$_RemoveIngredientEventCopyWithImpl<$Res> - extends _$AddRecipeEventCopyWithImpl<$Res, _$_RemoveIngredientEvent> - implements _$$_RemoveIngredientEventCopyWith<$Res> { - __$$_RemoveIngredientEventCopyWithImpl(_$_RemoveIngredientEvent _value, - $Res Function(_$_RemoveIngredientEvent) _then) +class __$$RemoveIngredientEventImplCopyWithImpl<$Res> + extends _$AddRecipeEventCopyWithImpl<$Res, _$RemoveIngredientEventImpl> + implements _$$RemoveIngredientEventImplCopyWith<$Res> { + __$$RemoveIngredientEventImplCopyWithImpl(_$RemoveIngredientEventImpl _value, + $Res Function(_$RemoveIngredientEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -463,7 +464,7 @@ class __$$_RemoveIngredientEventCopyWithImpl<$Res> $Res call({ Object? food = null, }) { - return _then(_$_RemoveIngredientEvent( + return _then(_$RemoveIngredientEventImpl( null == food ? _value.food : food // ignore: cast_nullable_to_non_nullable @@ -482,8 +483,8 @@ class __$$_RemoveIngredientEventCopyWithImpl<$Res> /// @nodoc -class _$_RemoveIngredientEvent implements _RemoveIngredientEvent { - const _$_RemoveIngredientEvent(this.food); +class _$RemoveIngredientEventImpl implements _RemoveIngredientEvent { + const _$RemoveIngredientEventImpl(this.food); @override final Food food; @@ -494,10 +495,10 @@ class _$_RemoveIngredientEvent implements _RemoveIngredientEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_RemoveIngredientEvent && + other is _$RemoveIngredientEventImpl && (identical(other.food, food) || other.food == food)); } @@ -507,9 +508,9 @@ class _$_RemoveIngredientEvent implements _RemoveIngredientEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_RemoveIngredientEventCopyWith<_$_RemoveIngredientEvent> get copyWith => - __$$_RemoveIngredientEventCopyWithImpl<_$_RemoveIngredientEvent>( - this, _$identity); + _$$RemoveIngredientEventImplCopyWith<_$RemoveIngredientEventImpl> + get copyWith => __$$RemoveIngredientEventImplCopyWithImpl< + _$RemoveIngredientEventImpl>(this, _$identity); @override @optionalTypeArgs @@ -612,19 +613,20 @@ class _$_RemoveIngredientEvent implements _RemoveIngredientEvent { abstract class _RemoveIngredientEvent implements AddRecipeEvent { const factory _RemoveIngredientEvent(final Food food) = - _$_RemoveIngredientEvent; + _$RemoveIngredientEventImpl; Food get food; @JsonKey(ignore: true) - _$$_RemoveIngredientEventCopyWith<_$_RemoveIngredientEvent> get copyWith => - throw _privateConstructorUsedError; + _$$RemoveIngredientEventImplCopyWith<_$RemoveIngredientEventImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$_UpdateIngredientEventCopyWith<$Res> { - factory _$$_UpdateIngredientEventCopyWith(_$_UpdateIngredientEvent value, - $Res Function(_$_UpdateIngredientEvent) then) = - __$$_UpdateIngredientEventCopyWithImpl<$Res>; +abstract class _$$UpdateIngredientEventImplCopyWith<$Res> { + factory _$$UpdateIngredientEventImplCopyWith( + _$UpdateIngredientEventImpl value, + $Res Function(_$UpdateIngredientEventImpl) then) = + __$$UpdateIngredientEventImplCopyWithImpl<$Res>; @useResult $Res call({Food food, double quantity}); @@ -632,11 +634,11 @@ abstract class _$$_UpdateIngredientEventCopyWith<$Res> { } /// @nodoc -class __$$_UpdateIngredientEventCopyWithImpl<$Res> - extends _$AddRecipeEventCopyWithImpl<$Res, _$_UpdateIngredientEvent> - implements _$$_UpdateIngredientEventCopyWith<$Res> { - __$$_UpdateIngredientEventCopyWithImpl(_$_UpdateIngredientEvent _value, - $Res Function(_$_UpdateIngredientEvent) _then) +class __$$UpdateIngredientEventImplCopyWithImpl<$Res> + extends _$AddRecipeEventCopyWithImpl<$Res, _$UpdateIngredientEventImpl> + implements _$$UpdateIngredientEventImplCopyWith<$Res> { + __$$UpdateIngredientEventImplCopyWithImpl(_$UpdateIngredientEventImpl _value, + $Res Function(_$UpdateIngredientEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -645,7 +647,7 @@ class __$$_UpdateIngredientEventCopyWithImpl<$Res> Object? food = null, Object? quantity = null, }) { - return _then(_$_UpdateIngredientEvent( + return _then(_$UpdateIngredientEventImpl( null == food ? _value.food : food // ignore: cast_nullable_to_non_nullable @@ -668,8 +670,8 @@ class __$$_UpdateIngredientEventCopyWithImpl<$Res> /// @nodoc -class _$_UpdateIngredientEvent implements _UpdateIngredientEvent { - const _$_UpdateIngredientEvent(this.food, this.quantity); +class _$UpdateIngredientEventImpl implements _UpdateIngredientEvent { + const _$UpdateIngredientEventImpl(this.food, this.quantity); @override final Food food; @@ -682,10 +684,10 @@ class _$_UpdateIngredientEvent implements _UpdateIngredientEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_UpdateIngredientEvent && + other is _$UpdateIngredientEventImpl && (identical(other.food, food) || other.food == food) && (identical(other.quantity, quantity) || other.quantity == quantity)); @@ -697,9 +699,9 @@ class _$_UpdateIngredientEvent implements _UpdateIngredientEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_UpdateIngredientEventCopyWith<_$_UpdateIngredientEvent> get copyWith => - __$$_UpdateIngredientEventCopyWithImpl<_$_UpdateIngredientEvent>( - this, _$identity); + _$$UpdateIngredientEventImplCopyWith<_$UpdateIngredientEventImpl> + get copyWith => __$$UpdateIngredientEventImplCopyWithImpl< + _$UpdateIngredientEventImpl>(this, _$identity); @override @optionalTypeArgs @@ -802,30 +804,31 @@ class _$_UpdateIngredientEvent implements _UpdateIngredientEvent { abstract class _UpdateIngredientEvent implements AddRecipeEvent { const factory _UpdateIngredientEvent(final Food food, final double quantity) = - _$_UpdateIngredientEvent; + _$UpdateIngredientEventImpl; Food get food; double get quantity; @JsonKey(ignore: true) - _$$_UpdateIngredientEventCopyWith<_$_UpdateIngredientEvent> get copyWith => - throw _privateConstructorUsedError; + _$$UpdateIngredientEventImplCopyWith<_$UpdateIngredientEventImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$_UpdateRecipeNameEventCopyWith<$Res> { - factory _$$_UpdateRecipeNameEventCopyWith(_$_UpdateRecipeNameEvent value, - $Res Function(_$_UpdateRecipeNameEvent) then) = - __$$_UpdateRecipeNameEventCopyWithImpl<$Res>; +abstract class _$$UpdateRecipeNameEventImplCopyWith<$Res> { + factory _$$UpdateRecipeNameEventImplCopyWith( + _$UpdateRecipeNameEventImpl value, + $Res Function(_$UpdateRecipeNameEventImpl) then) = + __$$UpdateRecipeNameEventImplCopyWithImpl<$Res>; @useResult $Res call({String name}); } /// @nodoc -class __$$_UpdateRecipeNameEventCopyWithImpl<$Res> - extends _$AddRecipeEventCopyWithImpl<$Res, _$_UpdateRecipeNameEvent> - implements _$$_UpdateRecipeNameEventCopyWith<$Res> { - __$$_UpdateRecipeNameEventCopyWithImpl(_$_UpdateRecipeNameEvent _value, - $Res Function(_$_UpdateRecipeNameEvent) _then) +class __$$UpdateRecipeNameEventImplCopyWithImpl<$Res> + extends _$AddRecipeEventCopyWithImpl<$Res, _$UpdateRecipeNameEventImpl> + implements _$$UpdateRecipeNameEventImplCopyWith<$Res> { + __$$UpdateRecipeNameEventImplCopyWithImpl(_$UpdateRecipeNameEventImpl _value, + $Res Function(_$UpdateRecipeNameEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -833,7 +836,7 @@ class __$$_UpdateRecipeNameEventCopyWithImpl<$Res> $Res call({ Object? name = null, }) { - return _then(_$_UpdateRecipeNameEvent( + return _then(_$UpdateRecipeNameEventImpl( null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable @@ -844,8 +847,8 @@ class __$$_UpdateRecipeNameEventCopyWithImpl<$Res> /// @nodoc -class _$_UpdateRecipeNameEvent implements _UpdateRecipeNameEvent { - const _$_UpdateRecipeNameEvent(this.name); +class _$UpdateRecipeNameEventImpl implements _UpdateRecipeNameEvent { + const _$UpdateRecipeNameEventImpl(this.name); @override final String name; @@ -856,10 +859,10 @@ class _$_UpdateRecipeNameEvent implements _UpdateRecipeNameEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_UpdateRecipeNameEvent && + other is _$UpdateRecipeNameEventImpl && (identical(other.name, name) || other.name == name)); } @@ -869,9 +872,9 @@ class _$_UpdateRecipeNameEvent implements _UpdateRecipeNameEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_UpdateRecipeNameEventCopyWith<_$_UpdateRecipeNameEvent> get copyWith => - __$$_UpdateRecipeNameEventCopyWithImpl<_$_UpdateRecipeNameEvent>( - this, _$identity); + _$$UpdateRecipeNameEventImplCopyWith<_$UpdateRecipeNameEventImpl> + get copyWith => __$$UpdateRecipeNameEventImplCopyWithImpl< + _$UpdateRecipeNameEventImpl>(this, _$identity); @override @optionalTypeArgs @@ -974,29 +977,30 @@ class _$_UpdateRecipeNameEvent implements _UpdateRecipeNameEvent { abstract class _UpdateRecipeNameEvent implements AddRecipeEvent { const factory _UpdateRecipeNameEvent(final String name) = - _$_UpdateRecipeNameEvent; + _$UpdateRecipeNameEventImpl; String get name; @JsonKey(ignore: true) - _$$_UpdateRecipeNameEventCopyWith<_$_UpdateRecipeNameEvent> get copyWith => - throw _privateConstructorUsedError; + _$$UpdateRecipeNameEventImplCopyWith<_$UpdateRecipeNameEventImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$_UpdateRecipeNoteEventCopyWith<$Res> { - factory _$$_UpdateRecipeNoteEventCopyWith(_$_UpdateRecipeNoteEvent value, - $Res Function(_$_UpdateRecipeNoteEvent) then) = - __$$_UpdateRecipeNoteEventCopyWithImpl<$Res>; +abstract class _$$UpdateRecipeNoteEventImplCopyWith<$Res> { + factory _$$UpdateRecipeNoteEventImplCopyWith( + _$UpdateRecipeNoteEventImpl value, + $Res Function(_$UpdateRecipeNoteEventImpl) then) = + __$$UpdateRecipeNoteEventImplCopyWithImpl<$Res>; @useResult $Res call({String note}); } /// @nodoc -class __$$_UpdateRecipeNoteEventCopyWithImpl<$Res> - extends _$AddRecipeEventCopyWithImpl<$Res, _$_UpdateRecipeNoteEvent> - implements _$$_UpdateRecipeNoteEventCopyWith<$Res> { - __$$_UpdateRecipeNoteEventCopyWithImpl(_$_UpdateRecipeNoteEvent _value, - $Res Function(_$_UpdateRecipeNoteEvent) _then) +class __$$UpdateRecipeNoteEventImplCopyWithImpl<$Res> + extends _$AddRecipeEventCopyWithImpl<$Res, _$UpdateRecipeNoteEventImpl> + implements _$$UpdateRecipeNoteEventImplCopyWith<$Res> { + __$$UpdateRecipeNoteEventImplCopyWithImpl(_$UpdateRecipeNoteEventImpl _value, + $Res Function(_$UpdateRecipeNoteEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1004,7 +1008,7 @@ class __$$_UpdateRecipeNoteEventCopyWithImpl<$Res> $Res call({ Object? note = null, }) { - return _then(_$_UpdateRecipeNoteEvent( + return _then(_$UpdateRecipeNoteEventImpl( null == note ? _value.note : note // ignore: cast_nullable_to_non_nullable @@ -1015,8 +1019,8 @@ class __$$_UpdateRecipeNoteEventCopyWithImpl<$Res> /// @nodoc -class _$_UpdateRecipeNoteEvent implements _UpdateRecipeNoteEvent { - const _$_UpdateRecipeNoteEvent(this.note); +class _$UpdateRecipeNoteEventImpl implements _UpdateRecipeNoteEvent { + const _$UpdateRecipeNoteEventImpl(this.note); @override final String note; @@ -1027,10 +1031,10 @@ class _$_UpdateRecipeNoteEvent implements _UpdateRecipeNoteEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_UpdateRecipeNoteEvent && + other is _$UpdateRecipeNoteEventImpl && (identical(other.note, note) || other.note == note)); } @@ -1040,9 +1044,9 @@ class _$_UpdateRecipeNoteEvent implements _UpdateRecipeNoteEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_UpdateRecipeNoteEventCopyWith<_$_UpdateRecipeNoteEvent> get copyWith => - __$$_UpdateRecipeNoteEventCopyWithImpl<_$_UpdateRecipeNoteEvent>( - this, _$identity); + _$$UpdateRecipeNoteEventImplCopyWith<_$UpdateRecipeNoteEventImpl> + get copyWith => __$$UpdateRecipeNoteEventImplCopyWithImpl< + _$UpdateRecipeNoteEventImpl>(this, _$identity); @override @optionalTypeArgs @@ -1145,31 +1149,31 @@ class _$_UpdateRecipeNoteEvent implements _UpdateRecipeNoteEvent { abstract class _UpdateRecipeNoteEvent implements AddRecipeEvent { const factory _UpdateRecipeNoteEvent(final String note) = - _$_UpdateRecipeNoteEvent; + _$UpdateRecipeNoteEventImpl; String get note; @JsonKey(ignore: true) - _$$_UpdateRecipeNoteEventCopyWith<_$_UpdateRecipeNoteEvent> get copyWith => - throw _privateConstructorUsedError; + _$$UpdateRecipeNoteEventImplCopyWith<_$UpdateRecipeNoteEventImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$_UpdateTotalNutritionEventCopyWith<$Res> { - factory _$$_UpdateTotalNutritionEventCopyWith( - _$_UpdateTotalNutritionEvent value, - $Res Function(_$_UpdateTotalNutritionEvent) then) = - __$$_UpdateTotalNutritionEventCopyWithImpl<$Res>; +abstract class _$$UpdateTotalNutritionEventImplCopyWith<$Res> { + factory _$$UpdateTotalNutritionEventImplCopyWith( + _$UpdateTotalNutritionEventImpl value, + $Res Function(_$UpdateTotalNutritionEventImpl) then) = + __$$UpdateTotalNutritionEventImplCopyWithImpl<$Res>; @useResult $Res call({double carbs, double protein, double fat, double calories}); } /// @nodoc -class __$$_UpdateTotalNutritionEventCopyWithImpl<$Res> - extends _$AddRecipeEventCopyWithImpl<$Res, _$_UpdateTotalNutritionEvent> - implements _$$_UpdateTotalNutritionEventCopyWith<$Res> { - __$$_UpdateTotalNutritionEventCopyWithImpl( - _$_UpdateTotalNutritionEvent _value, - $Res Function(_$_UpdateTotalNutritionEvent) _then) +class __$$UpdateTotalNutritionEventImplCopyWithImpl<$Res> + extends _$AddRecipeEventCopyWithImpl<$Res, _$UpdateTotalNutritionEventImpl> + implements _$$UpdateTotalNutritionEventImplCopyWith<$Res> { + __$$UpdateTotalNutritionEventImplCopyWithImpl( + _$UpdateTotalNutritionEventImpl _value, + $Res Function(_$UpdateTotalNutritionEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1180,7 +1184,7 @@ class __$$_UpdateTotalNutritionEventCopyWithImpl<$Res> Object? fat = null, Object? calories = null, }) { - return _then(_$_UpdateTotalNutritionEvent( + return _then(_$UpdateTotalNutritionEventImpl( null == carbs ? _value.carbs : carbs // ignore: cast_nullable_to_non_nullable @@ -1203,8 +1207,8 @@ class __$$_UpdateTotalNutritionEventCopyWithImpl<$Res> /// @nodoc -class _$_UpdateTotalNutritionEvent implements _UpdateTotalNutritionEvent { - const _$_UpdateTotalNutritionEvent( +class _$UpdateTotalNutritionEventImpl implements _UpdateTotalNutritionEvent { + const _$UpdateTotalNutritionEventImpl( this.carbs, this.protein, this.fat, this.calories); @override @@ -1222,10 +1226,10 @@ class _$_UpdateTotalNutritionEvent implements _UpdateTotalNutritionEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_UpdateTotalNutritionEvent && + other is _$UpdateTotalNutritionEventImpl && (identical(other.carbs, carbs) || other.carbs == carbs) && (identical(other.protein, protein) || other.protein == protein) && (identical(other.fat, fat) || other.fat == fat) && @@ -1239,9 +1243,9 @@ class _$_UpdateTotalNutritionEvent implements _UpdateTotalNutritionEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_UpdateTotalNutritionEventCopyWith<_$_UpdateTotalNutritionEvent> - get copyWith => __$$_UpdateTotalNutritionEventCopyWithImpl< - _$_UpdateTotalNutritionEvent>(this, _$identity); + _$$UpdateTotalNutritionEventImplCopyWith<_$UpdateTotalNutritionEventImpl> + get copyWith => __$$UpdateTotalNutritionEventImplCopyWithImpl< + _$UpdateTotalNutritionEventImpl>(this, _$identity); @override @optionalTypeArgs @@ -1347,14 +1351,14 @@ abstract class _UpdateTotalNutritionEvent implements AddRecipeEvent { final double carbs, final double protein, final double fat, - final double calories) = _$_UpdateTotalNutritionEvent; + final double calories) = _$UpdateTotalNutritionEventImpl; double get carbs; double get protein; double get fat; double get calories; @JsonKey(ignore: true) - _$$_UpdateTotalNutritionEventCopyWith<_$_UpdateTotalNutritionEvent> + _$$UpdateTotalNutritionEventImplCopyWith<_$UpdateTotalNutritionEventImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1431,25 +1435,26 @@ class _$AddRecipeStateCopyWithImpl<$Res, $Val extends AddRecipeState> } /// @nodoc -abstract class _$$InitialAddRecipeStateCopyWith<$Res> { - factory _$$InitialAddRecipeStateCopyWith(_$InitialAddRecipeState value, - $Res Function(_$InitialAddRecipeState) then) = - __$$InitialAddRecipeStateCopyWithImpl<$Res>; +abstract class _$$InitialAddRecipeStateImplCopyWith<$Res> { + factory _$$InitialAddRecipeStateImplCopyWith( + _$InitialAddRecipeStateImpl value, + $Res Function(_$InitialAddRecipeStateImpl) then) = + __$$InitialAddRecipeStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$InitialAddRecipeStateCopyWithImpl<$Res> - extends _$AddRecipeStateCopyWithImpl<$Res, _$InitialAddRecipeState> - implements _$$InitialAddRecipeStateCopyWith<$Res> { - __$$InitialAddRecipeStateCopyWithImpl(_$InitialAddRecipeState _value, - $Res Function(_$InitialAddRecipeState) _then) +class __$$InitialAddRecipeStateImplCopyWithImpl<$Res> + extends _$AddRecipeStateCopyWithImpl<$Res, _$InitialAddRecipeStateImpl> + implements _$$InitialAddRecipeStateImplCopyWith<$Res> { + __$$InitialAddRecipeStateImplCopyWithImpl(_$InitialAddRecipeStateImpl _value, + $Res Function(_$InitialAddRecipeStateImpl) _then) : super(_value, _then); } /// @nodoc -class _$InitialAddRecipeState implements InitialAddRecipeState { - const _$InitialAddRecipeState(); +class _$InitialAddRecipeStateImpl implements InitialAddRecipeState { + const _$InitialAddRecipeStateImpl(); @override String toString() { @@ -1457,9 +1462,10 @@ class _$InitialAddRecipeState implements InitialAddRecipeState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$InitialAddRecipeState); + (other.runtimeType == runtimeType && + other is _$InitialAddRecipeStateImpl); } @override @@ -1541,14 +1547,14 @@ class _$InitialAddRecipeState implements InitialAddRecipeState { } abstract class InitialAddRecipeState implements AddRecipeState { - const factory InitialAddRecipeState() = _$InitialAddRecipeState; + const factory InitialAddRecipeState() = _$InitialAddRecipeStateImpl; } /// @nodoc -abstract class _$$CreateAddRecipeStateCopyWith<$Res> { - factory _$$CreateAddRecipeStateCopyWith(_$CreateAddRecipeState value, - $Res Function(_$CreateAddRecipeState) then) = - __$$CreateAddRecipeStateCopyWithImpl<$Res>; +abstract class _$$CreateAddRecipeStateImplCopyWith<$Res> { + factory _$$CreateAddRecipeStateImplCopyWith(_$CreateAddRecipeStateImpl value, + $Res Function(_$CreateAddRecipeStateImpl) then) = + __$$CreateAddRecipeStateImplCopyWithImpl<$Res>; @useResult $Res call({Food recipe}); @@ -1556,11 +1562,11 @@ abstract class _$$CreateAddRecipeStateCopyWith<$Res> { } /// @nodoc -class __$$CreateAddRecipeStateCopyWithImpl<$Res> - extends _$AddRecipeStateCopyWithImpl<$Res, _$CreateAddRecipeState> - implements _$$CreateAddRecipeStateCopyWith<$Res> { - __$$CreateAddRecipeStateCopyWithImpl(_$CreateAddRecipeState _value, - $Res Function(_$CreateAddRecipeState) _then) +class __$$CreateAddRecipeStateImplCopyWithImpl<$Res> + extends _$AddRecipeStateCopyWithImpl<$Res, _$CreateAddRecipeStateImpl> + implements _$$CreateAddRecipeStateImplCopyWith<$Res> { + __$$CreateAddRecipeStateImplCopyWithImpl(_$CreateAddRecipeStateImpl _value, + $Res Function(_$CreateAddRecipeStateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1568,7 +1574,7 @@ class __$$CreateAddRecipeStateCopyWithImpl<$Res> $Res call({ Object? recipe = null, }) { - return _then(_$CreateAddRecipeState( + return _then(_$CreateAddRecipeStateImpl( null == recipe ? _value.recipe : recipe // ignore: cast_nullable_to_non_nullable @@ -1587,8 +1593,8 @@ class __$$CreateAddRecipeStateCopyWithImpl<$Res> /// @nodoc -class _$CreateAddRecipeState implements CreateAddRecipeState { - const _$CreateAddRecipeState(this.recipe); +class _$CreateAddRecipeStateImpl implements CreateAddRecipeState { + const _$CreateAddRecipeStateImpl(this.recipe); @override final Food recipe; @@ -1599,10 +1605,10 @@ class _$CreateAddRecipeState implements CreateAddRecipeState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$CreateAddRecipeState && + other is _$CreateAddRecipeStateImpl && (identical(other.recipe, recipe) || other.recipe == recipe)); } @@ -1612,9 +1618,10 @@ class _$CreateAddRecipeState implements CreateAddRecipeState { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$CreateAddRecipeStateCopyWith<_$CreateAddRecipeState> get copyWith => - __$$CreateAddRecipeStateCopyWithImpl<_$CreateAddRecipeState>( - this, _$identity); + _$$CreateAddRecipeStateImplCopyWith<_$CreateAddRecipeStateImpl> + get copyWith => + __$$CreateAddRecipeStateImplCopyWithImpl<_$CreateAddRecipeStateImpl>( + this, _$identity); @override @optionalTypeArgs @@ -1693,34 +1700,34 @@ class _$CreateAddRecipeState implements CreateAddRecipeState { abstract class CreateAddRecipeState implements AddRecipeState { const factory CreateAddRecipeState(final Food recipe) = - _$CreateAddRecipeState; + _$CreateAddRecipeStateImpl; Food get recipe; @JsonKey(ignore: true) - _$$CreateAddRecipeStateCopyWith<_$CreateAddRecipeState> get copyWith => - throw _privateConstructorUsedError; + _$$CreateAddRecipeStateImplCopyWith<_$CreateAddRecipeStateImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$AddingRecipeStateCopyWith<$Res> { - factory _$$AddingRecipeStateCopyWith( - _$AddingRecipeState value, $Res Function(_$AddingRecipeState) then) = - __$$AddingRecipeStateCopyWithImpl<$Res>; +abstract class _$$AddingRecipeStateImplCopyWith<$Res> { + factory _$$AddingRecipeStateImplCopyWith(_$AddingRecipeStateImpl value, + $Res Function(_$AddingRecipeStateImpl) then) = + __$$AddingRecipeStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$AddingRecipeStateCopyWithImpl<$Res> - extends _$AddRecipeStateCopyWithImpl<$Res, _$AddingRecipeState> - implements _$$AddingRecipeStateCopyWith<$Res> { - __$$AddingRecipeStateCopyWithImpl( - _$AddingRecipeState _value, $Res Function(_$AddingRecipeState) _then) +class __$$AddingRecipeStateImplCopyWithImpl<$Res> + extends _$AddRecipeStateCopyWithImpl<$Res, _$AddingRecipeStateImpl> + implements _$$AddingRecipeStateImplCopyWith<$Res> { + __$$AddingRecipeStateImplCopyWithImpl(_$AddingRecipeStateImpl _value, + $Res Function(_$AddingRecipeStateImpl) _then) : super(_value, _then); } /// @nodoc -class _$AddingRecipeState implements AddingRecipeState { - const _$AddingRecipeState(); +class _$AddingRecipeStateImpl implements AddingRecipeState { + const _$AddingRecipeStateImpl(); @override String toString() { @@ -1728,9 +1735,9 @@ class _$AddingRecipeState implements AddingRecipeState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$AddingRecipeState); + (other.runtimeType == runtimeType && other is _$AddingRecipeStateImpl); } @override @@ -1812,29 +1819,30 @@ class _$AddingRecipeState implements AddingRecipeState { } abstract class AddingRecipeState implements AddRecipeState { - const factory AddingRecipeState() = _$AddingRecipeState; + const factory AddingRecipeState() = _$AddingRecipeStateImpl; } /// @nodoc -abstract class _$$SuccessAddRecipeStateCopyWith<$Res> { - factory _$$SuccessAddRecipeStateCopyWith(_$SuccessAddRecipeState value, - $Res Function(_$SuccessAddRecipeState) then) = - __$$SuccessAddRecipeStateCopyWithImpl<$Res>; +abstract class _$$SuccessAddRecipeStateImplCopyWith<$Res> { + factory _$$SuccessAddRecipeStateImplCopyWith( + _$SuccessAddRecipeStateImpl value, + $Res Function(_$SuccessAddRecipeStateImpl) then) = + __$$SuccessAddRecipeStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$SuccessAddRecipeStateCopyWithImpl<$Res> - extends _$AddRecipeStateCopyWithImpl<$Res, _$SuccessAddRecipeState> - implements _$$SuccessAddRecipeStateCopyWith<$Res> { - __$$SuccessAddRecipeStateCopyWithImpl(_$SuccessAddRecipeState _value, - $Res Function(_$SuccessAddRecipeState) _then) +class __$$SuccessAddRecipeStateImplCopyWithImpl<$Res> + extends _$AddRecipeStateCopyWithImpl<$Res, _$SuccessAddRecipeStateImpl> + implements _$$SuccessAddRecipeStateImplCopyWith<$Res> { + __$$SuccessAddRecipeStateImplCopyWithImpl(_$SuccessAddRecipeStateImpl _value, + $Res Function(_$SuccessAddRecipeStateImpl) _then) : super(_value, _then); } /// @nodoc -class _$SuccessAddRecipeState implements SuccessAddRecipeState { - const _$SuccessAddRecipeState(); +class _$SuccessAddRecipeStateImpl implements SuccessAddRecipeState { + const _$SuccessAddRecipeStateImpl(); @override String toString() { @@ -1842,9 +1850,10 @@ class _$SuccessAddRecipeState implements SuccessAddRecipeState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$SuccessAddRecipeState); + (other.runtimeType == runtimeType && + other is _$SuccessAddRecipeStateImpl); } @override @@ -1926,5 +1935,5 @@ class _$SuccessAddRecipeState implements SuccessAddRecipeState { } abstract class SuccessAddRecipeState implements AddRecipeState { - const factory SuccessAddRecipeState() = _$SuccessAddRecipeState; + const factory SuccessAddRecipeState() = _$SuccessAddRecipeStateImpl; } diff --git a/lib/ui/views/home/bloc/home_bloc.freezed.dart b/lib/ui/views/home/bloc/home_bloc.freezed.dart index 92cd36a..3c99407 100644 --- a/lib/ui/views/home/bloc/home_bloc.freezed.dart +++ b/lib/ui/views/home/bloc/home_bloc.freezed.dart @@ -12,7 +12,7 @@ part of 'home_bloc.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$HomeEvent { @@ -107,25 +107,25 @@ class _$HomeEventCopyWithImpl<$Res, $Val extends HomeEvent> } /// @nodoc -abstract class _$$TodayHomeEventCopyWith<$Res> { - factory _$$TodayHomeEventCopyWith( - _$TodayHomeEvent value, $Res Function(_$TodayHomeEvent) then) = - __$$TodayHomeEventCopyWithImpl<$Res>; +abstract class _$$TodayHomeEventImplCopyWith<$Res> { + factory _$$TodayHomeEventImplCopyWith(_$TodayHomeEventImpl value, + $Res Function(_$TodayHomeEventImpl) then) = + __$$TodayHomeEventImplCopyWithImpl<$Res>; } /// @nodoc -class __$$TodayHomeEventCopyWithImpl<$Res> - extends _$HomeEventCopyWithImpl<$Res, _$TodayHomeEvent> - implements _$$TodayHomeEventCopyWith<$Res> { - __$$TodayHomeEventCopyWithImpl( - _$TodayHomeEvent _value, $Res Function(_$TodayHomeEvent) _then) +class __$$TodayHomeEventImplCopyWithImpl<$Res> + extends _$HomeEventCopyWithImpl<$Res, _$TodayHomeEventImpl> + implements _$$TodayHomeEventImplCopyWith<$Res> { + __$$TodayHomeEventImplCopyWithImpl( + _$TodayHomeEventImpl _value, $Res Function(_$TodayHomeEventImpl) _then) : super(_value, _then); } /// @nodoc -class _$TodayHomeEvent implements TodayHomeEvent { - _$TodayHomeEvent(); +class _$TodayHomeEventImpl implements TodayHomeEvent { + _$TodayHomeEventImpl(); @override String toString() { @@ -133,9 +133,9 @@ class _$TodayHomeEvent implements TodayHomeEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$TodayHomeEvent); + (other.runtimeType == runtimeType && other is _$TodayHomeEventImpl); } @override @@ -238,24 +238,26 @@ class _$TodayHomeEvent implements TodayHomeEvent { } abstract class TodayHomeEvent implements HomeEvent { - factory TodayHomeEvent() = _$TodayHomeEvent; + factory TodayHomeEvent() = _$TodayHomeEventImpl; } /// @nodoc -abstract class _$$SomeOtherDateHomeEventCopyWith<$Res> { - factory _$$SomeOtherDateHomeEventCopyWith(_$SomeOtherDateHomeEvent value, - $Res Function(_$SomeOtherDateHomeEvent) then) = - __$$SomeOtherDateHomeEventCopyWithImpl<$Res>; +abstract class _$$SomeOtherDateHomeEventImplCopyWith<$Res> { + factory _$$SomeOtherDateHomeEventImplCopyWith( + _$SomeOtherDateHomeEventImpl value, + $Res Function(_$SomeOtherDateHomeEventImpl) then) = + __$$SomeOtherDateHomeEventImplCopyWithImpl<$Res>; @useResult $Res call({DateTime date}); } /// @nodoc -class __$$SomeOtherDateHomeEventCopyWithImpl<$Res> - extends _$HomeEventCopyWithImpl<$Res, _$SomeOtherDateHomeEvent> - implements _$$SomeOtherDateHomeEventCopyWith<$Res> { - __$$SomeOtherDateHomeEventCopyWithImpl(_$SomeOtherDateHomeEvent _value, - $Res Function(_$SomeOtherDateHomeEvent) _then) +class __$$SomeOtherDateHomeEventImplCopyWithImpl<$Res> + extends _$HomeEventCopyWithImpl<$Res, _$SomeOtherDateHomeEventImpl> + implements _$$SomeOtherDateHomeEventImplCopyWith<$Res> { + __$$SomeOtherDateHomeEventImplCopyWithImpl( + _$SomeOtherDateHomeEventImpl _value, + $Res Function(_$SomeOtherDateHomeEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -263,7 +265,7 @@ class __$$SomeOtherDateHomeEventCopyWithImpl<$Res> $Res call({ Object? date = null, }) { - return _then(_$SomeOtherDateHomeEvent( + return _then(_$SomeOtherDateHomeEventImpl( null == date ? _value.date : date // ignore: cast_nullable_to_non_nullable @@ -274,8 +276,8 @@ class __$$SomeOtherDateHomeEventCopyWithImpl<$Res> /// @nodoc -class _$SomeOtherDateHomeEvent implements SomeOtherDateHomeEvent { - _$SomeOtherDateHomeEvent(this.date); +class _$SomeOtherDateHomeEventImpl implements SomeOtherDateHomeEvent { + _$SomeOtherDateHomeEventImpl(this.date); @override final DateTime date; @@ -286,10 +288,10 @@ class _$SomeOtherDateHomeEvent implements SomeOtherDateHomeEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SomeOtherDateHomeEvent && + other is _$SomeOtherDateHomeEventImpl && (identical(other.date, date) || other.date == date)); } @@ -299,9 +301,9 @@ class _$SomeOtherDateHomeEvent implements SomeOtherDateHomeEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$SomeOtherDateHomeEventCopyWith<_$SomeOtherDateHomeEvent> get copyWith => - __$$SomeOtherDateHomeEventCopyWithImpl<_$SomeOtherDateHomeEvent>( - this, _$identity); + _$$SomeOtherDateHomeEventImplCopyWith<_$SomeOtherDateHomeEventImpl> + get copyWith => __$$SomeOtherDateHomeEventImplCopyWithImpl< + _$SomeOtherDateHomeEventImpl>(this, _$identity); @override @optionalTypeArgs @@ -401,19 +403,20 @@ class _$SomeOtherDateHomeEvent implements SomeOtherDateHomeEvent { abstract class SomeOtherDateHomeEvent implements HomeEvent { factory SomeOtherDateHomeEvent(final DateTime date) = - _$SomeOtherDateHomeEvent; + _$SomeOtherDateHomeEventImpl; DateTime get date; @JsonKey(ignore: true) - _$$SomeOtherDateHomeEventCopyWith<_$SomeOtherDateHomeEvent> get copyWith => - throw _privateConstructorUsedError; + _$$SomeOtherDateHomeEventImplCopyWith<_$SomeOtherDateHomeEventImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$HomeUpdateNutritionEventCopyWith<$Res> { - factory _$$HomeUpdateNutritionEventCopyWith(_$HomeUpdateNutritionEvent value, - $Res Function(_$HomeUpdateNutritionEvent) then) = - __$$HomeUpdateNutritionEventCopyWithImpl<$Res>; +abstract class _$$HomeUpdateNutritionEventImplCopyWith<$Res> { + factory _$$HomeUpdateNutritionEventImplCopyWith( + _$HomeUpdateNutritionEventImpl value, + $Res Function(_$HomeUpdateNutritionEventImpl) then) = + __$$HomeUpdateNutritionEventImplCopyWithImpl<$Res>; @useResult $Res call( {double totalCarbs, @@ -423,11 +426,12 @@ abstract class _$$HomeUpdateNutritionEventCopyWith<$Res> { } /// @nodoc -class __$$HomeUpdateNutritionEventCopyWithImpl<$Res> - extends _$HomeEventCopyWithImpl<$Res, _$HomeUpdateNutritionEvent> - implements _$$HomeUpdateNutritionEventCopyWith<$Res> { - __$$HomeUpdateNutritionEventCopyWithImpl(_$HomeUpdateNutritionEvent _value, - $Res Function(_$HomeUpdateNutritionEvent) _then) +class __$$HomeUpdateNutritionEventImplCopyWithImpl<$Res> + extends _$HomeEventCopyWithImpl<$Res, _$HomeUpdateNutritionEventImpl> + implements _$$HomeUpdateNutritionEventImplCopyWith<$Res> { + __$$HomeUpdateNutritionEventImplCopyWithImpl( + _$HomeUpdateNutritionEventImpl _value, + $Res Function(_$HomeUpdateNutritionEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -438,7 +442,7 @@ class __$$HomeUpdateNutritionEventCopyWithImpl<$Res> Object? totalProtein = null, Object? totalCalories = null, }) { - return _then(_$HomeUpdateNutritionEvent( + return _then(_$HomeUpdateNutritionEventImpl( totalCarbs: null == totalCarbs ? _value.totalCarbs : totalCarbs // ignore: cast_nullable_to_non_nullable @@ -461,8 +465,8 @@ class __$$HomeUpdateNutritionEventCopyWithImpl<$Res> /// @nodoc -class _$HomeUpdateNutritionEvent implements HomeUpdateNutritionEvent { - _$HomeUpdateNutritionEvent( +class _$HomeUpdateNutritionEventImpl implements HomeUpdateNutritionEvent { + _$HomeUpdateNutritionEventImpl( {required this.totalCarbs, required this.totalFat, required this.totalProtein, @@ -483,10 +487,10 @@ class _$HomeUpdateNutritionEvent implements HomeUpdateNutritionEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$HomeUpdateNutritionEvent && + other is _$HomeUpdateNutritionEventImpl && (identical(other.totalCarbs, totalCarbs) || other.totalCarbs == totalCarbs) && (identical(other.totalFat, totalFat) || @@ -504,10 +508,9 @@ class _$HomeUpdateNutritionEvent implements HomeUpdateNutritionEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$HomeUpdateNutritionEventCopyWith<_$HomeUpdateNutritionEvent> - get copyWith => - __$$HomeUpdateNutritionEventCopyWithImpl<_$HomeUpdateNutritionEvent>( - this, _$identity); + _$$HomeUpdateNutritionEventImplCopyWith<_$HomeUpdateNutritionEventImpl> + get copyWith => __$$HomeUpdateNutritionEventImplCopyWithImpl< + _$HomeUpdateNutritionEventImpl>(this, _$identity); @override @optionalTypeArgs @@ -611,33 +614,34 @@ abstract class HomeUpdateNutritionEvent implements HomeEvent { {required final double totalCarbs, required final double totalFat, required final double totalProtein, - required final double totalCalories}) = _$HomeUpdateNutritionEvent; + required final double totalCalories}) = _$HomeUpdateNutritionEventImpl; double get totalCarbs; double get totalFat; double get totalProtein; double get totalCalories; @JsonKey(ignore: true) - _$$HomeUpdateNutritionEventCopyWith<_$HomeUpdateNutritionEvent> + _$$HomeUpdateNutritionEventImplCopyWith<_$HomeUpdateNutritionEventImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$UpdateBurnedCaloriesEventCopyWith<$Res> { - factory _$$UpdateBurnedCaloriesEventCopyWith( - _$UpdateBurnedCaloriesEvent value, - $Res Function(_$UpdateBurnedCaloriesEvent) then) = - __$$UpdateBurnedCaloriesEventCopyWithImpl<$Res>; +abstract class _$$UpdateBurnedCaloriesEventImplCopyWith<$Res> { + factory _$$UpdateBurnedCaloriesEventImplCopyWith( + _$UpdateBurnedCaloriesEventImpl value, + $Res Function(_$UpdateBurnedCaloriesEventImpl) then) = + __$$UpdateBurnedCaloriesEventImplCopyWithImpl<$Res>; @useResult $Res call({num burnedCalories}); } /// @nodoc -class __$$UpdateBurnedCaloriesEventCopyWithImpl<$Res> - extends _$HomeEventCopyWithImpl<$Res, _$UpdateBurnedCaloriesEvent> - implements _$$UpdateBurnedCaloriesEventCopyWith<$Res> { - __$$UpdateBurnedCaloriesEventCopyWithImpl(_$UpdateBurnedCaloriesEvent _value, - $Res Function(_$UpdateBurnedCaloriesEvent) _then) +class __$$UpdateBurnedCaloriesEventImplCopyWithImpl<$Res> + extends _$HomeEventCopyWithImpl<$Res, _$UpdateBurnedCaloriesEventImpl> + implements _$$UpdateBurnedCaloriesEventImplCopyWith<$Res> { + __$$UpdateBurnedCaloriesEventImplCopyWithImpl( + _$UpdateBurnedCaloriesEventImpl _value, + $Res Function(_$UpdateBurnedCaloriesEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -645,7 +649,7 @@ class __$$UpdateBurnedCaloriesEventCopyWithImpl<$Res> $Res call({ Object? burnedCalories = null, }) { - return _then(_$UpdateBurnedCaloriesEvent( + return _then(_$UpdateBurnedCaloriesEventImpl( burnedCalories: null == burnedCalories ? _value.burnedCalories : burnedCalories // ignore: cast_nullable_to_non_nullable @@ -656,8 +660,8 @@ class __$$UpdateBurnedCaloriesEventCopyWithImpl<$Res> /// @nodoc -class _$UpdateBurnedCaloriesEvent implements UpdateBurnedCaloriesEvent { - _$UpdateBurnedCaloriesEvent({required this.burnedCalories}); +class _$UpdateBurnedCaloriesEventImpl implements UpdateBurnedCaloriesEvent { + _$UpdateBurnedCaloriesEventImpl({required this.burnedCalories}); @override final num burnedCalories; @@ -668,10 +672,10 @@ class _$UpdateBurnedCaloriesEvent implements UpdateBurnedCaloriesEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$UpdateBurnedCaloriesEvent && + other is _$UpdateBurnedCaloriesEventImpl && (identical(other.burnedCalories, burnedCalories) || other.burnedCalories == burnedCalories)); } @@ -682,9 +686,9 @@ class _$UpdateBurnedCaloriesEvent implements UpdateBurnedCaloriesEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$UpdateBurnedCaloriesEventCopyWith<_$UpdateBurnedCaloriesEvent> - get copyWith => __$$UpdateBurnedCaloriesEventCopyWithImpl< - _$UpdateBurnedCaloriesEvent>(this, _$identity); + _$$UpdateBurnedCaloriesEventImplCopyWith<_$UpdateBurnedCaloriesEventImpl> + get copyWith => __$$UpdateBurnedCaloriesEventImplCopyWithImpl< + _$UpdateBurnedCaloriesEventImpl>(this, _$identity); @override @optionalTypeArgs @@ -784,19 +788,19 @@ class _$UpdateBurnedCaloriesEvent implements UpdateBurnedCaloriesEvent { abstract class UpdateBurnedCaloriesEvent implements HomeEvent { factory UpdateBurnedCaloriesEvent({required final num burnedCalories}) = - _$UpdateBurnedCaloriesEvent; + _$UpdateBurnedCaloriesEventImpl; num get burnedCalories; @JsonKey(ignore: true) - _$$UpdateBurnedCaloriesEventCopyWith<_$UpdateBurnedCaloriesEvent> + _$$UpdateBurnedCaloriesEventImplCopyWith<_$UpdateBurnedCaloriesEventImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$CopyDataEventCopyWith<$Res> { - factory _$$CopyDataEventCopyWith( - _$CopyDataEvent value, $Res Function(_$CopyDataEvent) then) = - __$$CopyDataEventCopyWithImpl<$Res>; +abstract class _$$CopyDataEventImplCopyWith<$Res> { + factory _$$CopyDataEventImplCopyWith( + _$CopyDataEventImpl value, $Res Function(_$CopyDataEventImpl) then) = + __$$CopyDataEventImplCopyWithImpl<$Res>; @useResult $Res call({FoodLog? log}); @@ -804,11 +808,11 @@ abstract class _$$CopyDataEventCopyWith<$Res> { } /// @nodoc -class __$$CopyDataEventCopyWithImpl<$Res> - extends _$HomeEventCopyWithImpl<$Res, _$CopyDataEvent> - implements _$$CopyDataEventCopyWith<$Res> { - __$$CopyDataEventCopyWithImpl( - _$CopyDataEvent _value, $Res Function(_$CopyDataEvent) _then) +class __$$CopyDataEventImplCopyWithImpl<$Res> + extends _$HomeEventCopyWithImpl<$Res, _$CopyDataEventImpl> + implements _$$CopyDataEventImplCopyWith<$Res> { + __$$CopyDataEventImplCopyWithImpl( + _$CopyDataEventImpl _value, $Res Function(_$CopyDataEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -816,7 +820,7 @@ class __$$CopyDataEventCopyWithImpl<$Res> $Res call({ Object? log = freezed, }) { - return _then(_$CopyDataEvent( + return _then(_$CopyDataEventImpl( freezed == log ? _value.log : log // ignore: cast_nullable_to_non_nullable @@ -839,8 +843,8 @@ class __$$CopyDataEventCopyWithImpl<$Res> /// @nodoc -class _$CopyDataEvent implements CopyDataEvent { - _$CopyDataEvent(this.log); +class _$CopyDataEventImpl implements CopyDataEvent { + _$CopyDataEventImpl(this.log); @override final FoodLog? log; @@ -851,10 +855,10 @@ class _$CopyDataEvent implements CopyDataEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$CopyDataEvent && + other is _$CopyDataEventImpl && (identical(other.log, log) || other.log == log)); } @@ -864,8 +868,8 @@ class _$CopyDataEvent implements CopyDataEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$CopyDataEventCopyWith<_$CopyDataEvent> get copyWith => - __$$CopyDataEventCopyWithImpl<_$CopyDataEvent>(this, _$identity); + _$$CopyDataEventImplCopyWith<_$CopyDataEventImpl> get copyWith => + __$$CopyDataEventImplCopyWithImpl<_$CopyDataEventImpl>(this, _$identity); @override @optionalTypeArgs @@ -964,29 +968,29 @@ class _$CopyDataEvent implements CopyDataEvent { } abstract class CopyDataEvent implements HomeEvent { - factory CopyDataEvent(final FoodLog? log) = _$CopyDataEvent; + factory CopyDataEvent(final FoodLog? log) = _$CopyDataEventImpl; FoodLog? get log; @JsonKey(ignore: true) - _$$CopyDataEventCopyWith<_$CopyDataEvent> get copyWith => + _$$CopyDataEventImplCopyWith<_$CopyDataEventImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$_DatesWithLogsEventCopyWith<$Res> { - factory _$$_DatesWithLogsEventCopyWith(_$_DatesWithLogsEvent value, - $Res Function(_$_DatesWithLogsEvent) then) = - __$$_DatesWithLogsEventCopyWithImpl<$Res>; +abstract class _$$DatesWithLogsEventImplCopyWith<$Res> { + factory _$$DatesWithLogsEventImplCopyWith(_$DatesWithLogsEventImpl value, + $Res Function(_$DatesWithLogsEventImpl) then) = + __$$DatesWithLogsEventImplCopyWithImpl<$Res>; @useResult $Res call({List dates}); } /// @nodoc -class __$$_DatesWithLogsEventCopyWithImpl<$Res> - extends _$HomeEventCopyWithImpl<$Res, _$_DatesWithLogsEvent> - implements _$$_DatesWithLogsEventCopyWith<$Res> { - __$$_DatesWithLogsEventCopyWithImpl( - _$_DatesWithLogsEvent _value, $Res Function(_$_DatesWithLogsEvent) _then) +class __$$DatesWithLogsEventImplCopyWithImpl<$Res> + extends _$HomeEventCopyWithImpl<$Res, _$DatesWithLogsEventImpl> + implements _$$DatesWithLogsEventImplCopyWith<$Res> { + __$$DatesWithLogsEventImplCopyWithImpl(_$DatesWithLogsEventImpl _value, + $Res Function(_$DatesWithLogsEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -994,7 +998,7 @@ class __$$_DatesWithLogsEventCopyWithImpl<$Res> $Res call({ Object? dates = null, }) { - return _then(_$_DatesWithLogsEvent( + return _then(_$DatesWithLogsEventImpl( null == dates ? _value._dates : dates // ignore: cast_nullable_to_non_nullable @@ -1005,8 +1009,8 @@ class __$$_DatesWithLogsEventCopyWithImpl<$Res> /// @nodoc -class _$_DatesWithLogsEvent implements _DatesWithLogsEvent { - _$_DatesWithLogsEvent(final List dates) : _dates = dates; +class _$DatesWithLogsEventImpl implements _DatesWithLogsEvent { + _$DatesWithLogsEventImpl(final List dates) : _dates = dates; final List _dates; @override @@ -1022,10 +1026,10 @@ class _$_DatesWithLogsEvent implements _DatesWithLogsEvent { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_DatesWithLogsEvent && + other is _$DatesWithLogsEventImpl && const DeepCollectionEquality().equals(other._dates, _dates)); } @@ -1036,8 +1040,8 @@ class _$_DatesWithLogsEvent implements _DatesWithLogsEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_DatesWithLogsEventCopyWith<_$_DatesWithLogsEvent> get copyWith => - __$$_DatesWithLogsEventCopyWithImpl<_$_DatesWithLogsEvent>( + _$$DatesWithLogsEventImplCopyWith<_$DatesWithLogsEventImpl> get copyWith => + __$$DatesWithLogsEventImplCopyWithImpl<_$DatesWithLogsEventImpl>( this, _$identity); @override @@ -1138,11 +1142,11 @@ class _$_DatesWithLogsEvent implements _DatesWithLogsEvent { abstract class _DatesWithLogsEvent implements HomeEvent { factory _DatesWithLogsEvent(final List dates) = - _$_DatesWithLogsEvent; + _$DatesWithLogsEventImpl; List get dates; @JsonKey(ignore: true) - _$$_DatesWithLogsEventCopyWith<_$_DatesWithLogsEvent> get copyWith => + _$$DatesWithLogsEventImplCopyWith<_$DatesWithLogsEventImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1255,10 +1259,11 @@ class _$HomeStateCopyWithImpl<$Res, $Val extends HomeState> } /// @nodoc -abstract class _$$_HomeStateCopyWith<$Res> implements $HomeStateCopyWith<$Res> { - factory _$$_HomeStateCopyWith( - _$_HomeState value, $Res Function(_$_HomeState) then) = - __$$_HomeStateCopyWithImpl<$Res>; +abstract class _$$HomeStateImplCopyWith<$Res> + implements $HomeStateCopyWith<$Res> { + factory _$$HomeStateImplCopyWith( + _$HomeStateImpl value, $Res Function(_$HomeStateImpl) then) = + __$$HomeStateImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -1276,11 +1281,11 @@ abstract class _$$_HomeStateCopyWith<$Res> implements $HomeStateCopyWith<$Res> { } /// @nodoc -class __$$_HomeStateCopyWithImpl<$Res> - extends _$HomeStateCopyWithImpl<$Res, _$_HomeState> - implements _$$_HomeStateCopyWith<$Res> { - __$$_HomeStateCopyWithImpl( - _$_HomeState _value, $Res Function(_$_HomeState) _then) +class __$$HomeStateImplCopyWithImpl<$Res> + extends _$HomeStateCopyWithImpl<$Res, _$HomeStateImpl> + implements _$$HomeStateImplCopyWith<$Res> { + __$$HomeStateImplCopyWithImpl( + _$HomeStateImpl _value, $Res Function(_$HomeStateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1295,7 +1300,7 @@ class __$$_HomeStateCopyWithImpl<$Res> Object? copiedData = freezed, Object? datesWithLogs = null, }) { - return _then(_$_HomeState( + return _then(_$HomeStateImpl( date: null == date ? _value.date : date // ignore: cast_nullable_to_non_nullable @@ -1334,8 +1339,8 @@ class __$$_HomeStateCopyWithImpl<$Res> /// @nodoc -class _$_HomeState implements _HomeState { - _$_HomeState( +class _$HomeStateImpl implements _HomeState { + _$HomeStateImpl( {required this.date, this.totalCalories = 0, this.totalProtein = 0, @@ -1384,10 +1389,10 @@ class _$_HomeState implements _HomeState { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_HomeState && + other is _$HomeStateImpl && (identical(other.date, date) || other.date == date) && (identical(other.totalCalories, totalCalories) || other.totalCalories == totalCalories) && @@ -1420,8 +1425,8 @@ class _$_HomeState implements _HomeState { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_HomeStateCopyWith<_$_HomeState> get copyWith => - __$$_HomeStateCopyWithImpl<_$_HomeState>(this, _$identity); + _$$HomeStateImplCopyWith<_$HomeStateImpl> get copyWith => + __$$HomeStateImplCopyWithImpl<_$HomeStateImpl>(this, _$identity); } abstract class _HomeState implements HomeState { @@ -1433,7 +1438,7 @@ abstract class _HomeState implements HomeState { final double totalFat, final num totalBurnedCalories, final FoodLog? copiedData, - final List datesWithLogs}) = _$_HomeState; + final List datesWithLogs}) = _$HomeStateImpl; @override DateTime get date; @@ -1455,6 +1460,6 @@ abstract class _HomeState implements HomeState { List get datesWithLogs; @override @JsonKey(ignore: true) - _$$_HomeStateCopyWith<_$_HomeState> get copyWith => + _$$HomeStateImplCopyWith<_$HomeStateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/ui/views/search_food_macro/bloc/search_food_macro.cubit.dart b/lib/ui/views/search_food_macro/bloc/search_food_macro.cubit.dart new file mode 100644 index 0000000..29301a3 --- /dev/null +++ b/lib/ui/views/search_food_macro/bloc/search_food_macro.cubit.dart @@ -0,0 +1,43 @@ +import 'package:calorie_tracker/core/enums/serving_type.enum.dart'; +import 'package:calorie_tracker/core/models/food/food.dart'; +import 'package:calorie_tracker/core/services/firebase/firebase_service.dart'; +import 'package:calorie_tracker/core/services/open_ai/open_ai_service.dart'; +import 'package:calorie_tracker/ui/views/search_food_macro/bloc/search_macro_state.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +class SearchMacroCubit extends Cubit { + final OpenAIService _openAIService; + final FirebaseService _firebaseService; + SearchMacroCubit({ + required OpenAIService openAIService, + required FirebaseService firebaseService, + }) : _openAIService = openAIService, + _firebaseService = firebaseService, + super(InitialSearchMacroState()); + + void search(String food, ServingType servingType) async { + emit(LoadingSearchMacroState()); + try { + final foodData = + await _openAIService.getMacros(food: food, servingType: servingType); + emit(LoadedSearchMacroState(foodData)); + } catch (e) { + print(e); + emit(ErrorSearchMacroState()); + } + } + + void clear() { + emit(InitialSearchMacroState()); + } + + void addSelectedFoodToMyList(List foods) { + foods.forEach((food) { + _firebaseService.addFood( + food.copyWith( + dateTime: DateTime.now(), + ), + ); + }); + } +} diff --git a/lib/ui/views/search_food_macro/bloc/search_macro_state.dart b/lib/ui/views/search_food_macro/bloc/search_macro_state.dart new file mode 100644 index 0000000..91d0d25 --- /dev/null +++ b/lib/ui/views/search_food_macro/bloc/search_macro_state.dart @@ -0,0 +1,16 @@ +import 'package:calorie_tracker/core/models/food/food.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'search_macro_state.freezed.dart'; + +@freezed +class SearchMacroState with _$SearchMacroState { + const factory SearchMacroState.initial() = InitialSearchMacroState; + + const factory SearchMacroState.loading() = LoadingSearchMacroState; + + const factory SearchMacroState.loaded(List foods) = + LoadedSearchMacroState; + + const factory SearchMacroState.error() = ErrorSearchMacroState; +} diff --git a/lib/ui/views/search_food_macro/bloc/search_macro_state.freezed.dart b/lib/ui/views/search_food_macro/bloc/search_macro_state.freezed.dart new file mode 100644 index 0000000..f3ca117 --- /dev/null +++ b/lib/ui/views/search_food_macro/bloc/search_macro_state.freezed.dart @@ -0,0 +1,592 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'search_macro_state.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$SearchMacroState { + @optionalTypeArgs + TResult when({ + required TResult Function() initial, + required TResult Function() loading, + required TResult Function(List foods) loaded, + required TResult Function() error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? initial, + TResult? Function()? loading, + TResult? Function(List foods)? loaded, + TResult? Function()? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? initial, + TResult Function()? loading, + TResult Function(List foods)? loaded, + TResult Function()? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(InitialSearchMacroState value) initial, + required TResult Function(LoadingSearchMacroState value) loading, + required TResult Function(LoadedSearchMacroState value) loaded, + required TResult Function(ErrorSearchMacroState value) error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(InitialSearchMacroState value)? initial, + TResult? Function(LoadingSearchMacroState value)? loading, + TResult? Function(LoadedSearchMacroState value)? loaded, + TResult? Function(ErrorSearchMacroState value)? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(InitialSearchMacroState value)? initial, + TResult Function(LoadingSearchMacroState value)? loading, + TResult Function(LoadedSearchMacroState value)? loaded, + TResult Function(ErrorSearchMacroState value)? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $SearchMacroStateCopyWith<$Res> { + factory $SearchMacroStateCopyWith( + SearchMacroState value, $Res Function(SearchMacroState) then) = + _$SearchMacroStateCopyWithImpl<$Res, SearchMacroState>; +} + +/// @nodoc +class _$SearchMacroStateCopyWithImpl<$Res, $Val extends SearchMacroState> + implements $SearchMacroStateCopyWith<$Res> { + _$SearchMacroStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$InitialSearchMacroStateImplCopyWith<$Res> { + factory _$$InitialSearchMacroStateImplCopyWith( + _$InitialSearchMacroStateImpl value, + $Res Function(_$InitialSearchMacroStateImpl) then) = + __$$InitialSearchMacroStateImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$InitialSearchMacroStateImplCopyWithImpl<$Res> + extends _$SearchMacroStateCopyWithImpl<$Res, _$InitialSearchMacroStateImpl> + implements _$$InitialSearchMacroStateImplCopyWith<$Res> { + __$$InitialSearchMacroStateImplCopyWithImpl( + _$InitialSearchMacroStateImpl _value, + $Res Function(_$InitialSearchMacroStateImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$InitialSearchMacroStateImpl implements InitialSearchMacroState { + const _$InitialSearchMacroStateImpl(); + + @override + String toString() { + return 'SearchMacroState.initial()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InitialSearchMacroStateImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() initial, + required TResult Function() loading, + required TResult Function(List foods) loaded, + required TResult Function() error, + }) { + return initial(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? initial, + TResult? Function()? loading, + TResult? Function(List foods)? loaded, + TResult? Function()? error, + }) { + return initial?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? initial, + TResult Function()? loading, + TResult Function(List foods)? loaded, + TResult Function()? error, + required TResult orElse(), + }) { + if (initial != null) { + return initial(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(InitialSearchMacroState value) initial, + required TResult Function(LoadingSearchMacroState value) loading, + required TResult Function(LoadedSearchMacroState value) loaded, + required TResult Function(ErrorSearchMacroState value) error, + }) { + return initial(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(InitialSearchMacroState value)? initial, + TResult? Function(LoadingSearchMacroState value)? loading, + TResult? Function(LoadedSearchMacroState value)? loaded, + TResult? Function(ErrorSearchMacroState value)? error, + }) { + return initial?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(InitialSearchMacroState value)? initial, + TResult Function(LoadingSearchMacroState value)? loading, + TResult Function(LoadedSearchMacroState value)? loaded, + TResult Function(ErrorSearchMacroState value)? error, + required TResult orElse(), + }) { + if (initial != null) { + return initial(this); + } + return orElse(); + } +} + +abstract class InitialSearchMacroState implements SearchMacroState { + const factory InitialSearchMacroState() = _$InitialSearchMacroStateImpl; +} + +/// @nodoc +abstract class _$$LoadingSearchMacroStateImplCopyWith<$Res> { + factory _$$LoadingSearchMacroStateImplCopyWith( + _$LoadingSearchMacroStateImpl value, + $Res Function(_$LoadingSearchMacroStateImpl) then) = + __$$LoadingSearchMacroStateImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LoadingSearchMacroStateImplCopyWithImpl<$Res> + extends _$SearchMacroStateCopyWithImpl<$Res, _$LoadingSearchMacroStateImpl> + implements _$$LoadingSearchMacroStateImplCopyWith<$Res> { + __$$LoadingSearchMacroStateImplCopyWithImpl( + _$LoadingSearchMacroStateImpl _value, + $Res Function(_$LoadingSearchMacroStateImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$LoadingSearchMacroStateImpl implements LoadingSearchMacroState { + const _$LoadingSearchMacroStateImpl(); + + @override + String toString() { + return 'SearchMacroState.loading()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LoadingSearchMacroStateImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() initial, + required TResult Function() loading, + required TResult Function(List foods) loaded, + required TResult Function() error, + }) { + return loading(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? initial, + TResult? Function()? loading, + TResult? Function(List foods)? loaded, + TResult? Function()? error, + }) { + return loading?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? initial, + TResult Function()? loading, + TResult Function(List foods)? loaded, + TResult Function()? error, + required TResult orElse(), + }) { + if (loading != null) { + return loading(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(InitialSearchMacroState value) initial, + required TResult Function(LoadingSearchMacroState value) loading, + required TResult Function(LoadedSearchMacroState value) loaded, + required TResult Function(ErrorSearchMacroState value) error, + }) { + return loading(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(InitialSearchMacroState value)? initial, + TResult? Function(LoadingSearchMacroState value)? loading, + TResult? Function(LoadedSearchMacroState value)? loaded, + TResult? Function(ErrorSearchMacroState value)? error, + }) { + return loading?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(InitialSearchMacroState value)? initial, + TResult Function(LoadingSearchMacroState value)? loading, + TResult Function(LoadedSearchMacroState value)? loaded, + TResult Function(ErrorSearchMacroState value)? error, + required TResult orElse(), + }) { + if (loading != null) { + return loading(this); + } + return orElse(); + } +} + +abstract class LoadingSearchMacroState implements SearchMacroState { + const factory LoadingSearchMacroState() = _$LoadingSearchMacroStateImpl; +} + +/// @nodoc +abstract class _$$LoadedSearchMacroStateImplCopyWith<$Res> { + factory _$$LoadedSearchMacroStateImplCopyWith( + _$LoadedSearchMacroStateImpl value, + $Res Function(_$LoadedSearchMacroStateImpl) then) = + __$$LoadedSearchMacroStateImplCopyWithImpl<$Res>; + @useResult + $Res call({List foods}); +} + +/// @nodoc +class __$$LoadedSearchMacroStateImplCopyWithImpl<$Res> + extends _$SearchMacroStateCopyWithImpl<$Res, _$LoadedSearchMacroStateImpl> + implements _$$LoadedSearchMacroStateImplCopyWith<$Res> { + __$$LoadedSearchMacroStateImplCopyWithImpl( + _$LoadedSearchMacroStateImpl _value, + $Res Function(_$LoadedSearchMacroStateImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? foods = null, + }) { + return _then(_$LoadedSearchMacroStateImpl( + null == foods + ? _value._foods + : foods // ignore: cast_nullable_to_non_nullable + as List, + )); + } +} + +/// @nodoc + +class _$LoadedSearchMacroStateImpl implements LoadedSearchMacroState { + const _$LoadedSearchMacroStateImpl(final List foods) : _foods = foods; + + final List _foods; + @override + List get foods { + if (_foods is EqualUnmodifiableListView) return _foods; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_foods); + } + + @override + String toString() { + return 'SearchMacroState.loaded(foods: $foods)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LoadedSearchMacroStateImpl && + const DeepCollectionEquality().equals(other._foods, _foods)); + } + + @override + int get hashCode => + Object.hash(runtimeType, const DeepCollectionEquality().hash(_foods)); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LoadedSearchMacroStateImplCopyWith<_$LoadedSearchMacroStateImpl> + get copyWith => __$$LoadedSearchMacroStateImplCopyWithImpl< + _$LoadedSearchMacroStateImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() initial, + required TResult Function() loading, + required TResult Function(List foods) loaded, + required TResult Function() error, + }) { + return loaded(foods); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? initial, + TResult? Function()? loading, + TResult? Function(List foods)? loaded, + TResult? Function()? error, + }) { + return loaded?.call(foods); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? initial, + TResult Function()? loading, + TResult Function(List foods)? loaded, + TResult Function()? error, + required TResult orElse(), + }) { + if (loaded != null) { + return loaded(foods); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(InitialSearchMacroState value) initial, + required TResult Function(LoadingSearchMacroState value) loading, + required TResult Function(LoadedSearchMacroState value) loaded, + required TResult Function(ErrorSearchMacroState value) error, + }) { + return loaded(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(InitialSearchMacroState value)? initial, + TResult? Function(LoadingSearchMacroState value)? loading, + TResult? Function(LoadedSearchMacroState value)? loaded, + TResult? Function(ErrorSearchMacroState value)? error, + }) { + return loaded?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(InitialSearchMacroState value)? initial, + TResult Function(LoadingSearchMacroState value)? loading, + TResult Function(LoadedSearchMacroState value)? loaded, + TResult Function(ErrorSearchMacroState value)? error, + required TResult orElse(), + }) { + if (loaded != null) { + return loaded(this); + } + return orElse(); + } +} + +abstract class LoadedSearchMacroState implements SearchMacroState { + const factory LoadedSearchMacroState(final List foods) = + _$LoadedSearchMacroStateImpl; + + List get foods; + @JsonKey(ignore: true) + _$$LoadedSearchMacroStateImplCopyWith<_$LoadedSearchMacroStateImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$ErrorSearchMacroStateImplCopyWith<$Res> { + factory _$$ErrorSearchMacroStateImplCopyWith( + _$ErrorSearchMacroStateImpl value, + $Res Function(_$ErrorSearchMacroStateImpl) then) = + __$$ErrorSearchMacroStateImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$ErrorSearchMacroStateImplCopyWithImpl<$Res> + extends _$SearchMacroStateCopyWithImpl<$Res, _$ErrorSearchMacroStateImpl> + implements _$$ErrorSearchMacroStateImplCopyWith<$Res> { + __$$ErrorSearchMacroStateImplCopyWithImpl(_$ErrorSearchMacroStateImpl _value, + $Res Function(_$ErrorSearchMacroStateImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ErrorSearchMacroStateImpl implements ErrorSearchMacroState { + const _$ErrorSearchMacroStateImpl(); + + @override + String toString() { + return 'SearchMacroState.error()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ErrorSearchMacroStateImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() initial, + required TResult Function() loading, + required TResult Function(List foods) loaded, + required TResult Function() error, + }) { + return error(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? initial, + TResult? Function()? loading, + TResult? Function(List foods)? loaded, + TResult? Function()? error, + }) { + return error?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? initial, + TResult Function()? loading, + TResult Function(List foods)? loaded, + TResult Function()? error, + required TResult orElse(), + }) { + if (error != null) { + return error(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(InitialSearchMacroState value) initial, + required TResult Function(LoadingSearchMacroState value) loading, + required TResult Function(LoadedSearchMacroState value) loaded, + required TResult Function(ErrorSearchMacroState value) error, + }) { + return error(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(InitialSearchMacroState value)? initial, + TResult? Function(LoadingSearchMacroState value)? loading, + TResult? Function(LoadedSearchMacroState value)? loaded, + TResult? Function(ErrorSearchMacroState value)? error, + }) { + return error?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(InitialSearchMacroState value)? initial, + TResult Function(LoadingSearchMacroState value)? loading, + TResult Function(LoadedSearchMacroState value)? loaded, + TResult Function(ErrorSearchMacroState value)? error, + required TResult orElse(), + }) { + if (error != null) { + return error(this); + } + return orElse(); + } +} + +abstract class ErrorSearchMacroState implements SearchMacroState { + const factory ErrorSearchMacroState() = _$ErrorSearchMacroStateImpl; +} diff --git a/lib/ui/views/search_food_macro/view/search_food_macro.view.dart b/lib/ui/views/search_food_macro/view/search_food_macro.view.dart new file mode 100644 index 0000000..17b77eb --- /dev/null +++ b/lib/ui/views/search_food_macro/view/search_food_macro.view.dart @@ -0,0 +1,449 @@ +import 'package:calorie_tracker/core/enums/serving_type.enum.dart'; +import 'package:calorie_tracker/core/models/food/food.dart'; +import 'package:calorie_tracker/ui/views/search_food_macro/bloc/search_food_macro.cubit.dart'; +import 'package:calorie_tracker/ui/views/search_food_macro/bloc/search_macro_state.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_form_bloc/flutter_form_bloc.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:wolt_modal_sheet/wolt_modal_sheet.dart'; + +class ModalSheetForSearchNutrition { + ModalSheetForSearchNutrition._(); + + static WoltModalSheetPage build( + BuildContext context, + ) { + ValueNotifier isButtonEnabledNotifier = ValueNotifier(false); + ValueNotifier servingType = + ValueNotifier(ServingType.hundreedGrams); + ValueNotifier> selectedFoods = ValueNotifier([]); + final textEditingController = TextEditingController(); + final scrollController = ScrollController(); + return WoltModalSheetPage.withSingleChild( + mainContentPadding: const EdgeInsetsDirectional.only( + top: 0, bottom: 10, start: 16, end: 16), + stickyActionBar: ValueListenableBuilder( + valueListenable: isButtonEnabledNotifier, + builder: (_, isEnabled, __) { + return Padding( + padding: const EdgeInsets.all(16.0), + child: ElevatedButton( + style: ElevatedButton.styleFrom( + fixedSize: const Size.fromHeight(60), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + elevation: 0, + ), + onPressed: isEnabled + ? () { + context.read().addSelectedFoodToMyList( + selectedFoods.value, + ); + Navigator.of(context).pop(); + } + : null, + child: Text( + isEnabled + ? "Add Selected Food to My List" + : "Select Food to Add", + ), + ), + ); + }, + ), + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + pageTitlePaddingTop: 0, + isTopBarVisibleWhenScrolled: false, + scrollController: scrollController, + // topBarTitle: Text( + // 'Search for food macro nutrients', + // style: Theme.of(context).textTheme.titleLarge?.copyWith( + // fontWeight: FontWeight.bold, + // ), + // ), + pageTitle: Column( + children: [ + Text( + 'Search for food macro nutrients', + style: Theme.of(context).textTheme.titleLarge?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 10), + TextFormField( + controller: textEditingController, + cursorColor: Colors.black, + onFieldSubmitted: (text) { + if (text.isNotEmpty) { + context.read().search( + textEditingController.text, + servingType.value, + ); + } + }, + decoration: InputDecoration( + filled: true, + fillColor: Colors.black12, + contentPadding: + const EdgeInsets.only(left: 0, bottom: 0, top: 0, right: 15), + hintText: 'Search', + border: const OutlineInputBorder( + borderSide: BorderSide( + width: 0, + style: BorderStyle.none, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + ), + prefixIcon: const IconButton( + icon: Icon(Icons.search), + onPressed: null, + ), + suffixIcon: Padding( + padding: const EdgeInsets.only(right: 5, left: 4), + child: ValueListenableBuilder( + valueListenable: servingType, + builder: (context, value, child) { + return DropdownButton( + style: Theme.of(context).textTheme.bodyMedium, + value: value, + underline: Container(), + selectedItemBuilder: (context) { + return ServingType.values + .map( + (e) => Center( + child: Text( + e.displayValue, + style: Theme.of(context) + .textTheme + .bodySmall + ?.copyWith( + fontWeight: FontWeight.w900, + ), + ), + ), + ) + .toList(); + }, + items: ServingType.values + .map( + (e) => DropdownMenuItem( + child: Text(e.displayValue), + value: e, + ), + ) + .toList(), + onChanged: (value) { + if (value != null) { + servingType.value = value; + } + }, + ); + }), + ), + ), + ), + ], + ), + closeButton: Padding( + padding: const EdgeInsets.all(5.0), + child: RawMaterialButton( + elevation: 0, + + focusElevation: 0, + highlightElevation: 0, + hoverElevation: 0, + // fillColor: fillColor, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + // highlightColor: iconColor.withOpacity(.1), + // splashColor: iconColor.withOpacity(.1), + constraints: const BoxConstraints.expand(width: 40, height: 40), + onPressed: () => Navigator.of(context).pop(), + shape: const CircleBorder(), + child: Icon( + FontAwesomeIcons.solidCircleXmark, + size: 24.0, + color: Colors.grey, + ), + ), + ), + child: BlocBuilder( + builder: (BuildContext context, value) { + return AnimatedCrossFade( + firstChild: value.maybeWhen( + initial: () { + return Center( + child: const SizedBox( + height: 450, + child: Center( + child: Icon( + FontAwesomeIcons.searchengin, + size: 100, + color: Colors.grey, + ), + ), + ), + ); + }, + loading: () { + return Center( + child: const SizedBox( + height: 450, + child: Center( + child: CircularProgressIndicator(), + ), + ), + ); + }, + error: () { + return const Center( + child: Text('Error'), + ); + }, + orElse: () => SizedBox(), + ), + secondChild: value.maybeWhen( + orElse: () => SizedBox(), + loaded: (foods) { + return SizedBox( + child: Padding( + padding: const EdgeInsets.only(bottom: 80, top: 10), + child: ListView( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + children: foods + .map( + (e) => ValueListenableBuilder( + valueListenable: selectedFoods, + builder: (context, foods, child) { + return _SingleFoodLogItem( + food: e, + onTap: () { + if (foods.contains(e)) { + foods.remove(e); + } else { + foods.add(e); + } + selectedFoods.value = foods; + isButtonEnabledNotifier.value = + foods.isNotEmpty; + }, + isSelected: + selectedFoods.value.contains(e)); + }), + ) + .toList(), + ), + ), + ); + }), + crossFadeState: value.maybeWhen( + orElse: () => CrossFadeState.showFirst, + loaded: (_) => CrossFadeState.showSecond, + ), + duration: const Duration(milliseconds: 300), + ); + }), + ); + } +} + +class _SingleFoodLogItem extends HookWidget { + const _SingleFoodLogItem({ + required this.food, + required this.onTap, + this.isSelected = false, + }); + final Food food; + final Function() onTap; + final bool isSelected; + + @override + Widget build(BuildContext context) { + final isExpanded = useState(false); + print(isSelected); + return Container( + margin: const EdgeInsets.symmetric(vertical: 5), + height: isExpanded.value ? 130 : null, + decoration: BoxDecoration( + border: Border.all( + color: isSelected + ? Theme.of(context).primaryColor + : Theme.of(context).dividerColor, + width: isSelected ? 2 : 1, + ), + borderRadius: BorderRadius.circular(10), + ), + width: double.infinity, + child: Material( + color: Colors.transparent, + child: InkWell( + radius: 10, + borderRadius: BorderRadius.circular(10), + onTap: onTap, + child: Column( + children: [ + Row( + children: [ + Expanded( + child: AnimatedPadding( + duration: const Duration(milliseconds: 300), + padding: EdgeInsets.only( + top: 12, + left: 12, + bottom: 12, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + food.name, + style: Theme.of(context) + .textTheme + .titleLarge + ?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + ), + Padding( + padding: const EdgeInsets.only(right: 12), + child: Row( + children: [ + Text( + '${food.nutrition.calories} Cal', + // textAlign: TextAlign.right, + style: + Theme.of(context).textTheme.titleLarge?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + const SizedBox( + width: 5, + ), + InkWell( + radius: 50, + borderRadius: BorderRadius.circular(50), + onTap: () { + isExpanded.value = !isExpanded.value; + }, + child: Icon( + isExpanded.value + ? FontAwesomeIcons.circleChevronUp + : FontAwesomeIcons.circleChevronDown, + size: 20, + color: Theme.of(context) + .primaryColorDark + .withOpacity(0.5), + ), + ) + ], + ), + ), + ], + ), + AnimatedCrossFade( + duration: const Duration(milliseconds: 50), + crossFadeState: (isExpanded.value) + ? CrossFadeState.showSecond + : CrossFadeState.showFirst, + firstChild: Container(), + secondChild: Padding( + padding: const EdgeInsets.only(left: 12, bottom: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + 'Protein : '.toUpperCase(), + style: Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + Text( + '${food.nutrition.protein} g', + style: Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + ], + ), + const SizedBox( + height: 2, + ), + Row( + children: [ + Text( + 'Carbs : '.toUpperCase(), + style: Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + Text( + '${food.nutrition.carbs} g', + style: Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + ], + ), + const SizedBox( + height: 2, + ), + Row( + children: [ + Text( + 'Fat : '.toUpperCase(), + style: Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + Text( + '${food.nutrition.fat} g', + style: Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 933c4b0..1726ea5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "405666cd3cf0ee0a48d21ec67e65406aad2c726d9fa58840d3375e7bdcd32a07" + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a url: "https://pub.dev" source: hosted - version: "60.0.0" + version: "61.0.0" _flutterfire_internals: dependency: transitive description: name: _flutterfire_internals - sha256: "9ebe81588e666f7e2b21309f2b5653bd9642d7f27fd0a6894278d2ff40cb9481" + sha256: f5628cd9c92ed11083f425fd1f8f1bc60ecdda458c81d73b143aeda036c35fe7 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.16" adaptive_dialog: dependency: "direct main" description: @@ -29,34 +29,34 @@ packages: dependency: "direct main" description: name: ai_barcode_scanner - sha256: d6218413bfbe4d5bc6bf3da91afde6d2ebeac2d9fe8273a006d609cc4b48893e + sha256: e77a90d9a953ba8d797cf4ff9f705c1842133fffd596f7ccc845dd08650e0543 url: "https://pub.dev" source: hosted - version: "0.0.6" + version: "0.0.7" analyzer: dependency: transitive description: name: analyzer - sha256: "1952250bd005bacb895a01bf1b4dc00e3ba1c526cf47dca54dfe24979c65f5b3" + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 url: "https://pub.dev" source: hosted - version: "5.12.0" + version: "5.13.0" animations: dependency: transitive description: name: animations - sha256: fe8a6bdca435f718bb1dc8a11661b2c22504c6da40ef934cee8327ed77934164 + sha256: ef57563eed3620bd5d75ad96189846aca1e033c0c45fc9a7d26e80ab02b88a70 url: "https://pub.dev" source: hosted - version: "2.0.7" + version: "2.0.8" args: dependency: transitive description: name: args - sha256: "4cab82a83ffef80b262ddedf47a0a8e56ee6fbf7fe21e6e768b02792034dd440" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.2" async: dependency: transitive description: @@ -69,26 +69,26 @@ packages: dependency: "direct main" description: name: auto_size_text_field - sha256: "8967129167193fefbb7a8707ade1bb71f9e52b9a5cf6da0132b7f6b7946c5a3f" + sha256: c4ba8714ba4216ca122acac1573581dac499f3162c9218a28b573dca73721b3f url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.3" bloc: - dependency: "direct main" + dependency: transitive description: name: bloc - sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + sha256: f53a110e3b48dcd78136c10daa5d51512443cea5e1348c9d80a320095fa2db9e url: "https://pub.dev" source: hosted - version: "8.1.2" + version: "8.1.3" bloc_test: dependency: "direct dev" description: name: bloc_test - sha256: "43d5b2f3d09ba768d6b611151bdf20ca141ffb46e795eb9550a58c9c2f4eae3f" + sha256: "55a48f69e0d480717067c5377c8485a3fcd41f1701a820deef72fa0f4ee7215f" url: "https://pub.dev" source: hosted - version: "9.1.3" + version: "9.1.6" boolean_selector: dependency: transitive description: @@ -101,10 +101,10 @@ packages: dependency: transitive description: name: build - sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777" + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.4.1" build_config: dependency: transitive description: @@ -117,34 +117,34 @@ packages: dependency: transitive description: name: build_daemon - sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" + sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: db49b8609ef8c81cca2b310618c3017c00f03a92af44c04d310b907b2d692d95 + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.2" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "5e1929ad37d48bd382b124266cb8e521de5548d406a45a5ae6656c13dab73e37" + sha256: "581bacf68f89ec8792f5e5a0b2c4decd1c948e97ce659dc783688c8a88fbec21" url: "https://pub.dev" source: hosted - version: "2.4.5" + version: "2.4.8" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "14febe0f5bac5ae474117a36099b4de6f1dbc52df6c5e55534b3da9591bf4292" + sha256: "4ae8ffe5ac758da294ecf1802f2aff01558d8b1b00616aa7538ea9a8a5d50799" url: "https://pub.dev" source: hosted - version: "7.2.7" + version: "7.3.0" built_collection: dependency: transitive description: @@ -157,10 +157,10 @@ packages: dependency: transitive description: name: built_value - sha256: "31b7c748fd4b9adf8d25d72a4c4a59ef119f12876cf414f94f8af5131d5fa2b0" + sha256: fedde275e0a6b798c3296963c5cd224e3e1b55d0e478d5b7e65e6b540f363a0e url: "https://pub.dev" source: hosted - version: "8.4.4" + version: "8.9.1" characters: dependency: transitive description: @@ -173,10 +173,10 @@ packages: dependency: transitive description: name: checked_yaml - sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" clock: dependency: transitive description: @@ -189,42 +189,42 @@ packages: dependency: "direct main" description: name: cloud_firestore - sha256: "095a8c0e67da96610b6f4e6da7ac5853bc86d7664409ab71d7b934469ca99c6f" + sha256: "8bfbb5a2edbc6052452326d60de0113fea2bcbf081d34a3f8e45c8b38307b31c" url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "4.14.0" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface - sha256: dd5d1c3ed9a09e620ac59351f20fa635e112101bdc6f90e84b29c5a19fa1bf59 + sha256: "73ff438fe46028f0e19f55da18b6ddc6906ab750562cd7d9ffab77ff8c0c4307" url: "https://pub.dev" source: hosted - version: "5.15.0" + version: "6.1.0" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web - sha256: "51f22dfbe07638075287e171b469ef545bee9f5fa0f8d0ed4aa98aceb0259a5d" + sha256: "232e45e95970d3a6baab8f50f9c3a6e2838d145d9d91ec9a7392837c44296397" url: "https://pub.dev" source: hosted - version: "3.6.0" + version: "3.9.0" code_builder: dependency: transitive description: name: code_builder - sha256: "0d43dd1288fd145de1ecc9a3948ad4a6d5a82f0a14c4fdd0892260787d975cbe" + sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 url: "https://pub.dev" source: hosted - version: "4.4.0" + version: "4.10.0" collection: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" color: dependency: transitive description: @@ -245,42 +245,50 @@ packages: dependency: transitive description: name: coverage - sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" + sha256: "595a29b55ce82d53398e1bcc2cba525d7bd7c59faeb2d2540e9d42c390cfeeeb" url: "https://pub.dev" source: hosted - version: "1.6.3" + version: "1.6.4" crypto: dependency: transitive description: name: crypto - sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.0.6" custom_radio_grouped_button: dependency: "direct main" description: name: custom_radio_grouped_button - sha256: efed73fc128ee76d19553861a56ab784dcee91910deba1d6c0c124535ab0c4dd + sha256: b07bd6dec2c1c5d64776a354eb2c01c67a77e4a5700098ae6fbde18cc94ad33d url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.2.1" + dart_openai: + dependency: "direct main" + description: + name: dart_openai + sha256: "853bb57fed6a71c3ba0324af5cb40c16d196cf3aa55b91d244964ae4a241ccf1" + url: "https://pub.dev" + source: hosted + version: "5.1.0" dart_style: dependency: transitive description: name: dart_style - sha256: "6d691edde054969f0e0f26abb1b30834b5138b963793e56f69d3a9a4435e6352" + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.2" dartx: dependency: transitive description: @@ -293,10 +301,10 @@ packages: dependency: transitive description: name: device_info_plus - sha256: "9b1a0c32b2a503f8fe9f8764fac7b5fcd4f6bd35d8f49de5350bccf9e2a33b8a" + sha256: "77f757b789ff68e4eaf9c56d1752309bd9f7ad557cb105b938a7f8eb89e59110" url: "https://pub.dev" source: hosted - version: "9.0.0" + version: "9.1.2" device_info_plus_platform_interface: dependency: transitive description: @@ -324,10 +332,10 @@ packages: dependency: transitive description: name: dynamic_color - sha256: c4a508284b14ec4dda5adba2c28b2cdd34fbae1afead7e8c52cad87d51c5405b + sha256: eae98052fa6e2826bdac3dd2e921c6ce2903be15c6b7f8b6d8a5d49b5086298d url: "https://pub.dev" source: hosted - version: "1.6.2" + version: "1.7.0" equatable: dependency: transitive description: @@ -344,70 +352,86 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + fetch_api: + dependency: transitive + description: + name: fetch_api + sha256: "74a1e426d41ed9c89353703b2d80400c5d0ecfa144b2d8a7bd8882fbc9e48787" + url: "https://pub.dev" + source: hosted + version: "1.0.3" + fetch_client: + dependency: transitive + description: + name: fetch_client + sha256: "83c07b07a63526a43630572c72715707ca113a8aa3459efbc7b2d366b79402af" + url: "https://pub.dev" + source: hosted + version: "1.0.2" ffi: dependency: transitive description: name: ffi - sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.0" file: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.0" firebase_auth: dependency: "direct main" description: name: firebase_auth - sha256: "19508428ca37f611ae47067ee6ebb3ba5a27014941177cc224f71bf7d0720cdd" + sha256: "279b2773ff61afd9763202cb5582e2b995ee57419d826b9af6517302a59b672f" url: "https://pub.dev" source: hosted - version: "4.6.2" + version: "4.16.0" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface - sha256: e46e136a6f6eec88b30f12445ff7f5b19b23b7ede694921ced4f8eba8eb634f6 + sha256: "3c9cfaccb7549492edf5b0c67c6dd1c6727c7830891aa6727f2fb225f0226626" url: "https://pub.dev" source: hosted - version: "6.15.2" + version: "7.0.9" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: "553bd576d793d05b920971a2c7ab02bd049d4971153702074ea2555877efd392" + sha256: c7b1379ccef7abf4b6816eede67a868c44142198e42350f51c01d8fc03f95a7d url: "https://pub.dev" source: hosted - version: "5.5.2" + version: "5.8.13" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: e9b36b391690cf329c6fb1de220045e97c13784c303820cd33962319580a56c6 + sha256: "96607c0e829a581c2a483c658f04e8b159964c3bae2730f73297070bc85d40bb" url: "https://pub.dev" source: hosted - version: "2.13.1" + version: "2.24.2" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + sha256: c437ae5d17e6b5cc7981cf6fd458a5db4d12979905f9aafd1fea930428a9fe63 url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "5.0.0" firebase_core_web: dependency: transitive description: name: firebase_core_web - sha256: "8c0f4c87d20e2d001a5915df238c1f9c88704231f591324205f5a5d2a7740a45" + sha256: d585bdf3c656c3f7821ba1bd44da5f13365d22fcecaf5eb75c4295246aaa83c0 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.10.0" fixnum: dependency: transitive description: @@ -425,10 +449,10 @@ packages: dependency: "direct main" description: name: flutter_bloc - sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + sha256: "87325da1ac757fcc4813e6b34ed5dd61169973871fdf181d6c2109dd6935ece1" url: "https://pub.dev" source: hosted - version: "8.1.3" + version: "8.1.4" flutter_form_bloc: dependency: "direct main" description: @@ -441,34 +465,34 @@ packages: dependency: transitive description: name: flutter_gen_core - sha256: e8637dd6a59860f89e5e71be0a27101ec32dad1a0ed7fd879fd23b6e91d5004d + sha256: "3a6c3dbc1c0e260088e9c7ed1ba905436844e8c01a44799f6281edada9e45308" url: "https://pub.dev" source: hosted - version: "5.3.1" + version: "5.4.0" flutter_gen_runner: dependency: "direct dev" description: name: flutter_gen_runner - sha256: "7de1bf4fc0439be0fef3178b6423d5c7f1f9f3a38a7c6fafe75d7f70ff4856d7" + sha256: "24889d5140b03997f7148066a9c5fab8b606dff36093434c782d7a7fb22c6fb6" url: "https://pub.dev" source: hosted - version: "5.3.1" + version: "5.4.0" flutter_hooks: dependency: "direct main" description: name: flutter_hooks - sha256: "6a126f703b89499818d73305e4ce1e3de33b4ae1c5512e3b8eab4b986f46774c" + sha256: cde36b12f7188c85286fba9b38cc5a902e7279f36dd676967106c041dc9dde70 url: "https://pub.dev" source: hosted - version: "0.18.6" + version: "0.20.5" flutter_keyboard_visibility: dependency: transitive description: name: flutter_keyboard_visibility - sha256: "86b71bbaffa38e885f5c21b1182408b9be6951fd125432cf6652c636254cef2d" + sha256: "4983655c26ab5b959252ee204c2fffa4afeb4413cd030455194ec0caa3b8e7cb" url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "5.4.1" flutter_keyboard_visibility_linux: dependency: transitive description: @@ -536,10 +560,10 @@ packages: dependency: "direct main" description: name: font_awesome_flutter - sha256: "959ef4add147753f990b4a7c6cccb746d5792dbdc81b1cde99e62e7edb31b206" + sha256: "275ff26905134bcb59417cf60ad979136f1f8257f2f449914b2c3e05bbb4cd6f" url: "https://pub.dev" source: hosted - version: "10.4.0" + version: "10.7.0" form_bloc: dependency: transitive description: @@ -552,18 +576,18 @@ packages: dependency: "direct dev" description: name: freezed - sha256: a9520490532087cf38bf3f7de478ab6ebeb5f68bb1eb2641546d92719b224445 + sha256: "57247f692f35f068cae297549a46a9a097100685c6780fe67177503eea5ed4e5" url: "https://pub.dev" source: hosted - version: "2.3.5" + version: "2.4.7" freezed_annotation: dependency: "direct main" description: name: freezed_annotation - sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + sha256: c3fd9336eb55a38cc1bbd79ab17573113a8deccd0ecbbf926cca3c62803b5c2d url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.1" frontend_server_client: dependency: transitive description: @@ -576,66 +600,66 @@ packages: dependency: transitive description: name: glob - sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" google_identity_services_web: dependency: transitive description: name: google_identity_services_web - sha256: "7940fdc3b1035db4d65d387c1bdd6f9574deaa6777411569c05ecc25672efacd" + sha256: "000b7a31e1fa17ee04b6c0553a2b2ea18f9f9352e4dcc0c9fcc785cf10f2484e" url: "https://pub.dev" source: hosted - version: "0.2.1" + version: "0.2.2" google_sign_in: dependency: "direct main" description: name: google_sign_in - sha256: aab6fdc41374014494f9e9026b9859e7309639d50a0bf4a2a412467a5ae4abc6 + sha256: "8f8b94880f2753ccb796744259da529674e49b9af2e372abf6978c590c0ebfef" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "6.1.6" google_sign_in_android: dependency: transitive description: name: google_sign_in_android - sha256: "6a740e8498920ecf5fc2849ae0e4412536d700230bc3169493a1d031fdfe1cca" + sha256: bfd42c81c30c6faba16e0f62968d5505a87504aaa672b3155ee931461abb0a49 url: "https://pub.dev" source: hosted - version: "6.1.8" + version: "6.1.21" google_sign_in_ios: dependency: transitive description: name: google_sign_in_ios - sha256: "2e1df687b17f7fddcaf9a0c7f994d0d19b5d41e8ce1d943013befd0a0ae67403" + sha256: "81495441405c138e3c638f5097bebaa0db644567b3976e08944cfb8926ff2e6d" url: "https://pub.dev" source: hosted - version: "5.6.1" + version: "5.6.5" google_sign_in_platform_interface: dependency: transitive description: name: google_sign_in_platform_interface - sha256: "95a9e0a8701b5485f2ca330fd1fc6f918f5ce088042ce1019c5e389d8574ae4c" + sha256: "1f6e5787d7a120cc0359ddf315c92309069171306242e181c09472d1b00a2971" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.5" google_sign_in_web: dependency: transitive description: name: google_sign_in_web - sha256: "7e0ec507f4752383a6daa67d0cc775253cfc3b1d87907e7004e2c1b99c0a723f" + sha256: "794f5494a945d6dd2654c52f979594ecd2558e5c82ce8272295ba371c93015e6" url: "https://pub.dev" source: hosted - version: "0.12.0" + version: "0.12.2+1" graphs: dependency: transitive description: name: graphs - sha256: f9e130f3259f52d26f0cfc0e964513796dafed572fa52e45d2f8d6ca14db39b2 + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.3.1" health: dependency: "direct main" description: @@ -647,10 +671,10 @@ packages: dependency: transitive description: name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" url: "https://pub.dev" source: hosted - version: "0.13.6" + version: "1.1.0" http_multi_server: dependency: transitive description: @@ -711,26 +735,26 @@ packages: dependency: transitive description: name: json_class - sha256: c40fa382860f472e79b18f603e9fe1159c7ed3bfc6998a4bbd331825b42ae17a + sha256: fa872148b86bd2b706617e26ed80eeee292c31071b49cc728b368dd9b1fd0959 url: "https://pub.dev" source: hosted - version: "2.2.1+3" + version: "2.2.2+1" json_schema2: dependency: transitive description: name: json_schema2 - sha256: "17d6f79f343b654f7e0b7e999ca8284e537e618769825f4466b6087e302a33e7" + sha256: "094e60d3605333c0816eeb2e5310b4f71ffaea2c0abc026b27418c1ac41a5db3" url: "https://pub.dev" source: hosted - version: "2.0.4+4" + version: "2.0.4+9" json_serializable: dependency: "direct dev" description: name: json_serializable - sha256: "61a60716544392a82726dd0fa1dd6f5f1fd32aec66422b6e229e7b90d52325c4" + sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969 url: "https://pub.dev" source: hosted - version: "6.7.0" + version: "6.7.1" json_theme: dependency: "direct main" description: @@ -743,26 +767,26 @@ packages: dependency: transitive description: name: logging - sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -783,10 +807,10 @@ packages: dependency: transitive description: name: mobile_scanner - sha256: da55204e5439bc8dc058df56231a7a1d513c6ec9cbad84492f56d493382d296f + sha256: "1b60b8f9d4ce0cb0e7d7bc223c955d083a0737bee66fa1fcfe5de48225e0d5b3" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.5.7" mocktail: dependency: "direct dev" description: @@ -816,10 +840,10 @@ packages: description: path: "." ref: product-status-enum - resolved-ref: fd5860565990124b10acbc4aefc5060d6de7e65c + resolved-ref: "8d151b3a3b4ecd39d39f62583d14f2890052dc88" url: "https://github.com/ketanchoyal/openfoodfacts-dart.git" source: git - version: "1.0.0" + version: "3.4.0" package_config: dependency: transitive description: @@ -844,14 +868,22 @@ packages: url: "https://pub.dev" source: hosted version: "5.4.0" + pigeon: + dependency: transitive + description: + name: pigeon + sha256: "5a79fd0b10423f6b5705525e32015597f861c31220b522a67d1e6b580da96719" + url: "https://pub.dev" + source: hosted + version: "11.0.1" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.8" pool: dependency: transitive description: @@ -864,26 +896,26 @@ packages: dependency: transitive description: name: provider - sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c url: "https://pub.dev" source: hosted - version: "6.0.5" + version: "6.1.2" pub_semver: dependency: transitive description: name: pub_semver - sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" pubspec_parse: dependency: transitive description: name: pubspec_parse - sha256: ec85d7d55339d85f44ec2b682a82fea340071e8978257e5a43e69f79e98ef50c + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.2.3" quiver: dependency: transitive description: @@ -896,10 +928,10 @@ packages: dependency: transitive description: name: rest_client - sha256: f788d489471b3c18641cc7ae32cde76ca9806075dda8b98e36bc479f118e6585 + sha256: ff26b0dd3b0dac951014ce1ea0da450290cb80a4bfee905a43285fd34cb3aa65 url: "https://pub.dev" source: hosted - version: "2.2.1+11" + version: "2.2.3+2" rxdart: dependency: transitive description: @@ -912,34 +944,34 @@ packages: dependency: transitive description: name: shelf - sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - sha256: aef74dc9195746a384843102142ab65b6a4735bb3beea791e63527b88cc83306 + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" shelf_static: dependency: transitive description: name: shelf_static - sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" sky_engine: dependency: transitive description: flutter @@ -949,18 +981,18 @@ packages: dependency: transitive description: name: source_gen - sha256: "373f96cf5a8744bc9816c1ff41cf5391bbdbe3d7a96fe98c622b6738a8a7bd33" + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.5.0" source_helper: dependency: transitive description: name: source_helper - sha256: "3b67aade1d52416149c633ba1bb36df44d97c6b51830c2198e934e3fca87ca1f" + sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" url: "https://pub.dev" source: hosted - version: "1.3.3" + version: "1.3.4" source_map_stack_trace: dependency: transitive description: @@ -981,10 +1013,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -1021,10 +1053,10 @@ packages: dependency: "direct main" description: name: swipeable_tile - sha256: "0a59b847cd3132cbe0da6ffd3951e570968cc68a957f9d290dfcddabda946172" + sha256: "6312b59b14c5ff22bf91aafa64d7e74df5f2322cb206db4c34d9d9946e3e44d4" url: "https://pub.dev" source: hosted - version: "2.0.0+3" + version: "2.0.1" term_glyph: dependency: transitive description: @@ -1037,34 +1069,34 @@ packages: dependency: transitive description: name: test - sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4" + sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" url: "https://pub.dev" source: hosted - version: "1.24.1" + version: "1.24.3" test_api: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" test_core: dependency: transitive description: name: test_core - sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93" + sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.5.3" time: dependency: transitive description: name: time - sha256: "83427e11d9072e038364a5e4da559e85869b227cf699a541be0da74f14140124" + sha256: ad8e018a6c9db36cb917a031853a1aae49467a93e0d464683e029537d848c221 url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" timing: dependency: transitive description: @@ -1077,10 +1109,10 @@ packages: dependency: transitive description: name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" uri: dependency: transitive description: @@ -1109,58 +1141,66 @@ packages: dependency: "direct dev" description: name: very_good_analysis - sha256: "5e4ea72d2a9188630f0dd8f120a541de730090ef8863243fedca8267a84508b8" + sha256: "9ae7f3a3bd5764fb021b335ca28a34f040cd0ab6eec00a1b213b445dae58a4b8" url: "https://pub.dev" source: hosted - version: "5.0.0+1" + version: "5.1.0" vm_service: dependency: transitive description: name: vm_service - sha256: e7fb6c2282f7631712b69c19d1bff82f3767eea33a2321c14fa59ad67ea391c7 + sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 url: "https://pub.dev" source: hosted - version: "9.4.0" + version: "11.10.0" watcher: dependency: transitive description: name: watcher - sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.0" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol - sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" win32: dependency: transitive description: name: win32 - sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c" + sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574 url: "https://pub.dev" source: hosted - version: "4.1.4" + version: "5.1.1" win32_registry: dependency: transitive description: name: win32_registry - sha256: "1c52f994bdccb77103a6231ad4ea331a244dbcef5d1f37d8462f713143b0bfae" + sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.2" wolt_modal_sheet: dependency: "direct main" description: @@ -1181,18 +1221,18 @@ packages: dependency: transitive description: name: yaml - sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" yaon: dependency: transitive description: name: yaon - sha256: "6160b1610af95ca3ff7d1e4814dcb1e8df2d12551ce05a4ca70d8a567ffd0de8" + sha256: "9baabf121604d7530fc8bcd4f2aeb6c300a055d9a6f9b45b5071f893756ca867" url: "https://pub.dev" source: hosted - version: "1.1.0+3" + version: "1.1.4+4" sdks: - dart: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + dart: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" diff --git a/pubspec.yaml b/pubspec.yaml index 8a885e9..f86dee2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,10 +7,10 @@ environment: sdk: ">=3.0.0" dependencies: - bloc: ^8.1.2 + # bloc: ^8.1.2 flutter: sdk: flutter - flutter_bloc: ^8.1.3 + flutter_bloc: ^8.1.4 flutter_localizations: sdk: flutter intl: ^0.18.1 @@ -22,22 +22,23 @@ dependencies: git: url: https://github.com/ketanchoyal/openfoodfacts-dart.git ref: product-status-enum - json_theme: ^4.0.0 + dart_openai: ^5.1.0 + json_theme: ^4.0.3 font_awesome_flutter: ^10.4.0 cupertino_icons: ^1.0.5 ai_barcode_scanner: ^0.0.6 flutter_form_bloc: ^0.30.1 - freezed_annotation: ^2.2.0 + freezed_annotation: ^2.4.1 json_annotation: ^4.8.1 flutter_settings_ui: ^2.0.1 - flutter_hooks: ^0.18.6 + flutter_hooks: ^0.20.5 swipeable_tile: ^2.0.0+3 adaptive_dialog: 1.9.0-no-macos.2 wolt_modal_sheet: ^0.0.4 auto_size_text_field: ^2.2.1 health: path: packages/health - custom_radio_grouped_button: ^2.2.0 + custom_radio_grouped_button: ^2.2.1 drop_down_list: path: packages/drop_down_list @@ -45,14 +46,14 @@ dependency_overrides: intl: ^0.18.1 dev_dependencies: - bloc_test: ^9.1.3 + bloc_test: ^9.1.6 flutter_test: sdk: flutter mocktail: ^0.3.0 - very_good_analysis: ^5.0.0+1 - freezed: ^2.3.5 - build_runner: ^2.4.5 - flutter_gen_runner: + very_good_analysis: ^5.1.0 + freezed: ^2.4.7 + build_runner: ^2.4.8 + flutter_gen_runner: 5.4.0 json_serializable: ^6.7.0 flutter: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 29d0b2a..269767b 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,12 +6,18 @@ #include "generated_plugin_registrant.h" +#include #include +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + CloudFirestorePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("CloudFirestorePluginCApi")); DynamicColorPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("DynamicColorPluginCApi")); + FirebaseAuthPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); FirebaseCorePluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 906607c..03dfff6 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,7 +3,9 @@ # list(APPEND FLUTTER_PLUGIN_LIST + cloud_firestore dynamic_color + firebase_auth firebase_core )