refactor: remove unused elements

This commit is contained in:
mso7nueh
2024-09-11 16:39:15 +03:00
parent 09cfacb022
commit 69472f422e
182 changed files with 2443 additions and 5482 deletions

View File

@@ -45,6 +45,7 @@ mixin _$RecipeCreateState {
required TResult Function(String errorMessage) error,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
@@ -133,18 +134,16 @@ 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;
@@ -154,18 +153,14 @@ class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState>
/// @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.
@@ -183,8 +178,7 @@ 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
@@ -334,20 +328,14 @@ 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
@@ -366,9 +354,7 @@ 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
@@ -518,10 +504,9 @@ 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,
@@ -546,19 +531,18 @@ 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.
@@ -699,8 +683,7 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>
@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));
});
}
@@ -763,6 +746,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
@override
final TextEditingController youtubeLinkController;
final List<TextEditingController> _stepControllers;
@override
List<TextEditingController> get stepControllers {
if (_stepControllers is EqualUnmodifiableListView) return _stepControllers;
@@ -773,6 +757,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
@override
final XFile? recipeImage;
final List<XFile?> _stepImages;
@override
List<XFile?> get stepImages {
if (_stepImages is EqualUnmodifiableListView) return _stepImages;
@@ -781,6 +766,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
}
final List<Ingredient> _ingredients;
@override
List<Ingredient> get ingredients {
if (_ingredients is EqualUnmodifiableListView) return _ingredients;
@@ -789,10 +775,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);
}
@@ -802,6 +788,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
@override
final bool ingredientAsItems;
final List<SelectionPopupModel> _types;
@override
List<SelectionPopupModel> get types {
if (_types is EqualUnmodifiableListView) return _types;
@@ -810,6 +797,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
}
final List<SelectionPopupModel> _cookingTimes;
@override
List<SelectionPopupModel> get cookingTimes {
if (_cookingTimes is EqualUnmodifiableListView) return _cookingTimes;
@@ -818,6 +806,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
}
final List<SelectionPopupModel> _statuses;
@override
List<SelectionPopupModel> get statuses {
if (_statuses is EqualUnmodifiableListView) return _statuses;
@@ -844,41 +833,24 @@ 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
@@ -911,9 +883,8 @@ 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
@@ -1115,74 +1086,86 @@ 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.
@@ -1218,8 +1201,7 @@ 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
@@ -1230,9 +1212,8 @@ 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
@@ -1373,14 +1354,12 @@ 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;
}

View File

@@ -19,10 +19,12 @@ import 'package:image_picker/image_picker.dart';
// ignore: must_be_immutable
class RecipeEditScreen extends StatelessWidget {
final String recipeID;
const RecipeEditScreen({
required this.recipeID,
super.key,
});
Widget build(BuildContext context) {
if (recipeID != "0") {
context.read<RecipeCreateCubit>().loadRecipeById(recipeID);