diff --git a/assets/icons/add_step_photo.svg b/assets/icons/add_step_photo.svg
new file mode 100644
index 00000000..2967b460
--- /dev/null
+++ b/assets/icons/add_step_photo.svg
@@ -0,0 +1,10 @@
+
diff --git a/assets/icons/upload_photo_of_portion.svg b/assets/icons/upload_photo_of_portion.svg
new file mode 100644
index 00000000..3149160f
--- /dev/null
+++ b/assets/icons/upload_photo_of_portion.svg
@@ -0,0 +1,10 @@
+
diff --git a/lib/core/app_router.dart b/lib/core/app_router.dart
index b41077d8..137613c4 100644
--- a/lib/core/app_router.dart
+++ b/lib/core/app_router.dart
@@ -31,7 +31,6 @@ import 'package:eatvio_app/features/profile/presentation/pages/profile_screen.da
import 'package:eatvio_app/features/profile/presentation/pages/subs_screen.dart';
import 'package:eatvio_app/features/recipes/presentation/pages/about_recipes_screen.dart';
import 'package:eatvio_app/features/recipes/presentation/pages/recipe_create_screen.dart';
-import 'package:eatvio_app/features/recipes/presentation/pages/recipe_edit_screen.dart';
import 'package:eatvio_app/features/registration/presentation/pages/registration_screen.dart';
import 'package:eatvio_app/features/settings/entities/settings_entity.dart';
import 'package:eatvio_app/features/settings/presentation/pages/change_email_screen.dart';
@@ -135,13 +134,6 @@ class AppRouter {
name: 'recipeCreateScreen',
builder: (context, state) => RecipeCreateScreen(),
),
- GoRoute(
- path: '/recipe-edit-screen',
- name: 'recipeEditScreen',
- builder: (context, state) => RecipeEditScreen(
- recipeID: state.extra as String,
- ),
- ),
GoRoute(
path: '/profile-screen',
name: 'profileScreen',
diff --git a/lib/core/const.dart b/lib/core/const.dart
index 273ac73d..24e72cdd 100644
--- a/lib/core/const.dart
+++ b/lib/core/const.dart
@@ -1,4 +1,4 @@
-const String baseUrl = 'https://dev2.eatvio.com';
+String baseUrl = 'https://dev2.eatvio.com';
const List durationValues = [7, 14, 21];
diff --git a/lib/core/locator_service.dart b/lib/core/locator_service.dart
index 4a6bc28a..5fa33479 100644
--- a/lib/core/locator_service.dart
+++ b/lib/core/locator_service.dart
@@ -52,7 +52,7 @@ import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/prof
import 'package:eatvio_app/features/profile/presentation/bloc/sub_cubit/sub_cubit.dart';
import 'package:eatvio_app/features/profile/repositories/profile_repository.dart';
import 'package:eatvio_app/features/profile/services/profile_service.dart';
-import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_cubit.dart';
+import 'package:eatvio_app/features/recipes/presentation/bloc/create_recipe_cubit/create_recipe_cubit.dart';
import 'package:eatvio_app/features/recipes/reporitories/recipe_repository.dart';
import 'package:eatvio_app/features/recipes/services/recipe_service.dart';
import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart';
@@ -81,7 +81,6 @@ Future init() async {
sl.registerFactory(() => CalendarCubit(calendarRepository: sl()));
sl.registerFactory(() => ProfileCubit(profileRepository: sl(), chatRepository: sl()));
sl.registerFactory(() => profilePlans.PlansCubit(plansRepository: sl()));
- sl.registerFactory(() => RecipeCreateCubit(recipeRepository: sl()));
sl.registerFactory(() => DietsCubit(feedRepository: sl(), dietsRepository: sl()));
sl.registerFactory(() => CommentsCubit(feedRepository: sl()));
sl.registerFactory(() => ChatSelectCubit(chatRepository: sl()));
@@ -96,6 +95,7 @@ Future init() async {
sl.registerFactory(() => CreatePlanCubit());
sl.registerFactory(() => FeedProfileCubit(profileRepository: sl()));
sl.registerFactory(() => AboutPlanCubit(planRepository: sl()));
+ sl.registerFactory(() => CreateRecipeCubit());
sl.registerFactory(() => MyDietsCubit(myDietsRepository: sl()));
sl.registerFactory(() => MyPlansCubit(myPlansRepository: sl()));
diff --git a/lib/core/widgets/custom_drop_down.dart b/lib/core/widgets/custom_drop_down.dart
index 887f4597..10edb929 100644
--- a/lib/core/widgets/custom_drop_down.dart
+++ b/lib/core/widgets/custom_drop_down.dart
@@ -64,11 +64,6 @@ class CustomDropDown extends StatelessWidget {
value: value,
isDense: true,
isExpanded: true,
- style: TextStyle(
- fontSize: 16,
- color: Colors.black,
- fontWeight: FontWeight.w400,
- ),
items: items?.map((SelectionPopupModel item) {
return DropdownMenuItem(
value: item,
diff --git a/lib/core/widgets/custom_text_form_field.dart b/lib/core/widgets/custom_text_form_field.dart
index f343e996..653600b3 100644
--- a/lib/core/widgets/custom_text_form_field.dart
+++ b/lib/core/widgets/custom_text_form_field.dart
@@ -38,10 +38,12 @@ class CustomTextFormField extends StatelessWidget {
this.expands = false,
this.textAlignVertical,
this.counter = const SizedBox.shrink(),
+ this.enabled = true,
super.key,
this.hasError = false,
this.readOnly = false,
});
+
final Widget? counter;
final Alignment? alignment;
final double? width;
@@ -77,12 +79,15 @@ class CustomTextFormField extends StatelessWidget {
final bool expands;
final TextAlignVertical? textAlignVertical;
final bool hasError;
+ final bool enabled;
+
final bool readOnly;
@override
Widget build(BuildContext context) {
return Align(
alignment: alignment ?? Alignment.center,
child: TextFormField(
+ enabled: enabled,
readOnly: readOnly,
textAlignVertical: textAlignVertical,
expands: expands,
@@ -114,6 +119,7 @@ class CustomTextFormField extends StatelessWidget {
prefixIcon: prefix,
prefixIconConstraints: prefixConstraints,
suffixIcon: suffix,
+ floatingLabelBehavior: FloatingLabelBehavior.always,
suffixStyle: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
diff --git a/lib/features/auth/auth_screen/auth_screen.dart b/lib/features/auth/auth_screen/auth_screen.dart
index 94914e51..78cfdfc1 100644
--- a/lib/features/auth/auth_screen/auth_screen.dart
+++ b/lib/features/auth/auth_screen/auth_screen.dart
@@ -1,5 +1,6 @@
import 'dart:convert';
+import 'package:dio/dio.dart';
import 'package:eatvio_app/core/const.dart';
import 'package:eatvio_app/core/locator_service.dart';
import 'package:eatvio_app/core/token_storage.dart';
@@ -41,6 +42,7 @@ class AuthScreen extends StatefulWidget {
class _AuthScreenState extends State {
bool checkboxState = false;
bool hidePassword = true;
+ final baseUrlController = TextEditingController();
@override
Widget build(BuildContext context) {
@@ -49,10 +51,54 @@ class _AuthScreenState extends State {
return Scaffold(
appBar: AppBar(
centerTitle: true,
- title: SvgPicture.asset(
- ImageConstant.imgLogoEatvio,
- height: 48,
- fit: BoxFit.contain,
+ title: GestureDetector(
+ onLongPress: () {
+ showDialog(
+ context: context,
+ builder: (context) => AlertDialog(
+ title: Text('Base url без https:// и /api'),
+ content: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ CustomTextFormField(
+ controller: baseUrlController,
+ hintText: 'dev2.eatvio.com',
+ ),
+ const SizedBox(height: 12),
+ InkWell(
+ onTap: () async {
+ baseUrl = 'https://${baseUrlController.text}';
+ sl().options.baseUrl = baseUrl;
+ },
+ borderRadius: BorderRadius.circular(20),
+ child: Ink(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(20),
+ color: appTheme.blueA400,
+ ),
+ child: Container(
+ padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
+ alignment: Alignment.center,
+ child: Text(
+ 'Сохранить',
+ style: TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ child: SvgPicture.asset(
+ ImageConstant.imgLogoEatvio,
+ height: 48,
+ fit: BoxFit.contain,
+ ),
),
),
body: SafeArea(
diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart
index c6c8e291..24f916ac 100644
--- a/lib/features/diary/presentation/pages/diary_screen.dart
+++ b/lib/features/diary/presentation/pages/diary_screen.dart
@@ -35,6 +35,7 @@ class _DiaryScreenState extends State {
CalendarWidget(),
if (state is DiaryStateLoading) const Loader(),
if (state is DiaryStateLoaded) MealWidget(),
+ const SizedBox(height: 12),
CaloriesChartWidget(),
],
),
diff --git a/lib/features/diary/presentation/widgets/calories_chart_widget.dart b/lib/features/diary/presentation/widgets/calories_chart_widget.dart
index d59d3b24..ddb7cbb8 100644
--- a/lib/features/diary/presentation/widgets/calories_chart_widget.dart
+++ b/lib/features/diary/presentation/widgets/calories_chart_widget.dart
@@ -12,8 +12,8 @@ class CaloriesChartWidget extends StatelessWidget {
builder: (BuildContext context, DiaryState state) {
if (state is DiaryStateLoaded) {
return Container(
- padding: const EdgeInsets.all(16),
margin: const EdgeInsets.only(top: 12),
+ padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Colors.white,
diff --git a/lib/features/feed/presentation/pages/feed_screen.dart b/lib/features/feed/presentation/pages/feed_screen.dart
index c5852416..07e73077 100644
--- a/lib/features/feed/presentation/pages/feed_screen.dart
+++ b/lib/features/feed/presentation/pages/feed_screen.dart
@@ -215,6 +215,9 @@ class _FeedScreenState extends State {
),
SizedBox(width: 12),
switch (_selectedChipIndex) {
+ 1 => _addItemButton(
+ onTap: () => GoRouter.of(context).pushNamed('recipeCreateScreen'),
+ ),
2 => AddItemButton(
onTap: state.profile?.role == 'consultant' ? () => GoRouter.of(context).pushNamed(CreateDietScreen.name) : null,
),
diff --git a/lib/features/menu/presentation/pages/menu_screen.dart b/lib/features/menu/presentation/pages/menu_screen.dart
index 50c3d308..ad974e54 100644
--- a/lib/features/menu/presentation/pages/menu_screen.dart
+++ b/lib/features/menu/presentation/pages/menu_screen.dart
@@ -11,7 +11,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
class MenuScreen extends StatelessWidget {
- const MenuScreen({super.key});
+ MenuScreen({super.key});
@override
Widget build(BuildContext context) {
diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart
index 76831727..dcf78172 100644
--- a/lib/features/profile/presentation/pages/profile_screen.dart
+++ b/lib/features/profile/presentation/pages/profile_screen.dart
@@ -192,10 +192,10 @@ class _ProfileScreenState extends State {
),
_subscriptionsAndSubscribers(state),
if (state.profile.badges.isNotEmpty) Padding(padding: EdgeInsets.only(bottom: 16), child: _badges(state)),
- if (state.profile.role == 'consultant') Padding(padding: EdgeInsets.only(bottom: 16), child: _socialLinks(state)),
- if (state.profile.role == 'consultant') Padding(padding: EdgeInsets.only(bottom: 16), child: _education(state)),
- if (state.profile.role == 'consultant') Padding(padding: EdgeInsets.only(bottom: 16), child: _diplomasAndCertificates(state)),
- if (state.profile.role == 'consultant') Padding(padding: EdgeInsets.only(bottom: 16), child: _activePlans(state)),
+ if (state.profile.role == 'consultant') _socialLinks(state),
+ if (state.profile.role == 'consultant') _education(state),
+ if (state.profile.role == 'consultant') _diplomasAndCertificates(state),
+ if (state.profile.role == 'consultant') _activePlans(state),
_blogPosts(state),
],
),
@@ -228,11 +228,11 @@ class _ProfileScreenState extends State {
),
_subscriptionsAndSubscribers(state),
if (state.profile.badges.isNotEmpty) Padding(padding: EdgeInsets.only(bottom: 16), child: _badges(state)),
- if (state.profile.role == 'consultant') Padding(padding: EdgeInsets.only(bottom: 16), child: _socialLinks(state)),
- if (state.profile.role == 'consultant') Padding(padding: EdgeInsets.only(bottom: 16), child: _education(state)),
- if (state.profile.role == 'consultant') Padding(padding: EdgeInsets.only(bottom: 16), child: _diplomasAndCertificates(state)),
+ if (state.profile.role == 'consultant') _socialLinks(state),
+ if (state.profile.role == 'consultant') _education(state),
+ if (state.profile.role == 'consultant') _diplomasAndCertificates(state),
Padding(padding: EdgeInsets.only(bottom: 16), child: _charts()),
- if (state.profile.role == 'consultant') Padding(padding: EdgeInsets.only(bottom: 16), child: _activePlans(state)),
+ if (state.profile.role == 'consultant') _activePlans(state),
_newBlogPostButton(),
_blogPosts(state),
],
@@ -249,6 +249,9 @@ class _ProfileScreenState extends State {
bloc: plansCubit,
builder: (BuildContext context, PlansState state) {
if (state is PlansStateLoaded) {
+ if (state.plansList.isEmpty) {
+ return const SizedBox.shrink();
+ }
return Column(
children: [
Padding(
@@ -366,57 +369,60 @@ class _ProfileScreenState extends State {
}
_diplomasAndCertificates(ProfileStateLoaded state) {
- if (state.profile.role != 'consultant') {
+ if (state.profile.role != 'consultant' || state.profile.diplomasAndCertificates == null || state.profile.diplomasAndCertificates!.isEmpty) {
return const SizedBox.shrink();
}
- return Column(
- children: [
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text(
- 'Дипломы\nи сертификаты',
- style: TextStyle(
- color: Color(0xFF323F4B),
- fontSize: 24,
- height: 1,
- fontWeight: FontWeight.w600,
+ return Padding(
+ padding: const EdgeInsets.only(bottom: 16),
+ child: Column(
+ children: [
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Text(
+ 'Дипломы\nи сертификаты',
+ style: TextStyle(
+ color: Color(0xFF323F4B),
+ fontSize: 24,
+ height: 1,
+ fontWeight: FontWeight.w600,
+ ),
),
- ),
- Text(
- widget.author == null ? 'Редактировать' : '',
- style: TextStyle(
- color: Color(0xFF2F80ED),
- fontSize: 16,
- fontWeight: FontWeight.w500,
+ Text(
+ widget.author == null ? 'Редактировать' : '',
+ style: TextStyle(
+ color: Color(0xFF2F80ED),
+ fontSize: 16,
+ fontWeight: FontWeight.w500,
+ ),
),
- ),
- ],
+ ],
+ ),
),
- ),
- const SizedBox(height: 8),
- Container(
- width: MediaQuery.of(context).size.width - 2,
- padding: const EdgeInsets.symmetric(horizontal: 4),
- child: Material(
- color: Colors.white,
- borderRadius: BorderRadius.circular(12),
- child: SingleChildScrollView(
- physics: const BouncingScrollPhysics(),
- scrollDirection: Axis.horizontal,
- padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
- child: Row(
- children: [
- if (state.profile.diplomasAndCertificates != null)
- ...state.profile.diplomasAndCertificates!.map((d) => _diplomaImage(baseUrl + '/storage/' + d.path)).toList(),
- ],
+ const SizedBox(height: 8),
+ Container(
+ width: MediaQuery.of(context).size.width - 2,
+ padding: const EdgeInsets.symmetric(horizontal: 4),
+ child: Material(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(12),
+ child: SingleChildScrollView(
+ physics: const BouncingScrollPhysics(),
+ scrollDirection: Axis.horizontal,
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
+ child: Row(
+ children: [
+ if (state.profile.diplomasAndCertificates != null)
+ ...state.profile.diplomasAndCertificates!.map((d) => _diplomaImage(baseUrl + '/storage/' + d.path)).toList(),
+ ],
+ ),
),
),
),
- ),
- ],
+ ],
+ ),
);
}
@@ -447,53 +453,56 @@ class _ProfileScreenState extends State {
}
_education(ProfileStateLoaded state) {
- if (state.profile.role != 'consultant') {
+ if (state.profile.role != 'consultant' || state.profile.educationResource?.completedCourses == null) {
return const SizedBox.shrink();
}
- return Column(
- children: [
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text(
- 'Образование',
- style: TextStyle(
- color: Color(0xFF323F4B),
- fontSize: 24,
- fontWeight: FontWeight.w600,
+ return Padding(
+ padding: const EdgeInsets.only(bottom: 16),
+ child: Column(
+ children: [
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Text(
+ 'Образование',
+ style: TextStyle(
+ color: Color(0xFF323F4B),
+ fontSize: 24,
+ fontWeight: FontWeight.w600,
+ ),
),
- ),
- Text(
- widget.author == null ? 'Редактировать' : '',
- style: TextStyle(
- color: Color(0xFF2F80ED),
- fontSize: 16,
- fontWeight: FontWeight.w500,
+ Text(
+ widget.author == null ? 'Редактировать' : '',
+ style: TextStyle(
+ color: Color(0xFF2F80ED),
+ fontSize: 16,
+ fontWeight: FontWeight.w500,
+ ),
),
- ),
- ],
+ ],
+ ),
),
- ),
- const SizedBox(height: 8),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 4),
- child: Material(
- color: Colors.white,
- borderRadius: BorderRadius.circular(12),
- child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
- child: Column(
- children: [
- if (state.profile.educationResource?.completedCourses != null)
- ...state.profile.educationResource!.completedCourses!.map((c) => _educationBlock(c.values.first.title, c.values.first.date)).toList(),
- ],
+ const SizedBox(height: 8),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 4),
+ child: Material(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(12),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
+ child: Column(
+ children: [
+ if (state.profile.educationResource?.completedCourses != null)
+ ...state.profile.educationResource!.completedCourses!.map((c) => _educationBlock(c.values.first.title, c.values.first.date)).toList(),
+ ],
+ ),
),
),
),
- ),
- ],
+ ],
+ ),
);
}
@@ -539,7 +548,7 @@ class _ProfileScreenState extends State {
return const SizedBox.shrink();
}
return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 4),
+ padding: const EdgeInsets.symmetric(horizontal: 4) + const EdgeInsets.only(bottom: 16),
child: Material(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
@@ -556,17 +565,19 @@ class _ProfileScreenState extends State {
);
},
'assets/icons/vk.svg',
+ state.profile.educationResource?.vkLink == null ? true : false,
),
const SizedBox(width: 12),
_socialLinkButton(
() {
launchUrl(
Uri.parse(
- state.profile.educationResource?.tgLink ?? '',
+ state.profile.educationResource?.vkLink ?? '',
),
);
},
'assets/icons/telegram.svg',
+ state.profile.educationResource?.vkLink == null ? true : false,
),
const SizedBox(width: 12),
_socialLinkButton(
@@ -578,6 +589,7 @@ class _ProfileScreenState extends State {
);
},
'assets/icons/web.svg',
+ state.profile.educationResource?.personalSiteLink == null ? true : false,
),
],
),
@@ -586,9 +598,9 @@ class _ProfileScreenState extends State {
);
}
- _socialLinkButton(Function() onTap, String icon) {
+ _socialLinkButton(Function() onTap, String icon, bool disabled) {
return InkWell(
- onTap: onTap,
+ onTap: disabled ? null : onTap,
borderRadius: BorderRadius.circular(20),
child: Ink(
width: MediaQuery.of(context).size.width / 3 - (56 / 3),
@@ -601,6 +613,7 @@ class _ProfileScreenState extends State {
child: SvgPicture.asset(
icon,
width: 24,
+ colorFilter: ColorFilter.mode(Colors.black12, BlendMode.srcIn),
),
),
),
diff --git a/lib/features/recipes/entities/recipe_create_entity.dart b/lib/features/recipes/entities/recipe_create_entity.dart
new file mode 100644
index 00000000..43a44a55
--- /dev/null
+++ b/lib/features/recipes/entities/recipe_create_entity.dart
@@ -0,0 +1,50 @@
+import 'dart:io';
+
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part 'recipe_create_entity.freezed.dart';
+
+enum TypeOfRecipe {
+ first_meals,
+ second_meals,
+ salads,
+ snacks,
+ sweets,
+ drinks,
+ other,
+}
+
+@freezed
+class RecipeCreateEntity with _$RecipeCreateEntity {
+ const factory RecipeCreateEntity({
+ String? title,
+ TypeOfRecipe? typeOfRecipe,
+ int? countOfPortions,
+ double? energyInOnePortion,
+ String? totalCookTime, // hh:mm
+ String? activeCookTime, // hh:mm
+ String? description,
+ File? image,
+ String? videoUrl,
+ required List ingredients,
+ required List steps,
+ required List tags, // tags for search
+ }) = _RecipeCreateEntity;
+}
+
+@freezed
+class IngredientEntity with _$IngredientEntity {
+ const factory IngredientEntity({
+ required String name,
+ required String unit,
+ required String portion,
+ }) = _IngredientEntity;
+}
+
+@freezed
+class StepEntity with _$StepEntity {
+ const factory StepEntity({
+ String? description,
+ File? image,
+ }) = _StepEntity;
+}
diff --git a/lib/features/recipes/entities/recipe_create_entity.freezed.dart b/lib/features/recipes/entities/recipe_create_entity.freezed.dart
new file mode 100644
index 00000000..e42db8f4
--- /dev/null
+++ b/lib/features/recipes/entities/recipe_create_entity.freezed.dart
@@ -0,0 +1,722 @@
+// 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 'recipe_create_entity.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 _$RecipeCreateEntity {
+ String? get title => throw _privateConstructorUsedError;
+ TypeOfRecipe? get typeOfRecipe => throw _privateConstructorUsedError;
+ int? get countOfPortions => throw _privateConstructorUsedError;
+ double? get energyInOnePortion => throw _privateConstructorUsedError;
+ String? get totalCookTime => throw _privateConstructorUsedError; // hh:mm
+ String? get activeCookTime => throw _privateConstructorUsedError; // hh:mm
+ String? get description => throw _privateConstructorUsedError;
+ File? get image => throw _privateConstructorUsedError;
+ String? get videoUrl => throw _privateConstructorUsedError;
+ List get ingredients => throw _privateConstructorUsedError;
+ List get steps => throw _privateConstructorUsedError;
+ List get tags => throw _privateConstructorUsedError;
+
+ /// Create a copy of RecipeCreateEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ $RecipeCreateEntityCopyWith get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $RecipeCreateEntityCopyWith<$Res> {
+ factory $RecipeCreateEntityCopyWith(
+ RecipeCreateEntity value, $Res Function(RecipeCreateEntity) then) =
+ _$RecipeCreateEntityCopyWithImpl<$Res, RecipeCreateEntity>;
+ @useResult
+ $Res call(
+ {String? title,
+ TypeOfRecipe? typeOfRecipe,
+ int? countOfPortions,
+ double? energyInOnePortion,
+ String? totalCookTime,
+ String? activeCookTime,
+ String? description,
+ File? image,
+ String? videoUrl,
+ List ingredients,
+ List steps,
+ List tags});
+}
+
+/// @nodoc
+class _$RecipeCreateEntityCopyWithImpl<$Res, $Val extends RecipeCreateEntity>
+ implements $RecipeCreateEntityCopyWith<$Res> {
+ _$RecipeCreateEntityCopyWithImpl(this._value, this._then);
+
+ // ignore: unused_field
+ final $Val _value;
+ // ignore: unused_field
+ final $Res Function($Val) _then;
+
+ /// Create a copy of RecipeCreateEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? title = freezed,
+ Object? typeOfRecipe = freezed,
+ Object? countOfPortions = freezed,
+ Object? energyInOnePortion = freezed,
+ Object? totalCookTime = freezed,
+ Object? activeCookTime = freezed,
+ Object? description = freezed,
+ Object? image = freezed,
+ Object? videoUrl = freezed,
+ Object? ingredients = null,
+ Object? steps = null,
+ Object? tags = null,
+ }) {
+ return _then(_value.copyWith(
+ title: freezed == title
+ ? _value.title
+ : title // ignore: cast_nullable_to_non_nullable
+ as String?,
+ typeOfRecipe: freezed == typeOfRecipe
+ ? _value.typeOfRecipe
+ : typeOfRecipe // ignore: cast_nullable_to_non_nullable
+ as TypeOfRecipe?,
+ countOfPortions: freezed == countOfPortions
+ ? _value.countOfPortions
+ : countOfPortions // ignore: cast_nullable_to_non_nullable
+ as int?,
+ energyInOnePortion: freezed == energyInOnePortion
+ ? _value.energyInOnePortion
+ : energyInOnePortion // ignore: cast_nullable_to_non_nullable
+ as double?,
+ totalCookTime: freezed == totalCookTime
+ ? _value.totalCookTime
+ : totalCookTime // ignore: cast_nullable_to_non_nullable
+ as String?,
+ activeCookTime: freezed == activeCookTime
+ ? _value.activeCookTime
+ : activeCookTime // ignore: cast_nullable_to_non_nullable
+ as String?,
+ description: freezed == description
+ ? _value.description
+ : description // ignore: cast_nullable_to_non_nullable
+ as String?,
+ image: freezed == image
+ ? _value.image
+ : image // ignore: cast_nullable_to_non_nullable
+ as File?,
+ videoUrl: freezed == videoUrl
+ ? _value.videoUrl
+ : videoUrl // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ingredients: null == ingredients
+ ? _value.ingredients
+ : ingredients // ignore: cast_nullable_to_non_nullable
+ as List,
+ steps: null == steps
+ ? _value.steps
+ : steps // ignore: cast_nullable_to_non_nullable
+ as List,
+ tags: null == tags
+ ? _value.tags
+ : tags // ignore: cast_nullable_to_non_nullable
+ as List,
+ ) as $Val);
+ }
+}
+
+/// @nodoc
+abstract class _$$RecipeCreateEntityImplCopyWith<$Res>
+ implements $RecipeCreateEntityCopyWith<$Res> {
+ factory _$$RecipeCreateEntityImplCopyWith(_$RecipeCreateEntityImpl value,
+ $Res Function(_$RecipeCreateEntityImpl) then) =
+ __$$RecipeCreateEntityImplCopyWithImpl<$Res>;
+ @override
+ @useResult
+ $Res call(
+ {String? title,
+ TypeOfRecipe? typeOfRecipe,
+ int? countOfPortions,
+ double? energyInOnePortion,
+ String? totalCookTime,
+ String? activeCookTime,
+ String? description,
+ File? image,
+ String? videoUrl,
+ List ingredients,
+ List steps,
+ List tags});
+}
+
+/// @nodoc
+class __$$RecipeCreateEntityImplCopyWithImpl<$Res>
+ extends _$RecipeCreateEntityCopyWithImpl<$Res, _$RecipeCreateEntityImpl>
+ implements _$$RecipeCreateEntityImplCopyWith<$Res> {
+ __$$RecipeCreateEntityImplCopyWithImpl(_$RecipeCreateEntityImpl _value,
+ $Res Function(_$RecipeCreateEntityImpl) _then)
+ : super(_value, _then);
+
+ /// Create a copy of RecipeCreateEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? title = freezed,
+ Object? typeOfRecipe = freezed,
+ Object? countOfPortions = freezed,
+ Object? energyInOnePortion = freezed,
+ Object? totalCookTime = freezed,
+ Object? activeCookTime = freezed,
+ Object? description = freezed,
+ Object? image = freezed,
+ Object? videoUrl = freezed,
+ Object? ingredients = null,
+ Object? steps = null,
+ Object? tags = null,
+ }) {
+ return _then(_$RecipeCreateEntityImpl(
+ title: freezed == title
+ ? _value.title
+ : title // ignore: cast_nullable_to_non_nullable
+ as String?,
+ typeOfRecipe: freezed == typeOfRecipe
+ ? _value.typeOfRecipe
+ : typeOfRecipe // ignore: cast_nullable_to_non_nullable
+ as TypeOfRecipe?,
+ countOfPortions: freezed == countOfPortions
+ ? _value.countOfPortions
+ : countOfPortions // ignore: cast_nullable_to_non_nullable
+ as int?,
+ energyInOnePortion: freezed == energyInOnePortion
+ ? _value.energyInOnePortion
+ : energyInOnePortion // ignore: cast_nullable_to_non_nullable
+ as double?,
+ totalCookTime: freezed == totalCookTime
+ ? _value.totalCookTime
+ : totalCookTime // ignore: cast_nullable_to_non_nullable
+ as String?,
+ activeCookTime: freezed == activeCookTime
+ ? _value.activeCookTime
+ : activeCookTime // ignore: cast_nullable_to_non_nullable
+ as String?,
+ description: freezed == description
+ ? _value.description
+ : description // ignore: cast_nullable_to_non_nullable
+ as String?,
+ image: freezed == image
+ ? _value.image
+ : image // ignore: cast_nullable_to_non_nullable
+ as File?,
+ videoUrl: freezed == videoUrl
+ ? _value.videoUrl
+ : videoUrl // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ingredients: null == ingredients
+ ? _value._ingredients
+ : ingredients // ignore: cast_nullable_to_non_nullable
+ as List,
+ steps: null == steps
+ ? _value._steps
+ : steps // ignore: cast_nullable_to_non_nullable
+ as List,
+ tags: null == tags
+ ? _value._tags
+ : tags // ignore: cast_nullable_to_non_nullable
+ as List,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$RecipeCreateEntityImpl implements _RecipeCreateEntity {
+ const _$RecipeCreateEntityImpl(
+ {this.title,
+ this.typeOfRecipe,
+ this.countOfPortions,
+ this.energyInOnePortion,
+ this.totalCookTime,
+ this.activeCookTime,
+ this.description,
+ this.image,
+ this.videoUrl,
+ required final List ingredients,
+ required final List steps,
+ required final List tags})
+ : _ingredients = ingredients,
+ _steps = steps,
+ _tags = tags;
+
+ @override
+ final String? title;
+ @override
+ final TypeOfRecipe? typeOfRecipe;
+ @override
+ final int? countOfPortions;
+ @override
+ final double? energyInOnePortion;
+ @override
+ final String? totalCookTime;
+// hh:mm
+ @override
+ final String? activeCookTime;
+// hh:mm
+ @override
+ final String? description;
+ @override
+ final File? image;
+ @override
+ final String? videoUrl;
+ final List _ingredients;
+ @override
+ List get ingredients {
+ if (_ingredients is EqualUnmodifiableListView) return _ingredients;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableListView(_ingredients);
+ }
+
+ final List _steps;
+ @override
+ List get steps {
+ if (_steps is EqualUnmodifiableListView) return _steps;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableListView(_steps);
+ }
+
+ final List _tags;
+ @override
+ List get tags {
+ if (_tags is EqualUnmodifiableListView) return _tags;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableListView(_tags);
+ }
+
+ @override
+ String toString() {
+ return 'RecipeCreateEntity(title: $title, typeOfRecipe: $typeOfRecipe, countOfPortions: $countOfPortions, energyInOnePortion: $energyInOnePortion, totalCookTime: $totalCookTime, activeCookTime: $activeCookTime, description: $description, image: $image, videoUrl: $videoUrl, ingredients: $ingredients, steps: $steps, tags: $tags)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$RecipeCreateEntityImpl &&
+ (identical(other.title, title) || other.title == title) &&
+ (identical(other.typeOfRecipe, typeOfRecipe) ||
+ other.typeOfRecipe == typeOfRecipe) &&
+ (identical(other.countOfPortions, countOfPortions) ||
+ other.countOfPortions == countOfPortions) &&
+ (identical(other.energyInOnePortion, energyInOnePortion) ||
+ other.energyInOnePortion == energyInOnePortion) &&
+ (identical(other.totalCookTime, totalCookTime) ||
+ other.totalCookTime == totalCookTime) &&
+ (identical(other.activeCookTime, activeCookTime) ||
+ other.activeCookTime == activeCookTime) &&
+ (identical(other.description, description) ||
+ other.description == description) &&
+ (identical(other.image, image) || other.image == image) &&
+ (identical(other.videoUrl, videoUrl) ||
+ other.videoUrl == videoUrl) &&
+ const DeepCollectionEquality()
+ .equals(other._ingredients, _ingredients) &&
+ const DeepCollectionEquality().equals(other._steps, _steps) &&
+ const DeepCollectionEquality().equals(other._tags, _tags));
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ runtimeType,
+ title,
+ typeOfRecipe,
+ countOfPortions,
+ energyInOnePortion,
+ totalCookTime,
+ activeCookTime,
+ description,
+ image,
+ videoUrl,
+ const DeepCollectionEquality().hash(_ingredients),
+ const DeepCollectionEquality().hash(_steps),
+ const DeepCollectionEquality().hash(_tags));
+
+ /// Create a copy of RecipeCreateEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$RecipeCreateEntityImplCopyWith<_$RecipeCreateEntityImpl> get copyWith =>
+ __$$RecipeCreateEntityImplCopyWithImpl<_$RecipeCreateEntityImpl>(
+ this, _$identity);
+}
+
+abstract class _RecipeCreateEntity implements RecipeCreateEntity {
+ const factory _RecipeCreateEntity(
+ {final String? title,
+ final TypeOfRecipe? typeOfRecipe,
+ final int? countOfPortions,
+ final double? energyInOnePortion,
+ final String? totalCookTime,
+ final String? activeCookTime,
+ final String? description,
+ final File? image,
+ final String? videoUrl,
+ required final List ingredients,
+ required final List steps,
+ required final List tags}) = _$RecipeCreateEntityImpl;
+
+ @override
+ String? get title;
+ @override
+ TypeOfRecipe? get typeOfRecipe;
+ @override
+ int? get countOfPortions;
+ @override
+ double? get energyInOnePortion;
+ @override
+ String? get totalCookTime; // hh:mm
+ @override
+ String? get activeCookTime; // hh:mm
+ @override
+ String? get description;
+ @override
+ File? get image;
+ @override
+ String? get videoUrl;
+ @override
+ List get ingredients;
+ @override
+ List get steps;
+ @override
+ List get tags;
+
+ /// Create a copy of RecipeCreateEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ _$$RecipeCreateEntityImplCopyWith<_$RecipeCreateEntityImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+mixin _$IngredientEntity {
+ String get name => throw _privateConstructorUsedError;
+ String get unit => throw _privateConstructorUsedError;
+ String get portion => throw _privateConstructorUsedError;
+
+ /// Create a copy of IngredientEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ $IngredientEntityCopyWith get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $IngredientEntityCopyWith<$Res> {
+ factory $IngredientEntityCopyWith(
+ IngredientEntity value, $Res Function(IngredientEntity) then) =
+ _$IngredientEntityCopyWithImpl<$Res, IngredientEntity>;
+ @useResult
+ $Res call({String name, String unit, String portion});
+}
+
+/// @nodoc
+class _$IngredientEntityCopyWithImpl<$Res, $Val extends IngredientEntity>
+ implements $IngredientEntityCopyWith<$Res> {
+ _$IngredientEntityCopyWithImpl(this._value, this._then);
+
+ // ignore: unused_field
+ final $Val _value;
+ // ignore: unused_field
+ final $Res Function($Val) _then;
+
+ /// Create a copy of IngredientEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? name = null,
+ Object? unit = null,
+ Object? portion = null,
+ }) {
+ return _then(_value.copyWith(
+ name: null == name
+ ? _value.name
+ : name // ignore: cast_nullable_to_non_nullable
+ as String,
+ unit: null == unit
+ ? _value.unit
+ : unit // ignore: cast_nullable_to_non_nullable
+ as String,
+ portion: null == portion
+ ? _value.portion
+ : portion // ignore: cast_nullable_to_non_nullable
+ as String,
+ ) as $Val);
+ }
+}
+
+/// @nodoc
+abstract class _$$IngredientEntityImplCopyWith<$Res>
+ implements $IngredientEntityCopyWith<$Res> {
+ factory _$$IngredientEntityImplCopyWith(_$IngredientEntityImpl value,
+ $Res Function(_$IngredientEntityImpl) then) =
+ __$$IngredientEntityImplCopyWithImpl<$Res>;
+ @override
+ @useResult
+ $Res call({String name, String unit, String portion});
+}
+
+/// @nodoc
+class __$$IngredientEntityImplCopyWithImpl<$Res>
+ extends _$IngredientEntityCopyWithImpl<$Res, _$IngredientEntityImpl>
+ implements _$$IngredientEntityImplCopyWith<$Res> {
+ __$$IngredientEntityImplCopyWithImpl(_$IngredientEntityImpl _value,
+ $Res Function(_$IngredientEntityImpl) _then)
+ : super(_value, _then);
+
+ /// Create a copy of IngredientEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? name = null,
+ Object? unit = null,
+ Object? portion = null,
+ }) {
+ return _then(_$IngredientEntityImpl(
+ name: null == name
+ ? _value.name
+ : name // ignore: cast_nullable_to_non_nullable
+ as String,
+ unit: null == unit
+ ? _value.unit
+ : unit // ignore: cast_nullable_to_non_nullable
+ as String,
+ portion: null == portion
+ ? _value.portion
+ : portion // ignore: cast_nullable_to_non_nullable
+ as String,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$IngredientEntityImpl implements _IngredientEntity {
+ const _$IngredientEntityImpl(
+ {required this.name, required this.unit, required this.portion});
+
+ @override
+ final String name;
+ @override
+ final String unit;
+ @override
+ final String portion;
+
+ @override
+ String toString() {
+ return 'IngredientEntity(name: $name, unit: $unit, portion: $portion)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$IngredientEntityImpl &&
+ (identical(other.name, name) || other.name == name) &&
+ (identical(other.unit, unit) || other.unit == unit) &&
+ (identical(other.portion, portion) || other.portion == portion));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, name, unit, portion);
+
+ /// Create a copy of IngredientEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$IngredientEntityImplCopyWith<_$IngredientEntityImpl> get copyWith =>
+ __$$IngredientEntityImplCopyWithImpl<_$IngredientEntityImpl>(
+ this, _$identity);
+}
+
+abstract class _IngredientEntity implements IngredientEntity {
+ const factory _IngredientEntity(
+ {required final String name,
+ required final String unit,
+ required final String portion}) = _$IngredientEntityImpl;
+
+ @override
+ String get name;
+ @override
+ String get unit;
+ @override
+ String get portion;
+
+ /// Create a copy of IngredientEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ _$$IngredientEntityImplCopyWith<_$IngredientEntityImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+mixin _$StepEntity {
+ String? get description => throw _privateConstructorUsedError;
+ File? get image => throw _privateConstructorUsedError;
+
+ /// Create a copy of StepEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ $StepEntityCopyWith get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $StepEntityCopyWith<$Res> {
+ factory $StepEntityCopyWith(
+ StepEntity value, $Res Function(StepEntity) then) =
+ _$StepEntityCopyWithImpl<$Res, StepEntity>;
+ @useResult
+ $Res call({String? description, File? image});
+}
+
+/// @nodoc
+class _$StepEntityCopyWithImpl<$Res, $Val extends StepEntity>
+ implements $StepEntityCopyWith<$Res> {
+ _$StepEntityCopyWithImpl(this._value, this._then);
+
+ // ignore: unused_field
+ final $Val _value;
+ // ignore: unused_field
+ final $Res Function($Val) _then;
+
+ /// Create a copy of StepEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? description = freezed,
+ Object? image = freezed,
+ }) {
+ return _then(_value.copyWith(
+ description: freezed == description
+ ? _value.description
+ : description // ignore: cast_nullable_to_non_nullable
+ as String?,
+ image: freezed == image
+ ? _value.image
+ : image // ignore: cast_nullable_to_non_nullable
+ as File?,
+ ) as $Val);
+ }
+}
+
+/// @nodoc
+abstract class _$$StepEntityImplCopyWith<$Res>
+ implements $StepEntityCopyWith<$Res> {
+ factory _$$StepEntityImplCopyWith(
+ _$StepEntityImpl value, $Res Function(_$StepEntityImpl) then) =
+ __$$StepEntityImplCopyWithImpl<$Res>;
+ @override
+ @useResult
+ $Res call({String? description, File? image});
+}
+
+/// @nodoc
+class __$$StepEntityImplCopyWithImpl<$Res>
+ extends _$StepEntityCopyWithImpl<$Res, _$StepEntityImpl>
+ implements _$$StepEntityImplCopyWith<$Res> {
+ __$$StepEntityImplCopyWithImpl(
+ _$StepEntityImpl _value, $Res Function(_$StepEntityImpl) _then)
+ : super(_value, _then);
+
+ /// Create a copy of StepEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? description = freezed,
+ Object? image = freezed,
+ }) {
+ return _then(_$StepEntityImpl(
+ description: freezed == description
+ ? _value.description
+ : description // ignore: cast_nullable_to_non_nullable
+ as String?,
+ image: freezed == image
+ ? _value.image
+ : image // ignore: cast_nullable_to_non_nullable
+ as File?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$StepEntityImpl implements _StepEntity {
+ const _$StepEntityImpl({this.description, this.image});
+
+ @override
+ final String? description;
+ @override
+ final File? image;
+
+ @override
+ String toString() {
+ return 'StepEntity(description: $description, image: $image)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$StepEntityImpl &&
+ (identical(other.description, description) ||
+ other.description == description) &&
+ (identical(other.image, image) || other.image == image));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, description, image);
+
+ /// Create a copy of StepEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$StepEntityImplCopyWith<_$StepEntityImpl> get copyWith =>
+ __$$StepEntityImplCopyWithImpl<_$StepEntityImpl>(this, _$identity);
+}
+
+abstract class _StepEntity implements StepEntity {
+ const factory _StepEntity({final String? description, final File? image}) =
+ _$StepEntityImpl;
+
+ @override
+ String? get description;
+ @override
+ File? get image;
+
+ /// Create a copy of StepEntity
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ _$$StepEntityImplCopyWith<_$StepEntityImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
diff --git a/lib/features/recipes/presentation/bloc/create_recipe_cubit/create_recipe_cubit.dart b/lib/features/recipes/presentation/bloc/create_recipe_cubit/create_recipe_cubit.dart
new file mode 100644
index 00000000..03253f26
--- /dev/null
+++ b/lib/features/recipes/presentation/bloc/create_recipe_cubit/create_recipe_cubit.dart
@@ -0,0 +1,219 @@
+import 'dart:io';
+
+import 'package:eatvio_app/features/recipes/entities/recipe_create_entity.dart';
+import 'package:eatvio_app/features/recipes/presentation/bloc/create_recipe_cubit/create_recipe_state.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+
+class CreateRecipeCubit extends Cubit {
+ CreateRecipeCubit()
+ : super(
+ CreateRecipeState(
+ RecipeCreateEntity(
+ ingredients: [],
+ steps: [],
+ tags: [],
+ ),
+ ),
+ );
+
+ addStep() {
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ steps: [
+ ...state.entity.steps,
+ StepEntity(),
+ ],
+ ),
+ ),
+ );
+ }
+
+ removeStep(StepEntity step) {
+ List steps = [...state.entity.steps];
+ steps.remove(step);
+
+ emit(
+ CreateRecipeState(state.entity.copyWith(steps: steps)),
+ );
+ }
+
+ addIngredient(IngredientEntity entity) {
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ ingredients: [
+ ...state.entity.ingredients,
+ entity,
+ ],
+ ),
+ ),
+ );
+ }
+
+ removeIngredient(int index) {
+ List ingredients = [...state.entity.ingredients];
+ ingredients.removeAt(index);
+
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ ingredients: ingredients,
+ ),
+ ),
+ );
+ }
+
+ replaceIngredientPosition(int oldIndex, int newIndex) {
+ List ingredients = [...state.entity.ingredients];
+ final IngredientEntity item = ingredients.removeAt(oldIndex);
+ ingredients.insert(newIndex, item);
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ ingredients: ingredients,
+ ),
+ ),
+ );
+ }
+
+ replaceTitle(String title) {
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ title: title,
+ ),
+ ),
+ );
+ }
+
+ replaceDescription(String description) {
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ description: description,
+ ),
+ ),
+ );
+ }
+
+ changeType(TypeOfRecipe typeOfRecipe) {
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ typeOfRecipe: typeOfRecipe,
+ ),
+ ),
+ );
+ }
+
+ addTag(String tag) {
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ tags: [
+ ...state.entity.tags,
+ tag,
+ ],
+ ),
+ ),
+ );
+ }
+
+ removeTag(String tag) {
+ List tags = [...state.entity.tags];
+ tags.remove(tag);
+
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ tags: tags,
+ ),
+ ),
+ );
+ }
+
+ replacePortionsCount(int count) {
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ countOfPortions: count,
+ ),
+ ),
+ );
+ }
+
+ replaceEnegryInPortion(double energy) {
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ energyInOnePortion: energy,
+ ),
+ ),
+ );
+ }
+
+ replaceTotalTime(String time) {
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ totalCookTime: time,
+ ),
+ ),
+ );
+ }
+
+ replaceActiveTime(String time) {
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ activeCookTime: time,
+ ),
+ ),
+ );
+ }
+
+ replaceVideoUrl(String videoUrl) {
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ videoUrl: videoUrl,
+ ),
+ ),
+ );
+ }
+
+ replaceImage(File? image) {
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ image: image,
+ ),
+ ),
+ );
+ }
+
+ replaceDescriptionInStep(String description, int index) {
+ List steps = [...state.entity.steps];
+ steps[index] = steps[index].copyWith(description: description);
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ steps: steps,
+ ),
+ ),
+ );
+ }
+
+ replaceImageInStep(File? image, int index) {
+ List steps = [...state.entity.steps];
+ steps[index] = steps[index].copyWith(image: image);
+ emit(
+ CreateRecipeState(
+ state.entity.copyWith(
+ steps: steps,
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/features/recipes/presentation/bloc/create_recipe_cubit/create_recipe_state.dart b/lib/features/recipes/presentation/bloc/create_recipe_cubit/create_recipe_state.dart
new file mode 100644
index 00000000..19adabf8
--- /dev/null
+++ b/lib/features/recipes/presentation/bloc/create_recipe_cubit/create_recipe_state.dart
@@ -0,0 +1,11 @@
+import 'package:eatvio_app/features/recipes/entities/recipe_create_entity.dart';
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part 'create_recipe_state.freezed.dart';
+
+@freezed
+class CreateRecipeState with _$CreateRecipeState {
+ const factory CreateRecipeState(
+ RecipeCreateEntity entity,
+ ) = _CreateRecipeState;
+}
diff --git a/lib/features/recipes/presentation/bloc/create_recipe_cubit/create_recipe_state.freezed.dart b/lib/features/recipes/presentation/bloc/create_recipe_cubit/create_recipe_state.freezed.dart
new file mode 100644
index 00000000..b1661b76
--- /dev/null
+++ b/lib/features/recipes/presentation/bloc/create_recipe_cubit/create_recipe_state.freezed.dart
@@ -0,0 +1,160 @@
+// 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 'create_recipe_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 _$CreateRecipeState {
+ RecipeCreateEntity get entity => throw _privateConstructorUsedError;
+
+ /// Create a copy of CreateRecipeState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ $CreateRecipeStateCopyWith get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $CreateRecipeStateCopyWith<$Res> {
+ factory $CreateRecipeStateCopyWith(
+ CreateRecipeState value, $Res Function(CreateRecipeState) then) =
+ _$CreateRecipeStateCopyWithImpl<$Res, CreateRecipeState>;
+ @useResult
+ $Res call({RecipeCreateEntity entity});
+
+ $RecipeCreateEntityCopyWith<$Res> get entity;
+}
+
+/// @nodoc
+class _$CreateRecipeStateCopyWithImpl<$Res, $Val extends CreateRecipeState>
+ implements $CreateRecipeStateCopyWith<$Res> {
+ _$CreateRecipeStateCopyWithImpl(this._value, this._then);
+
+ // ignore: unused_field
+ final $Val _value;
+ // ignore: unused_field
+ final $Res Function($Val) _then;
+
+ /// Create a copy of CreateRecipeState
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? entity = null,
+ }) {
+ return _then(_value.copyWith(
+ entity: null == entity
+ ? _value.entity
+ : entity // ignore: cast_nullable_to_non_nullable
+ as RecipeCreateEntity,
+ ) as $Val);
+ }
+
+ /// Create a copy of CreateRecipeState
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @pragma('vm:prefer-inline')
+ $RecipeCreateEntityCopyWith<$Res> get entity {
+ return $RecipeCreateEntityCopyWith<$Res>(_value.entity, (value) {
+ return _then(_value.copyWith(entity: value) as $Val);
+ });
+ }
+}
+
+/// @nodoc
+abstract class _$$CreateRecipeStateImplCopyWith<$Res>
+ implements $CreateRecipeStateCopyWith<$Res> {
+ factory _$$CreateRecipeStateImplCopyWith(_$CreateRecipeStateImpl value,
+ $Res Function(_$CreateRecipeStateImpl) then) =
+ __$$CreateRecipeStateImplCopyWithImpl<$Res>;
+ @override
+ @useResult
+ $Res call({RecipeCreateEntity entity});
+
+ @override
+ $RecipeCreateEntityCopyWith<$Res> get entity;
+}
+
+/// @nodoc
+class __$$CreateRecipeStateImplCopyWithImpl<$Res>
+ extends _$CreateRecipeStateCopyWithImpl<$Res, _$CreateRecipeStateImpl>
+ implements _$$CreateRecipeStateImplCopyWith<$Res> {
+ __$$CreateRecipeStateImplCopyWithImpl(_$CreateRecipeStateImpl _value,
+ $Res Function(_$CreateRecipeStateImpl) _then)
+ : super(_value, _then);
+
+ /// Create a copy of CreateRecipeState
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? entity = null,
+ }) {
+ return _then(_$CreateRecipeStateImpl(
+ null == entity
+ ? _value.entity
+ : entity // ignore: cast_nullable_to_non_nullable
+ as RecipeCreateEntity,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$CreateRecipeStateImpl implements _CreateRecipeState {
+ const _$CreateRecipeStateImpl(this.entity);
+
+ @override
+ final RecipeCreateEntity entity;
+
+ @override
+ String toString() {
+ return 'CreateRecipeState(entity: $entity)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$CreateRecipeStateImpl &&
+ (identical(other.entity, entity) || other.entity == entity));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, entity);
+
+ /// Create a copy of CreateRecipeState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$CreateRecipeStateImplCopyWith<_$CreateRecipeStateImpl> get copyWith =>
+ __$$CreateRecipeStateImplCopyWithImpl<_$CreateRecipeStateImpl>(
+ this, _$identity);
+}
+
+abstract class _CreateRecipeState implements CreateRecipeState {
+ const factory _CreateRecipeState(final RecipeCreateEntity entity) =
+ _$CreateRecipeStateImpl;
+
+ @override
+ RecipeCreateEntity get entity;
+
+ /// Create a copy of CreateRecipeState
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ _$$CreateRecipeStateImplCopyWith<_$CreateRecipeStateImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
diff --git a/lib/features/recipes/presentation/bloc/recipe_create_cubit.dart b/lib/features/recipes/presentation/bloc/recipe_create_cubit.dart
deleted file mode 100644
index e0cd0dce..00000000
--- a/lib/features/recipes/presentation/bloc/recipe_create_cubit.dart
+++ /dev/null
@@ -1,300 +0,0 @@
-import 'package:eatvio_app/core/data/selectionPopupModel/selection_popup_model.dart';
-import 'package:eatvio_app/features/recipes/models/ingredient.dart';
-import 'package:eatvio_app/features/recipes/models/recipe_model.dart';
-import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_state.dart';
-import 'package:eatvio_app/features/recipes/reporitories/recipe_repository.dart';
-import 'package:eatvio_app/features/recipes/models/product.dart';
-import 'package:flutter/material.dart';
-import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:image_picker/image_picker.dart';
-
-class RecipeCreateCubit extends Cubit {
- final RecipeRepository recipeRepository;
-
- RecipeCreateCubit({required this.recipeRepository}) : super(const RecipeCreateState.loading());
-
- loadRecipeById(String recipeID) async {
- emit(const RecipeCreateStateLoading());
- try {
- final RecipeModel recipe = await recipeRepository.getRecipe(recipeID);
- final List types = [
- SelectionPopupModel(title: 'Первые блюда', value: 'first_meals'),
- SelectionPopupModel(title: 'Вторые блюда', value: 'second_meals'),
- SelectionPopupModel(title: 'Cалаты', value: 'salads'),
- SelectionPopupModel(title: 'Перекусы/закуски', value: 'snacks'),
- SelectionPopupModel(title: 'Сладости', value: 'sweets'),
- SelectionPopupModel(title: 'Напитки', value: 'drinks'),
- SelectionPopupModel(title: 'Прочее', value: 'other'),
- ];
- final List cookingTimes = [
- SelectionPopupModel(title: '10 минут', value: 10),
- SelectionPopupModel(title: '20 минут', value: 20),
- SelectionPopupModel(title: '30 минут', value: 30),
- SelectionPopupModel(title: '1 час', value: 60),
- SelectionPopupModel(title: '2 часа', value: 120),
- SelectionPopupModel(title: '10 дней', value: 14400),
- ];
- final List statuses = [
- SelectionPopupModel(title: 'Активна', value: 'active'),
- SelectionPopupModel(title: 'Неактивна', value: 'inactive'),
- ];
- final selectedType = types.firstWhere(
- (type) => type.value == recipe.type,
- orElse: () => types[0],
- );
-
- final selectedCookingTime = cookingTimes.firstWhere(
- (time) => time.value == recipe.cooking_time,
- orElse: () => cookingTimes[0],
- );
-
- final selectedStatus = statuses.firstWhere(
- (status) => status.value == recipe.state,
- orElse: () => statuses[0],
- );
-
- final stepControllers = recipe.steps?.map((step) {
- return TextEditingController(text: step?.description);
- }).toList();
-
- final stepImages = recipe.steps?.map((step) {
- return step?.image != null ? XFile(step!.image!) : null;
- }).toList();
-
- final ingredients = recipe.ingredients?.map((ingredient) {
- return Ingredient(
- name: ingredient!.name,
- portion: ingredient.portion,
- unit: ingredient.unit,
- );
- }).toList();
-
- emit(RecipeCreateState.loaded(
- picker: ImagePicker(),
- recipeImage: XFile(recipe.image!),
- titleController: TextEditingController(text: recipe.title),
- productNameController: TextEditingController(),
- ingredientController: TextEditingController(),
- stepDescriptionController: TextEditingController(text: recipe.description),
- videoLinkController: TextEditingController(text: recipe.video_url),
- stepControllers: stepControllers ?? [],
- stepImages: stepImages ?? [],
- autocompleteList: [],
- ingredients: ingredients ?? [],
- numberOfSteps: 1,
- ingredientAsItems: false,
- types: types,
- cookingTimes: cookingTimes,
- statuses: statuses,
- selectedType: selectedType,
- selectedCookingTime: selectedCookingTime,
- selectedStatus: selectedStatus,),);
- } catch (e) {
- emit(RecipeCreateState.error(errorMessage: e.toString()));
- }
- }
-
- loadRecipeCreate() {
- emit(const RecipeCreateStateLoading());
- try {
- final List types = [
- SelectionPopupModel(title: 'Первые блюда', value: 'first_meals'),
- SelectionPopupModel(title: 'Вторые блюда', value: 'second_meals'),
- SelectionPopupModel(title: 'Cалаты', value: 'salads'),
- SelectionPopupModel(title: 'Перекусы/закуски', value: 'snacks'),
- SelectionPopupModel(title: 'Сладости', value: 'sweets'),
- SelectionPopupModel(title: 'Напитки', value: 'drinks'),
- SelectionPopupModel(title: 'Прочее', value: 'other'),
- ];
- final List cookingTimes = [
- SelectionPopupModel(title: '10 минут', value: 10),
- SelectionPopupModel(title: '20 минут', value: 20),
- SelectionPopupModel(title: '30 минут', value: 30),
- SelectionPopupModel(title: '1 час', value: 60),
- SelectionPopupModel(title: '2 часа', value: 120),
- SelectionPopupModel(title: '10 дней', value: 14400),
- ];
- final List statuses = [
- SelectionPopupModel(title: 'Активна', value: 'active'),
- SelectionPopupModel(title: 'Неактивна', value: 'inactive'),
- ];
- emit(RecipeCreateState.loaded(
- picker: ImagePicker(),
- titleController: TextEditingController(),
- productNameController: TextEditingController(),
- ingredientController: TextEditingController(),
- stepDescriptionController: TextEditingController(),
- videoLinkController: TextEditingController(),
- stepControllers: [TextEditingController()],
- stepImages: [null],
- autocompleteList: [],
- ingredients: [],
- numberOfSteps: 1,
- ingredientAsItems: false,
- types: types,
- cookingTimes: cookingTimes,
- statuses: statuses,
- selectedType: types[0],
- selectedCookingTime: cookingTimes[0],
- selectedStatus: statuses[0],),);
- } catch (e) {
- emit(RecipeCreateState.error(errorMessage: e.toString()));
- }
- }
-
- publishRecipe(RecipeModel recipe) async {
- await recipeRepository.publishRecipe(recipe);
- }
-
- editRecipe(RecipeModel recipe, String id) async {
- await recipeRepository.editRecipe(recipe, id);
- }
-
- uploadRecipeImage(XFile? pickedFile) {
- try {
- if (state is RecipeCreateStateLoaded) {
- var currentState = state as RecipeCreateStateLoaded;
- var updatedState = currentState.copyWith(
- recipeImage: pickedFile,
- );
- emit(updatedState);
- }
- } catch (e) {
- emit(RecipeCreateState.error(errorMessage: e.toString()));
- }
- }
-
- uploadStepImage(XFile? pickedFile, int stepNumber) {
- try {
- if (state is RecipeCreateStateLoaded) {
- var currentState = state as RecipeCreateStateLoaded;
-
- var updatedStepImages = List.from(currentState.stepImages);
-
- if (stepNumber >= 0 && stepNumber < updatedStepImages.length) {
- updatedStepImages[stepNumber] = pickedFile;
- }
-
- var updatedState = currentState.copyWith(
- stepImages: updatedStepImages,
- );
-
- emit(updatedState);
- }
- } catch (e) {
- emit(RecipeCreateState.error(errorMessage: e.toString()));
- }
- }
-
- switchUnits(bool value) {
- try {
- if (state is RecipeCreateStateLoaded) {
- var currentState = state as RecipeCreateStateLoaded;
- var updatedState = currentState.copyWith(ingredientAsItems: value);
- emit(updatedState);
- }
- } catch (e) {
- emit(RecipeCreateState.error(errorMessage: e.toString()));
- }
- }
-
- addIngredient(Ingredient ingredient) {
- try {
- if (state is RecipeCreateStateLoaded) {
- var currentState = state as RecipeCreateStateLoaded;
-
- bool ingredientExists = currentState.ingredients.any((existingIngredient) => existingIngredient.name == ingredient.name);
-
- if (ingredientExists) {
- emit(RecipeCreateState.error(errorMessage: 'Ингредиент уже существует.'));
- return;
- }
-
- List newIngredients = List.from(currentState.ingredients);
- newIngredients.add(ingredient);
-
- var updatedState = currentState.copyWith(ingredients: newIngredients);
- emit(updatedState);
- }
- } catch (e) {
- emit(RecipeCreateState.error(errorMessage: e.toString()));
- }
- }
-
- addStep() {
- try {
- if (state is RecipeCreateStateLoaded) {
- var currentState = state as RecipeCreateStateLoaded;
- List newStepImages = List.from(currentState.stepImages);
- newStepImages.add(null);
- List newStepControllers = List.from(currentState.stepControllers);
- newStepControllers.add(TextEditingController());
- var updatedState = currentState.copyWith(stepImages: newStepImages, stepControllers: newStepControllers, numberOfSteps: currentState.numberOfSteps + 1);
- emit(updatedState);
- }
- } catch (e) {
- emit(RecipeCreateState.error(errorMessage: e.toString()));
- }
- }
-
- removeStep() {
- try {
- if (state is RecipeCreateStateLoaded) {
- var currentState = state as RecipeCreateStateLoaded;
- List newStepImages = List.from(currentState.stepImages);
- newStepImages.removeLast();
- List newStepControllers = List.from(currentState.stepControllers);
- newStepControllers.removeLast();
- var updatedState = currentState.copyWith(stepImages: newStepImages, stepControllers: newStepControllers, numberOfSteps: currentState.numberOfSteps - 1);
- emit(updatedState);
- }
- } catch (e) {
- emit(RecipeCreateState.error(errorMessage: e.toString()));
- }
- }
-
- inputProduct(String input) async {
- if (state is RecipeCreateStateLoaded) {
- var currentState = state as RecipeCreateStateLoaded;
-
- final Map> productNutritionalValues = await recipeRepository.inputProduct(input);
-
- var updatedState = currentState.copyWith(
- productNameController: TextEditingController(text: input),
- autocompleteList: productNutritionalValues['product_nutritional_value'] ?? [],
- );
-
- emit(updatedState);
- }
- }
-
- changeType(SelectionPopupModel type) {
- if (state is RecipeCreateStateLoaded) {
- var currentState = state as RecipeCreateStateLoaded;
- RecipeCreateStateLoaded updatedState = currentState.copyWith(
- selectedType: type,
- );
- emit(updatedState);
- }
- }
-
- changeStatus(SelectionPopupModel status) {
- if (state is RecipeCreateStateLoaded) {
- var currentState = state as RecipeCreateStateLoaded;
- RecipeCreateStateLoaded updatedState = currentState.copyWith(
- selectedStatus: status,
- );
- emit(updatedState);
- }
- }
-
- changeCookingTime(SelectionPopupModel cookingTime) {
- if (state is RecipeCreateStateLoaded) {
- var currentState = state as RecipeCreateStateLoaded;
- RecipeCreateStateLoaded updatedState = currentState.copyWith(
- selectedCookingTime: cookingTime,
- );
- emit(updatedState);
- }
- }
-}
diff --git a/lib/features/recipes/presentation/bloc/recipe_create_state.dart b/lib/features/recipes/presentation/bloc/recipe_create_state.dart
deleted file mode 100644
index 8e84b19b..00000000
--- a/lib/features/recipes/presentation/bloc/recipe_create_state.dart
+++ /dev/null
@@ -1,42 +0,0 @@
-import 'package:eatvio_app/core/data/selectionPopupModel/selection_popup_model.dart';
-import 'package:eatvio_app/features/recipes/models/recipe_model.dart';
-import 'package:eatvio_app/features/recipes/models/ingredient.dart';
-import 'package:eatvio_app/features/recipes/models/product.dart';
-import 'package:flutter/material.dart';
-import 'package:freezed_annotation/freezed_annotation.dart';
-import 'package:image_picker/image_picker.dart';
-part 'recipe_create_state.freezed.dart';
-
-@freezed
-abstract class RecipeCreateState with _$RecipeCreateState {
- const factory RecipeCreateState() = _RecipeCreateState;
-
- const factory RecipeCreateState.loading() = RecipeCreateStateLoading;
-
- const factory RecipeCreateState.loaded({
- RecipeModel? recipe,
- required ImagePicker picker,
- required TextEditingController titleController,
- required TextEditingController productNameController,
- required TextEditingController ingredientController,
- required TextEditingController stepDescriptionController,
- required TextEditingController videoLinkController,
- required List stepControllers,
- XFile? recipeImage,
- required List stepImages,
- required List ingredients,
- required List autocompleteList,
- required int numberOfSteps,
- required bool ingredientAsItems,
- required List types,
- required List cookingTimes,
- required List statuses,
- required SelectionPopupModel selectedType,
- required SelectionPopupModel selectedCookingTime,
- required SelectionPopupModel selectedStatus,
- }) = RecipeCreateStateLoaded;
-
- const factory RecipeCreateState.error({
- required String errorMessage,
- }) = RecipeCreateStateError;
-}
diff --git a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart
deleted file mode 100644
index 672872e2..00000000
--- a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart
+++ /dev/null
@@ -1,1386 +0,0 @@
-// 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 'recipe_create_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 _$RecipeCreateState {
- @optionalTypeArgs
- TResult when(
- TResult Function() $default, {
- required TResult Function() loading,
- required TResult Function(
- RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus)
- loaded,
- required TResult Function(String errorMessage) error,
- }) =>
- throw _privateConstructorUsedError;
- @optionalTypeArgs
- TResult? whenOrNull(
- TResult? Function()? $default, {
- TResult? Function()? loading,
- TResult? Function(
- RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus)?
- loaded,
- TResult? Function(String errorMessage)? error,
- }) =>
- throw _privateConstructorUsedError;
- @optionalTypeArgs
- TResult maybeWhen(
- TResult Function()? $default, {
- TResult Function()? loading,
- TResult Function(
- RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus)?
- loaded,
- TResult Function(String errorMessage)? error,
- required TResult orElse(),
- }) =>
- throw _privateConstructorUsedError;
- @optionalTypeArgs
- TResult map(
- TResult Function(_RecipeCreateState value) $default, {
- required TResult Function(RecipeCreateStateLoading value) loading,
- required TResult Function(RecipeCreateStateLoaded value) loaded,
- required TResult Function(RecipeCreateStateError value) error,
- }) =>
- throw _privateConstructorUsedError;
- @optionalTypeArgs
- TResult? mapOrNull(
- TResult? Function(_RecipeCreateState value)? $default, {
- TResult? Function(RecipeCreateStateLoading value)? loading,
- TResult? Function(RecipeCreateStateLoaded value)? loaded,
- TResult? Function(RecipeCreateStateError value)? error,
- }) =>
- throw _privateConstructorUsedError;
- @optionalTypeArgs
- TResult maybeMap(
- TResult Function(_RecipeCreateState value)? $default, {
- TResult Function(RecipeCreateStateLoading value)? loading,
- TResult Function(RecipeCreateStateLoaded value)? loaded,
- TResult Function(RecipeCreateStateError value)? error,
- required TResult orElse(),
- }) =>
- throw _privateConstructorUsedError;
-}
-
-/// @nodoc
-abstract class $RecipeCreateStateCopyWith<$Res> {
- factory $RecipeCreateStateCopyWith(
- RecipeCreateState value, $Res Function(RecipeCreateState) then) =
- _$RecipeCreateStateCopyWithImpl<$Res, RecipeCreateState>;
-}
-
-/// @nodoc
-class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState>
- implements $RecipeCreateStateCopyWith<$Res> {
- _$RecipeCreateStateCopyWithImpl(this._value, this._then);
-
- // ignore: unused_field
- final $Val _value;
- // ignore: unused_field
- final $Res Function($Val) _then;
-
- /// Create a copy of RecipeCreateState
- /// with the given fields replaced by the non-null parameter values.
-}
-
-/// @nodoc
-abstract class _$$RecipeCreateStateImplCopyWith<$Res> {
- factory _$$RecipeCreateStateImplCopyWith(_$RecipeCreateStateImpl value,
- $Res Function(_$RecipeCreateStateImpl) then) =
- __$$RecipeCreateStateImplCopyWithImpl<$Res>;
-}
-
-/// @nodoc
-class __$$RecipeCreateStateImplCopyWithImpl<$Res>
- extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateImpl>
- implements _$$RecipeCreateStateImplCopyWith<$Res> {
- __$$RecipeCreateStateImplCopyWithImpl(_$RecipeCreateStateImpl _value,
- $Res Function(_$RecipeCreateStateImpl) _then)
- : super(_value, _then);
-
- /// Create a copy of RecipeCreateState
- /// with the given fields replaced by the non-null parameter values.
-}
-
-/// @nodoc
-
-class _$RecipeCreateStateImpl implements _RecipeCreateState {
- const _$RecipeCreateStateImpl();
-
- @override
- String toString() {
- return 'RecipeCreateState()';
- }
-
- @override
- bool operator ==(Object other) {
- return identical(this, other) ||
- (other.runtimeType == runtimeType && other is _$RecipeCreateStateImpl);
- }
-
- @override
- int get hashCode => runtimeType.hashCode;
-
- @override
- @optionalTypeArgs
- TResult when(
- TResult Function() $default, {
- required TResult Function() loading,
- required TResult Function(
- RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus)
- loaded,
- required TResult Function(String errorMessage) error,
- }) {
- return $default();
- }
-
- @override
- @optionalTypeArgs
- TResult? whenOrNull(
- TResult? Function()? $default, {
- TResult? Function()? loading,
- TResult? Function(
- RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus)?
- loaded,
- TResult? Function(String errorMessage)? error,
- }) {
- return $default?.call();
- }
-
- @override
- @optionalTypeArgs
- TResult maybeWhen(
- TResult Function()? $default, {
- TResult Function()? loading,
- TResult Function(
- RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus)?
- loaded,
- TResult Function(String errorMessage)? error,
- required TResult orElse(),
- }) {
- if ($default != null) {
- return $default();
- }
- return orElse();
- }
-
- @override
- @optionalTypeArgs
- TResult map(
- TResult Function(_RecipeCreateState value) $default, {
- required TResult Function(RecipeCreateStateLoading value) loading,
- required TResult Function(RecipeCreateStateLoaded value) loaded,
- required TResult Function(RecipeCreateStateError value) error,
- }) {
- return $default(this);
- }
-
- @override
- @optionalTypeArgs
- TResult? mapOrNull(
- TResult? Function(_RecipeCreateState value)? $default, {
- TResult? Function(RecipeCreateStateLoading value)? loading,
- TResult? Function(RecipeCreateStateLoaded value)? loaded,
- TResult? Function(RecipeCreateStateError value)? error,
- }) {
- return $default?.call(this);
- }
-
- @override
- @optionalTypeArgs
- TResult maybeMap(
- TResult Function(_RecipeCreateState value)? $default, {
- TResult Function(RecipeCreateStateLoading value)? loading,
- TResult Function(RecipeCreateStateLoaded value)? loaded,
- TResult Function(RecipeCreateStateError value)? error,
- required TResult orElse(),
- }) {
- if ($default != null) {
- return $default(this);
- }
- return orElse();
- }
-}
-
-abstract class _RecipeCreateState implements RecipeCreateState {
- const factory _RecipeCreateState() = _$RecipeCreateStateImpl;
-}
-
-/// @nodoc
-abstract class _$$RecipeCreateStateLoadingImplCopyWith<$Res> {
- factory _$$RecipeCreateStateLoadingImplCopyWith(
- _$RecipeCreateStateLoadingImpl value,
- $Res Function(_$RecipeCreateStateLoadingImpl) then) =
- __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res>;
-}
-
-/// @nodoc
-class __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res>
- extends _$RecipeCreateStateCopyWithImpl<$Res,
- _$RecipeCreateStateLoadingImpl>
- implements _$$RecipeCreateStateLoadingImplCopyWith<$Res> {
- __$$RecipeCreateStateLoadingImplCopyWithImpl(
- _$RecipeCreateStateLoadingImpl _value,
- $Res Function(_$RecipeCreateStateLoadingImpl) _then)
- : super(_value, _then);
-
- /// Create a copy of RecipeCreateState
- /// with the given fields replaced by the non-null parameter values.
-}
-
-/// @nodoc
-
-class _$RecipeCreateStateLoadingImpl implements RecipeCreateStateLoading {
- const _$RecipeCreateStateLoadingImpl();
-
- @override
- String toString() {
- return 'RecipeCreateState.loading()';
- }
-
- @override
- bool operator ==(Object other) {
- return identical(this, other) ||
- (other.runtimeType == runtimeType &&
- other is _$RecipeCreateStateLoadingImpl);
- }
-
- @override
- int get hashCode => runtimeType.hashCode;
-
- @override
- @optionalTypeArgs
- TResult when(
- TResult Function() $default, {
- required TResult Function() loading,
- required TResult Function(
- RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus)
- loaded,
- required TResult Function(String errorMessage) error,
- }) {
- return loading();
- }
-
- @override
- @optionalTypeArgs
- TResult? whenOrNull(
- TResult? Function()? $default, {
- TResult? Function()? loading,
- TResult? Function(
- RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus)?
- loaded,
- TResult? Function(String errorMessage)? error,
- }) {
- return loading?.call();
- }
-
- @override
- @optionalTypeArgs
- TResult maybeWhen(
- TResult Function()? $default, {
- TResult Function()? loading,
- TResult Function(
- RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus)?
- loaded,
- TResult Function(String errorMessage)? error,
- required TResult orElse(),
- }) {
- if (loading != null) {
- return loading();
- }
- return orElse();
- }
-
- @override
- @optionalTypeArgs
- TResult map(
- TResult Function(_RecipeCreateState value) $default, {
- required TResult Function(RecipeCreateStateLoading value) loading,
- required TResult Function(RecipeCreateStateLoaded value) loaded,
- required TResult Function(RecipeCreateStateError value) error,
- }) {
- return loading(this);
- }
-
- @override
- @optionalTypeArgs
- TResult? mapOrNull(
- TResult? Function(_RecipeCreateState value)? $default, {
- TResult? Function(RecipeCreateStateLoading value)? loading,
- TResult? Function(RecipeCreateStateLoaded value)? loaded,
- TResult? Function(RecipeCreateStateError value)? error,
- }) {
- return loading?.call(this);
- }
-
- @override
- @optionalTypeArgs
- TResult maybeMap(
- TResult Function(_RecipeCreateState value)? $default, {
- TResult Function(RecipeCreateStateLoading value)? loading,
- TResult Function(RecipeCreateStateLoaded value)? loaded,
- TResult Function(RecipeCreateStateError value)? error,
- required TResult orElse(),
- }) {
- if (loading != null) {
- return loading(this);
- }
- return orElse();
- }
-}
-
-abstract class RecipeCreateStateLoading implements RecipeCreateState {
- const factory RecipeCreateStateLoading() = _$RecipeCreateStateLoadingImpl;
-}
-
-/// @nodoc
-abstract class _$$RecipeCreateStateLoadedImplCopyWith<$Res> {
- factory _$$RecipeCreateStateLoadedImplCopyWith(
- _$RecipeCreateStateLoadedImpl value,
- $Res Function(_$RecipeCreateStateLoadedImpl) then) =
- __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>;
- @useResult
- $Res call(
- {RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus});
-
- $RecipeModelCopyWith<$Res>? get recipe;
- $SelectionPopupModelCopyWith<$Res> get selectedType;
- $SelectionPopupModelCopyWith<$Res> get selectedCookingTime;
- $SelectionPopupModelCopyWith<$Res> get selectedStatus;
-}
-
-/// @nodoc
-class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>
- extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateLoadedImpl>
- implements _$$RecipeCreateStateLoadedImplCopyWith<$Res> {
- __$$RecipeCreateStateLoadedImplCopyWithImpl(
- _$RecipeCreateStateLoadedImpl _value,
- $Res Function(_$RecipeCreateStateLoadedImpl) _then)
- : super(_value, _then);
-
- /// Create a copy of RecipeCreateState
- /// with the given fields replaced by the non-null parameter values.
- @pragma('vm:prefer-inline')
- @override
- $Res call({
- Object? recipe = freezed,
- Object? picker = null,
- Object? titleController = null,
- Object? productNameController = null,
- Object? ingredientController = null,
- Object? stepDescriptionController = null,
- Object? videoLinkController = null,
- Object? stepControllers = null,
- Object? recipeImage = freezed,
- Object? stepImages = null,
- Object? ingredients = null,
- Object? autocompleteList = null,
- Object? numberOfSteps = null,
- Object? ingredientAsItems = null,
- Object? types = null,
- Object? cookingTimes = null,
- Object? statuses = null,
- Object? selectedType = null,
- Object? selectedCookingTime = null,
- Object? selectedStatus = null,
- }) {
- return _then(_$RecipeCreateStateLoadedImpl(
- recipe: freezed == recipe
- ? _value.recipe
- : recipe // ignore: cast_nullable_to_non_nullable
- as RecipeModel?,
- picker: null == picker
- ? _value.picker
- : picker // ignore: cast_nullable_to_non_nullable
- as ImagePicker,
- titleController: null == titleController
- ? _value.titleController
- : titleController // ignore: cast_nullable_to_non_nullable
- as TextEditingController,
- productNameController: null == productNameController
- ? _value.productNameController
- : productNameController // ignore: cast_nullable_to_non_nullable
- as TextEditingController,
- ingredientController: null == ingredientController
- ? _value.ingredientController
- : ingredientController // ignore: cast_nullable_to_non_nullable
- as TextEditingController,
- stepDescriptionController: null == stepDescriptionController
- ? _value.stepDescriptionController
- : stepDescriptionController // ignore: cast_nullable_to_non_nullable
- as TextEditingController,
- videoLinkController: null == videoLinkController
- ? _value.videoLinkController
- : videoLinkController // ignore: cast_nullable_to_non_nullable
- as TextEditingController,
- stepControllers: null == stepControllers
- ? _value._stepControllers
- : stepControllers // ignore: cast_nullable_to_non_nullable
- as List,
- recipeImage: freezed == recipeImage
- ? _value.recipeImage
- : recipeImage // ignore: cast_nullable_to_non_nullable
- as XFile?,
- stepImages: null == stepImages
- ? _value._stepImages
- : stepImages // ignore: cast_nullable_to_non_nullable
- as List,
- ingredients: null == ingredients
- ? _value._ingredients
- : ingredients // ignore: cast_nullable_to_non_nullable
- as List,
- autocompleteList: null == autocompleteList
- ? _value._autocompleteList
- : autocompleteList // ignore: cast_nullable_to_non_nullable
- as List,
- numberOfSteps: null == numberOfSteps
- ? _value.numberOfSteps
- : numberOfSteps // ignore: cast_nullable_to_non_nullable
- as int,
- ingredientAsItems: null == ingredientAsItems
- ? _value.ingredientAsItems
- : ingredientAsItems // ignore: cast_nullable_to_non_nullable
- as bool,
- types: null == types
- ? _value._types
- : types // ignore: cast_nullable_to_non_nullable
- as List,
- cookingTimes: null == cookingTimes
- ? _value._cookingTimes
- : cookingTimes // ignore: cast_nullable_to_non_nullable
- as List,
- statuses: null == statuses
- ? _value._statuses
- : statuses // ignore: cast_nullable_to_non_nullable
- as List,
- selectedType: null == selectedType
- ? _value.selectedType
- : selectedType // ignore: cast_nullable_to_non_nullable
- as SelectionPopupModel,
- selectedCookingTime: null == selectedCookingTime
- ? _value.selectedCookingTime
- : selectedCookingTime // ignore: cast_nullable_to_non_nullable
- as SelectionPopupModel,
- selectedStatus: null == selectedStatus
- ? _value.selectedStatus
- : selectedStatus // ignore: cast_nullable_to_non_nullable
- as SelectionPopupModel,
- ));
- }
-
- /// Create a copy of RecipeCreateState
- /// with the given fields replaced by the non-null parameter values.
- @override
- @pragma('vm:prefer-inline')
- $RecipeModelCopyWith<$Res>? get recipe {
- if (_value.recipe == null) {
- return null;
- }
-
- return $RecipeModelCopyWith<$Res>(_value.recipe!, (value) {
- return _then(_value.copyWith(recipe: value));
- });
- }
-
- /// Create a copy of RecipeCreateState
- /// with the given fields replaced by the non-null parameter values.
- @override
- @pragma('vm:prefer-inline')
- $SelectionPopupModelCopyWith<$Res> get selectedType {
- return $SelectionPopupModelCopyWith<$Res>(_value.selectedType, (value) {
- return _then(_value.copyWith(selectedType: value));
- });
- }
-
- /// Create a copy of RecipeCreateState
- /// with the given fields replaced by the non-null parameter values.
- @override
- @pragma('vm:prefer-inline')
- $SelectionPopupModelCopyWith<$Res> get selectedCookingTime {
- return $SelectionPopupModelCopyWith<$Res>(_value.selectedCookingTime,
- (value) {
- return _then(_value.copyWith(selectedCookingTime: value));
- });
- }
-
- /// Create a copy of RecipeCreateState
- /// with the given fields replaced by the non-null parameter values.
- @override
- @pragma('vm:prefer-inline')
- $SelectionPopupModelCopyWith<$Res> get selectedStatus {
- return $SelectionPopupModelCopyWith<$Res>(_value.selectedStatus, (value) {
- return _then(_value.copyWith(selectedStatus: value));
- });
- }
-}
-
-/// @nodoc
-
-class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
- const _$RecipeCreateStateLoadedImpl(
- {this.recipe,
- required this.picker,
- required this.titleController,
- required this.productNameController,
- required this.ingredientController,
- required this.stepDescriptionController,
- required this.videoLinkController,
- required final List stepControllers,
- this.recipeImage,
- required final List stepImages,
- required final List ingredients,
- required final List autocompleteList,
- required this.numberOfSteps,
- required this.ingredientAsItems,
- required final List types,
- required final List cookingTimes,
- required final List statuses,
- required this.selectedType,
- required this.selectedCookingTime,
- required this.selectedStatus})
- : _stepControllers = stepControllers,
- _stepImages = stepImages,
- _ingredients = ingredients,
- _autocompleteList = autocompleteList,
- _types = types,
- _cookingTimes = cookingTimes,
- _statuses = statuses;
-
- @override
- final RecipeModel? recipe;
- @override
- final ImagePicker picker;
- @override
- final TextEditingController titleController;
- @override
- final TextEditingController productNameController;
- @override
- final TextEditingController ingredientController;
- @override
- final TextEditingController stepDescriptionController;
- @override
- final TextEditingController videoLinkController;
- final List _stepControllers;
- @override
- List get stepControllers {
- if (_stepControllers is EqualUnmodifiableListView) return _stepControllers;
- // ignore: implicit_dynamic_type
- return EqualUnmodifiableListView(_stepControllers);
- }
-
- @override
- final XFile? recipeImage;
- final List _stepImages;
- @override
- List get stepImages {
- if (_stepImages is EqualUnmodifiableListView) return _stepImages;
- // ignore: implicit_dynamic_type
- return EqualUnmodifiableListView(_stepImages);
- }
-
- final List _ingredients;
- @override
- List get ingredients {
- if (_ingredients is EqualUnmodifiableListView) return _ingredients;
- // ignore: implicit_dynamic_type
- return EqualUnmodifiableListView(_ingredients);
- }
-
- final List _autocompleteList;
- @override
- List get autocompleteList {
- if (_autocompleteList is EqualUnmodifiableListView)
- return _autocompleteList;
- // ignore: implicit_dynamic_type
- return EqualUnmodifiableListView(_autocompleteList);
- }
-
- @override
- final int numberOfSteps;
- @override
- final bool ingredientAsItems;
- final List _types;
- @override
- List get types {
- if (_types is EqualUnmodifiableListView) return _types;
- // ignore: implicit_dynamic_type
- return EqualUnmodifiableListView(_types);
- }
-
- final List _cookingTimes;
- @override
- List get cookingTimes {
- if (_cookingTimes is EqualUnmodifiableListView) return _cookingTimes;
- // ignore: implicit_dynamic_type
- return EqualUnmodifiableListView(_cookingTimes);
- }
-
- final List _statuses;
- @override
- List get statuses {
- if (_statuses is EqualUnmodifiableListView) return _statuses;
- // ignore: implicit_dynamic_type
- return EqualUnmodifiableListView(_statuses);
- }
-
- @override
- final SelectionPopupModel selectedType;
- @override
- final SelectionPopupModel selectedCookingTime;
- @override
- final SelectionPopupModel selectedStatus;
-
- @override
- String toString() {
- return 'RecipeCreateState.loaded(recipe: $recipe, picker: $picker, titleController: $titleController, productNameController: $productNameController, ingredientController: $ingredientController, stepDescriptionController: $stepDescriptionController, videoLinkController: $videoLinkController, stepControllers: $stepControllers, recipeImage: $recipeImage, stepImages: $stepImages, ingredients: $ingredients, autocompleteList: $autocompleteList, numberOfSteps: $numberOfSteps, ingredientAsItems: $ingredientAsItems, types: $types, cookingTimes: $cookingTimes, statuses: $statuses, selectedType: $selectedType, selectedCookingTime: $selectedCookingTime, selectedStatus: $selectedStatus)';
- }
-
- @override
- bool operator ==(Object other) {
- return identical(this, other) ||
- (other.runtimeType == runtimeType &&
- other is _$RecipeCreateStateLoadedImpl &&
- (identical(other.recipe, recipe) || other.recipe == recipe) &&
- (identical(other.picker, picker) || other.picker == picker) &&
- (identical(other.titleController, titleController) ||
- other.titleController == titleController) &&
- (identical(other.productNameController, productNameController) ||
- other.productNameController == productNameController) &&
- (identical(other.ingredientController, ingredientController) ||
- other.ingredientController == ingredientController) &&
- (identical(other.stepDescriptionController,
- stepDescriptionController) ||
- other.stepDescriptionController == stepDescriptionController) &&
- (identical(other.videoLinkController, videoLinkController) ||
- other.videoLinkController == videoLinkController) &&
- const DeepCollectionEquality()
- .equals(other._stepControllers, _stepControllers) &&
- (identical(other.recipeImage, recipeImage) ||
- other.recipeImage == recipeImage) &&
- const DeepCollectionEquality()
- .equals(other._stepImages, _stepImages) &&
- const DeepCollectionEquality()
- .equals(other._ingredients, _ingredients) &&
- const DeepCollectionEquality()
- .equals(other._autocompleteList, _autocompleteList) &&
- (identical(other.numberOfSteps, numberOfSteps) ||
- other.numberOfSteps == numberOfSteps) &&
- (identical(other.ingredientAsItems, ingredientAsItems) ||
- other.ingredientAsItems == ingredientAsItems) &&
- const DeepCollectionEquality().equals(other._types, _types) &&
- const DeepCollectionEquality()
- .equals(other._cookingTimes, _cookingTimes) &&
- const DeepCollectionEquality().equals(other._statuses, _statuses) &&
- (identical(other.selectedType, selectedType) ||
- other.selectedType == selectedType) &&
- (identical(other.selectedCookingTime, selectedCookingTime) ||
- other.selectedCookingTime == selectedCookingTime) &&
- (identical(other.selectedStatus, selectedStatus) ||
- other.selectedStatus == selectedStatus));
- }
-
- @override
- int get hashCode => Object.hashAll([
- runtimeType,
- recipe,
- picker,
- titleController,
- productNameController,
- ingredientController,
- stepDescriptionController,
- videoLinkController,
- const DeepCollectionEquality().hash(_stepControllers),
- recipeImage,
- const DeepCollectionEquality().hash(_stepImages),
- const DeepCollectionEquality().hash(_ingredients),
- const DeepCollectionEquality().hash(_autocompleteList),
- numberOfSteps,
- ingredientAsItems,
- const DeepCollectionEquality().hash(_types),
- const DeepCollectionEquality().hash(_cookingTimes),
- const DeepCollectionEquality().hash(_statuses),
- selectedType,
- selectedCookingTime,
- selectedStatus
- ]);
-
- /// Create a copy of RecipeCreateState
- /// with the given fields replaced by the non-null parameter values.
- @JsonKey(includeFromJson: false, includeToJson: false)
- @override
- @pragma('vm:prefer-inline')
- _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl>
- get copyWith => __$$RecipeCreateStateLoadedImplCopyWithImpl<
- _$RecipeCreateStateLoadedImpl>(this, _$identity);
-
- @override
- @optionalTypeArgs
- TResult when(
- TResult Function() $default, {
- required TResult Function() loading,
- required TResult Function(
- RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus)
- loaded,
- required TResult Function(String errorMessage) error,
- }) {
- return loaded(
- recipe,
- picker,
- titleController,
- productNameController,
- ingredientController,
- stepDescriptionController,
- videoLinkController,
- stepControllers,
- recipeImage,
- stepImages,
- ingredients,
- autocompleteList,
- numberOfSteps,
- ingredientAsItems,
- types,
- cookingTimes,
- statuses,
- selectedType,
- selectedCookingTime,
- selectedStatus);
- }
-
- @override
- @optionalTypeArgs
- TResult? whenOrNull(
- TResult? Function()? $default, {
- TResult? Function()? loading,
- TResult? Function(
- RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus)?
- loaded,
- TResult? Function(String errorMessage)? error,
- }) {
- return loaded?.call(
- recipe,
- picker,
- titleController,
- productNameController,
- ingredientController,
- stepDescriptionController,
- videoLinkController,
- stepControllers,
- recipeImage,
- stepImages,
- ingredients,
- autocompleteList,
- numberOfSteps,
- ingredientAsItems,
- types,
- cookingTimes,
- statuses,
- selectedType,
- selectedCookingTime,
- selectedStatus);
- }
-
- @override
- @optionalTypeArgs
- TResult maybeWhen(
- TResult Function()? $default, {
- TResult Function()? loading,
- TResult Function(
- RecipeModel? recipe,
- ImagePicker picker,
- TextEditingController titleController,
- TextEditingController productNameController,
- TextEditingController ingredientController,
- TextEditingController stepDescriptionController,
- TextEditingController videoLinkController,
- List stepControllers,
- XFile? recipeImage,
- List stepImages,
- List ingredients,
- List autocompleteList,
- int numberOfSteps,
- bool ingredientAsItems,
- List types,
- List cookingTimes,
- List statuses,
- SelectionPopupModel selectedType,
- SelectionPopupModel selectedCookingTime,
- SelectionPopupModel selectedStatus)?
- loaded,
- TResult Function(String errorMessage)? error,
- required TResult orElse(),
- }) {
- if (loaded != null) {
- return loaded(
- recipe,
- picker,
- titleController,
- productNameController,
- ingredientController,
- stepDescriptionController,
- videoLinkController,
- stepControllers,
- recipeImage,
- stepImages,
- ingredients,
- autocompleteList,
- numberOfSteps,
- ingredientAsItems,
- types,
- cookingTimes,
- statuses,
- selectedType,
- selectedCookingTime,
- selectedStatus);
- }
- return orElse();
- }
-
- @override
- @optionalTypeArgs
- TResult map(
- TResult Function(_RecipeCreateState value) $default, {
- required TResult Function(RecipeCreateStateLoading value) loading,
- required TResult Function(RecipeCreateStateLoaded value) loaded,
- required TResult Function(RecipeCreateStateError value) error,
- }) {
- return loaded(this);
- }
-
- @override
- @optionalTypeArgs
- TResult? mapOrNull(
- TResult? Function(_RecipeCreateState value)? $default, {
- TResult? Function(RecipeCreateStateLoading value)? loading,
- TResult? Function(RecipeCreateStateLoaded value)? loaded,
- TResult? Function(RecipeCreateStateError value)? error,
- }) {
- return loaded?.call(this);
- }
-
- @override
- @optionalTypeArgs
- TResult maybeMap(
- TResult Function(_RecipeCreateState value)? $default, {
- TResult Function(RecipeCreateStateLoading value)? loading,
- TResult Function(RecipeCreateStateLoaded value)? loaded,
- TResult Function(RecipeCreateStateError value)? error,
- required TResult orElse(),
- }) {
- if (loaded != null) {
- return loaded(this);
- }
- return orElse();
- }
-}
-
-abstract class RecipeCreateStateLoaded implements RecipeCreateState {
- const factory RecipeCreateStateLoaded(
- {final RecipeModel? recipe,
- required final ImagePicker picker,
- required final TextEditingController titleController,
- required final TextEditingController productNameController,
- required final TextEditingController ingredientController,
- required final TextEditingController stepDescriptionController,
- required final TextEditingController videoLinkController,
- required final List stepControllers,
- final XFile? recipeImage,
- required final List stepImages,
- required final List ingredients,
- required final List autocompleteList,
- required final int numberOfSteps,
- required final bool ingredientAsItems,
- required final List types,
- required final List cookingTimes,
- required final List