feat(profile): add profile charts models, requests. Max length of description in posts, recipes, diets = 200

This commit is contained in:
mso7nueh
2024-09-13 14:22:57 +03:00
parent a826cba866
commit c800d35663
111 changed files with 5760 additions and 3215 deletions

View File

@@ -45,7 +45,6 @@ mixin _$RecipeCreateState {
required TResult Function(String errorMessage) error,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
@@ -134,16 +133,18 @@ mixin _$RecipeCreateState {
/// @nodoc
abstract class $RecipeCreateStateCopyWith<$Res> {
factory $RecipeCreateStateCopyWith(RecipeCreateState value, $Res Function(RecipeCreateState) then) = _$RecipeCreateStateCopyWithImpl<$Res, RecipeCreateState>;
factory $RecipeCreateStateCopyWith(
RecipeCreateState value, $Res Function(RecipeCreateState) then) =
_$RecipeCreateStateCopyWithImpl<$Res, RecipeCreateState>;
}
/// @nodoc
class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> implements $RecipeCreateStateCopyWith<$Res> {
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;
@@ -153,14 +154,18 @@ class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> impl
/// @nodoc
abstract class _$$RecipeCreateStateImplCopyWith<$Res> {
factory _$$RecipeCreateStateImplCopyWith(_$RecipeCreateStateImpl value, $Res Function(_$RecipeCreateStateImpl) then) =
factory _$$RecipeCreateStateImplCopyWith(_$RecipeCreateStateImpl value,
$Res Function(_$RecipeCreateStateImpl) then) =
__$$RecipeCreateStateImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$RecipeCreateStateImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateImpl>
class __$$RecipeCreateStateImplCopyWithImpl<$Res>
extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateImpl>
implements _$$RecipeCreateStateImplCopyWith<$Res> {
__$$RecipeCreateStateImplCopyWithImpl(_$RecipeCreateStateImpl _value, $Res Function(_$RecipeCreateStateImpl) _then) : super(_value, _then);
__$$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.
@@ -178,7 +183,8 @@ class _$RecipeCreateStateImpl implements _RecipeCreateState {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeCreateStateImpl);
return identical(this, other) ||
(other.runtimeType == runtimeType && other is _$RecipeCreateStateImpl);
}
@override
@@ -328,14 +334,20 @@ abstract class _RecipeCreateState implements RecipeCreateState {
/// @nodoc
abstract class _$$RecipeCreateStateLoadingImplCopyWith<$Res> {
factory _$$RecipeCreateStateLoadingImplCopyWith(_$RecipeCreateStateLoadingImpl value, $Res Function(_$RecipeCreateStateLoadingImpl) then) =
factory _$$RecipeCreateStateLoadingImplCopyWith(
_$RecipeCreateStateLoadingImpl value,
$Res Function(_$RecipeCreateStateLoadingImpl) then) =
__$$RecipeCreateStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateLoadingImpl>
class __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res>
extends _$RecipeCreateStateCopyWithImpl<$Res,
_$RecipeCreateStateLoadingImpl>
implements _$$RecipeCreateStateLoadingImplCopyWith<$Res> {
__$$RecipeCreateStateLoadingImplCopyWithImpl(_$RecipeCreateStateLoadingImpl _value, $Res Function(_$RecipeCreateStateLoadingImpl) _then)
__$$RecipeCreateStateLoadingImplCopyWithImpl(
_$RecipeCreateStateLoadingImpl _value,
$Res Function(_$RecipeCreateStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeCreateState
@@ -354,7 +366,9 @@ class _$RecipeCreateStateLoadingImpl implements RecipeCreateStateLoading {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeCreateStateLoadingImpl);
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$RecipeCreateStateLoadingImpl);
}
@override
@@ -504,9 +518,10 @@ abstract class RecipeCreateStateLoading implements RecipeCreateState {
/// @nodoc
abstract class _$$RecipeCreateStateLoadedImplCopyWith<$Res> {
factory _$$RecipeCreateStateLoadedImplCopyWith(_$RecipeCreateStateLoadedImpl value, $Res Function(_$RecipeCreateStateLoadedImpl) then) =
factory _$$RecipeCreateStateLoadedImplCopyWith(
_$RecipeCreateStateLoadedImpl value,
$Res Function(_$RecipeCreateStateLoadedImpl) then) =
__$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call(
{RecipeModel? recipe,
@@ -531,18 +546,19 @@ abstract class _$$RecipeCreateStateLoadedImplCopyWith<$Res> {
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>
class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>
extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateLoadedImpl>
implements _$$RecipeCreateStateLoadedImplCopyWith<$Res> {
__$$RecipeCreateStateLoadedImplCopyWithImpl(_$RecipeCreateStateLoadedImpl _value, $Res Function(_$RecipeCreateStateLoadedImpl) _then) : super(_value, _then);
__$$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.
@@ -683,7 +699,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> extends _$RecipeCreateSt
@override
@pragma('vm:prefer-inline')
$SelectionPopupModelCopyWith<$Res> get selectedCookingTime {
return $SelectionPopupModelCopyWith<$Res>(_value.selectedCookingTime, (value) {
return $SelectionPopupModelCopyWith<$Res>(_value.selectedCookingTime,
(value) {
return _then(_value.copyWith(selectedCookingTime: value));
});
}
@@ -746,7 +763,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
@override
final TextEditingController youtubeLinkController;
final List<TextEditingController> _stepControllers;
@override
List<TextEditingController> get stepControllers {
if (_stepControllers is EqualUnmodifiableListView) return _stepControllers;
@@ -757,7 +773,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
@override
final XFile? recipeImage;
final List<XFile?> _stepImages;
@override
List<XFile?> get stepImages {
if (_stepImages is EqualUnmodifiableListView) return _stepImages;
@@ -766,7 +781,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
}
final List<Ingredient> _ingredients;
@override
List<Ingredient> get ingredients {
if (_ingredients is EqualUnmodifiableListView) return _ingredients;
@@ -775,10 +789,10 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
}
final List<Product> _autocompleteList;
@override
List<Product> get autocompleteList {
if (_autocompleteList is EqualUnmodifiableListView) return _autocompleteList;
if (_autocompleteList is EqualUnmodifiableListView)
return _autocompleteList;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_autocompleteList);
}
@@ -788,7 +802,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
@override
final bool ingredientAsItems;
final List<SelectionPopupModel> _types;
@override
List<SelectionPopupModel> get types {
if (_types is EqualUnmodifiableListView) return _types;
@@ -797,7 +810,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
}
final List<SelectionPopupModel> _cookingTimes;
@override
List<SelectionPopupModel> get cookingTimes {
if (_cookingTimes is EqualUnmodifiableListView) return _cookingTimes;
@@ -806,7 +818,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
}
final List<SelectionPopupModel> _statuses;
@override
List<SelectionPopupModel> get statuses {
if (_statuses is EqualUnmodifiableListView) return _statuses;
@@ -833,24 +844,41 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
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.youtubeLinkController, youtubeLinkController) || other.youtubeLinkController == youtubeLinkController) &&
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) &&
(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.youtubeLinkController, youtubeLinkController) ||
other.youtubeLinkController == youtubeLinkController) &&
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._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));
(identical(other.selectedType, selectedType) ||
other.selectedType == selectedType) &&
(identical(other.selectedCookingTime, selectedCookingTime) ||
other.selectedCookingTime == selectedCookingTime) &&
(identical(other.selectedStatus, selectedStatus) ||
other.selectedStatus == selectedStatus));
}
@override
@@ -883,8 +911,9 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> get copyWith =>
__$$RecipeCreateStateLoadedImplCopyWithImpl<_$RecipeCreateStateLoadedImpl>(this, _$identity);
_$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl>
get copyWith => __$$RecipeCreateStateLoadedImplCopyWithImpl<
_$RecipeCreateStateLoadedImpl>(this, _$identity);
@override
@optionalTypeArgs
@@ -1086,86 +1115,74 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
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 youtubeLinkController,
required final List<TextEditingController> stepControllers,
final XFile? recipeImage,
required final List<XFile?> stepImages,
required final List<Ingredient> ingredients,
required final List<Product> autocompleteList,
required final int numberOfSteps,
required final bool ingredientAsItems,
required final List<SelectionPopupModel> types,
required final List<SelectionPopupModel> cookingTimes,
required final List<SelectionPopupModel> statuses,
required final SelectionPopupModel selectedType,
required final SelectionPopupModel selectedCookingTime,
required final SelectionPopupModel selectedStatus}) = _$RecipeCreateStateLoadedImpl;
{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 youtubeLinkController,
required final List<TextEditingController> stepControllers,
final XFile? recipeImage,
required final List<XFile?> stepImages,
required final List<Ingredient> ingredients,
required final List<Product> autocompleteList,
required final int numberOfSteps,
required final bool ingredientAsItems,
required final List<SelectionPopupModel> types,
required final List<SelectionPopupModel> cookingTimes,
required final List<SelectionPopupModel> statuses,
required final SelectionPopupModel selectedType,
required final SelectionPopupModel selectedCookingTime,
required final SelectionPopupModel selectedStatus}) =
_$RecipeCreateStateLoadedImpl;
RecipeModel? get recipe;
ImagePicker get picker;
TextEditingController get titleController;
TextEditingController get productNameController;
TextEditingController get ingredientController;
TextEditingController get stepDescriptionController;
TextEditingController get youtubeLinkController;
List<TextEditingController> get stepControllers;
XFile? get recipeImage;
List<XFile?> get stepImages;
List<Ingredient> get ingredients;
List<Product> get autocompleteList;
int get numberOfSteps;
bool get ingredientAsItems;
List<SelectionPopupModel> get types;
List<SelectionPopupModel> get cookingTimes;
List<SelectionPopupModel> get statuses;
SelectionPopupModel get selectedType;
SelectionPopupModel get selectedCookingTime;
SelectionPopupModel get selectedStatus;
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> get copyWith => throw _privateConstructorUsedError;
_$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl>
get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class _$$RecipeCreateStateErrorImplCopyWith<$Res> {
factory _$$RecipeCreateStateErrorImplCopyWith(_$RecipeCreateStateErrorImpl value, $Res Function(_$RecipeCreateStateErrorImpl) then) =
factory _$$RecipeCreateStateErrorImplCopyWith(
_$RecipeCreateStateErrorImpl value,
$Res Function(_$RecipeCreateStateErrorImpl) then) =
__$$RecipeCreateStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
/// @nodoc
class __$$RecipeCreateStateErrorImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateErrorImpl>
class __$$RecipeCreateStateErrorImplCopyWithImpl<$Res>
extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateErrorImpl>
implements _$$RecipeCreateStateErrorImplCopyWith<$Res> {
__$$RecipeCreateStateErrorImplCopyWithImpl(_$RecipeCreateStateErrorImpl _value, $Res Function(_$RecipeCreateStateErrorImpl) _then) : super(_value, _then);
__$$RecipeCreateStateErrorImplCopyWithImpl(
_$RecipeCreateStateErrorImpl _value,
$Res Function(_$RecipeCreateStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@@ -1201,7 +1218,8 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$RecipeCreateStateErrorImpl &&
(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage));
(identical(other.errorMessage, errorMessage) ||
other.errorMessage == errorMessage));
}
@override
@@ -1212,8 +1230,9 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> get copyWith =>
__$$RecipeCreateStateErrorImplCopyWithImpl<_$RecipeCreateStateErrorImpl>(this, _$identity);
_$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl>
get copyWith => __$$RecipeCreateStateErrorImplCopyWithImpl<
_$RecipeCreateStateErrorImpl>(this, _$identity);
@override
@optionalTypeArgs
@@ -1354,12 +1373,14 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError {
}
abstract class RecipeCreateStateError implements RecipeCreateState {
const factory RecipeCreateStateError({required final String errorMessage}) = _$RecipeCreateStateErrorImpl;
const factory RecipeCreateStateError({required final String errorMessage}) =
_$RecipeCreateStateErrorImpl;
String get errorMessage;
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> get copyWith => throw _privateConstructorUsedError;
_$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl>
get copyWith => throw _privateConstructorUsedError;
}