forked from eatvio/eatvio_app
fix: remove ignored files
This commit is contained in:
@@ -1,805 +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 'about_recipe_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(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 _$AboutRecipeState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() initial,
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Recipe recipe) loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? initial,
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Recipe recipe)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? initial,
|
||||
TResult Function()? loading,
|
||||
TResult Function(Recipe recipe)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value) $default, {
|
||||
required TResult Function(AboutRecipeStateInitial value) initial,
|
||||
required TResult Function(AboutRecipeStateLoading value) loading,
|
||||
required TResult Function(AboutRecipeStateLoaded value) loaded,
|
||||
required TResult Function(RecipeStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutRecipeState value)? $default, {
|
||||
TResult? Function(AboutRecipeStateInitial value)? initial,
|
||||
TResult? Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult? Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult? Function(RecipeStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value)? $default, {
|
||||
TResult Function(AboutRecipeStateInitial value)? initial,
|
||||
TResult Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult Function(RecipeStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $AboutRecipeStateCopyWith<$Res> {
|
||||
factory $AboutRecipeStateCopyWith(
|
||||
AboutRecipeState value, $Res Function(AboutRecipeState) then) =
|
||||
_$AboutRecipeStateCopyWithImpl<$Res, AboutRecipeState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$AboutRecipeStateCopyWithImpl<$Res, $Val extends AboutRecipeState>
|
||||
implements $AboutRecipeStateCopyWith<$Res> {
|
||||
_$AboutRecipeStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$AboutRecipeStateImplCopyWith<$Res> {
|
||||
factory _$$AboutRecipeStateImplCopyWith(_$AboutRecipeStateImpl value,
|
||||
$Res Function(_$AboutRecipeStateImpl) then) =
|
||||
__$$AboutRecipeStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$AboutRecipeStateImplCopyWithImpl<$Res>
|
||||
extends _$AboutRecipeStateCopyWithImpl<$Res, _$AboutRecipeStateImpl>
|
||||
implements _$$AboutRecipeStateImplCopyWith<$Res> {
|
||||
__$$AboutRecipeStateImplCopyWithImpl(_$AboutRecipeStateImpl _value,
|
||||
$Res Function(_$AboutRecipeStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$AboutRecipeStateImpl implements _AboutRecipeState {
|
||||
const _$AboutRecipeStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AboutRecipeState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$AboutRecipeStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() initial,
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Recipe recipe) loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? initial,
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Recipe recipe)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? initial,
|
||||
TResult Function()? loading,
|
||||
TResult Function(Recipe recipe)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value) $default, {
|
||||
required TResult Function(AboutRecipeStateInitial value) initial,
|
||||
required TResult Function(AboutRecipeStateLoading value) loading,
|
||||
required TResult Function(AboutRecipeStateLoaded value) loaded,
|
||||
required TResult Function(RecipeStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutRecipeState value)? $default, {
|
||||
TResult? Function(AboutRecipeStateInitial value)? initial,
|
||||
TResult? Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult? Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult? Function(RecipeStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value)? $default, {
|
||||
TResult Function(AboutRecipeStateInitial value)? initial,
|
||||
TResult Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult Function(RecipeStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _AboutRecipeState implements AboutRecipeState {
|
||||
const factory _AboutRecipeState() = _$AboutRecipeStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$AboutRecipeStateInitialImplCopyWith<$Res> {
|
||||
factory _$$AboutRecipeStateInitialImplCopyWith(
|
||||
_$AboutRecipeStateInitialImpl value,
|
||||
$Res Function(_$AboutRecipeStateInitialImpl) then) =
|
||||
__$$AboutRecipeStateInitialImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$AboutRecipeStateInitialImplCopyWithImpl<$Res>
|
||||
extends _$AboutRecipeStateCopyWithImpl<$Res, _$AboutRecipeStateInitialImpl>
|
||||
implements _$$AboutRecipeStateInitialImplCopyWith<$Res> {
|
||||
__$$AboutRecipeStateInitialImplCopyWithImpl(
|
||||
_$AboutRecipeStateInitialImpl _value,
|
||||
$Res Function(_$AboutRecipeStateInitialImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$AboutRecipeStateInitialImpl implements AboutRecipeStateInitial {
|
||||
const _$AboutRecipeStateInitialImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AboutRecipeState.initial()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$AboutRecipeStateInitialImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() initial,
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Recipe recipe) loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) {
|
||||
return initial();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? initial,
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Recipe recipe)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) {
|
||||
return initial?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? initial,
|
||||
TResult Function()? loading,
|
||||
TResult Function(Recipe recipe)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (initial != null) {
|
||||
return initial();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value) $default, {
|
||||
required TResult Function(AboutRecipeStateInitial value) initial,
|
||||
required TResult Function(AboutRecipeStateLoading value) loading,
|
||||
required TResult Function(AboutRecipeStateLoaded value) loaded,
|
||||
required TResult Function(RecipeStateError value) error,
|
||||
}) {
|
||||
return initial(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutRecipeState value)? $default, {
|
||||
TResult? Function(AboutRecipeStateInitial value)? initial,
|
||||
TResult? Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult? Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult? Function(RecipeStateError value)? error,
|
||||
}) {
|
||||
return initial?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value)? $default, {
|
||||
TResult Function(AboutRecipeStateInitial value)? initial,
|
||||
TResult Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult Function(RecipeStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (initial != null) {
|
||||
return initial(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AboutRecipeStateInitial implements AboutRecipeState {
|
||||
const factory AboutRecipeStateInitial() = _$AboutRecipeStateInitialImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$AboutRecipeStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$AboutRecipeStateLoadingImplCopyWith(
|
||||
_$AboutRecipeStateLoadingImpl value,
|
||||
$Res Function(_$AboutRecipeStateLoadingImpl) then) =
|
||||
__$$AboutRecipeStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$AboutRecipeStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$AboutRecipeStateCopyWithImpl<$Res, _$AboutRecipeStateLoadingImpl>
|
||||
implements _$$AboutRecipeStateLoadingImplCopyWith<$Res> {
|
||||
__$$AboutRecipeStateLoadingImplCopyWithImpl(
|
||||
_$AboutRecipeStateLoadingImpl _value,
|
||||
$Res Function(_$AboutRecipeStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$AboutRecipeStateLoadingImpl implements AboutRecipeStateLoading {
|
||||
const _$AboutRecipeStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AboutRecipeState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$AboutRecipeStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() initial,
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Recipe recipe) loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? initial,
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Recipe recipe)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? initial,
|
||||
TResult Function()? loading,
|
||||
TResult Function(Recipe recipe)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value) $default, {
|
||||
required TResult Function(AboutRecipeStateInitial value) initial,
|
||||
required TResult Function(AboutRecipeStateLoading value) loading,
|
||||
required TResult Function(AboutRecipeStateLoaded value) loaded,
|
||||
required TResult Function(RecipeStateError value) error,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutRecipeState value)? $default, {
|
||||
TResult? Function(AboutRecipeStateInitial value)? initial,
|
||||
TResult? Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult? Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult? Function(RecipeStateError value)? error,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value)? $default, {
|
||||
TResult Function(AboutRecipeStateInitial value)? initial,
|
||||
TResult Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult Function(RecipeStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AboutRecipeStateLoading implements AboutRecipeState {
|
||||
const factory AboutRecipeStateLoading() = _$AboutRecipeStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$AboutRecipeStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$AboutRecipeStateLoadedImplCopyWith(
|
||||
_$AboutRecipeStateLoadedImpl value,
|
||||
$Res Function(_$AboutRecipeStateLoadedImpl) then) =
|
||||
__$$AboutRecipeStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({Recipe recipe});
|
||||
|
||||
$RecipeCopyWith<$Res> get recipe;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$AboutRecipeStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$AboutRecipeStateCopyWithImpl<$Res, _$AboutRecipeStateLoadedImpl>
|
||||
implements _$$AboutRecipeStateLoadedImplCopyWith<$Res> {
|
||||
__$$AboutRecipeStateLoadedImplCopyWithImpl(
|
||||
_$AboutRecipeStateLoadedImpl _value,
|
||||
$Res Function(_$AboutRecipeStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? recipe = null,
|
||||
}) {
|
||||
return _then(_$AboutRecipeStateLoadedImpl(
|
||||
recipe: null == recipe
|
||||
? _value.recipe
|
||||
: recipe // ignore: cast_nullable_to_non_nullable
|
||||
as Recipe,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$RecipeCopyWith<$Res> get recipe {
|
||||
return $RecipeCopyWith<$Res>(_value.recipe, (value) {
|
||||
return _then(_value.copyWith(recipe: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$AboutRecipeStateLoadedImpl implements AboutRecipeStateLoaded {
|
||||
const _$AboutRecipeStateLoadedImpl({required this.recipe});
|
||||
|
||||
@override
|
||||
final Recipe recipe;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AboutRecipeState.loaded(recipe: $recipe)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$AboutRecipeStateLoadedImpl &&
|
||||
(identical(other.recipe, recipe) || other.recipe == recipe));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, recipe);
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$AboutRecipeStateLoadedImplCopyWith<_$AboutRecipeStateLoadedImpl>
|
||||
get copyWith => __$$AboutRecipeStateLoadedImplCopyWithImpl<
|
||||
_$AboutRecipeStateLoadedImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() initial,
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Recipe recipe) loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) {
|
||||
return loaded(recipe);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? initial,
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Recipe recipe)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) {
|
||||
return loaded?.call(recipe);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? initial,
|
||||
TResult Function()? loading,
|
||||
TResult Function(Recipe recipe)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(recipe);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value) $default, {
|
||||
required TResult Function(AboutRecipeStateInitial value) initial,
|
||||
required TResult Function(AboutRecipeStateLoading value) loading,
|
||||
required TResult Function(AboutRecipeStateLoaded value) loaded,
|
||||
required TResult Function(RecipeStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutRecipeState value)? $default, {
|
||||
TResult? Function(AboutRecipeStateInitial value)? initial,
|
||||
TResult? Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult? Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult? Function(RecipeStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value)? $default, {
|
||||
TResult Function(AboutRecipeStateInitial value)? initial,
|
||||
TResult Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult Function(RecipeStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AboutRecipeStateLoaded implements AboutRecipeState {
|
||||
const factory AboutRecipeStateLoaded({required final Recipe recipe}) =
|
||||
_$AboutRecipeStateLoadedImpl;
|
||||
|
||||
Recipe get recipe;
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$AboutRecipeStateLoadedImplCopyWith<_$AboutRecipeStateLoadedImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RecipeStateErrorImplCopyWith<$Res> {
|
||||
factory _$$RecipeStateErrorImplCopyWith(_$RecipeStateErrorImpl value,
|
||||
$Res Function(_$RecipeStateErrorImpl) then) =
|
||||
__$$RecipeStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String message});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RecipeStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$AboutRecipeStateCopyWithImpl<$Res, _$RecipeStateErrorImpl>
|
||||
implements _$$RecipeStateErrorImplCopyWith<$Res> {
|
||||
__$$RecipeStateErrorImplCopyWithImpl(_$RecipeStateErrorImpl _value,
|
||||
$Res Function(_$RecipeStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? message = null,
|
||||
}) {
|
||||
return _then(_$RecipeStateErrorImpl(
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$RecipeStateErrorImpl implements RecipeStateError {
|
||||
const _$RecipeStateErrorImpl({required this.message});
|
||||
|
||||
@override
|
||||
final String message;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AboutRecipeState.error(message: $message)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$RecipeStateErrorImpl &&
|
||||
(identical(other.message, message) || other.message == message));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, message);
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RecipeStateErrorImplCopyWith<_$RecipeStateErrorImpl> get copyWith =>
|
||||
__$$RecipeStateErrorImplCopyWithImpl<_$RecipeStateErrorImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() initial,
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Recipe recipe) loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) {
|
||||
return error(message);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? initial,
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Recipe recipe)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) {
|
||||
return error?.call(message);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? initial,
|
||||
TResult Function()? loading,
|
||||
TResult Function(Recipe recipe)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(message);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value) $default, {
|
||||
required TResult Function(AboutRecipeStateInitial value) initial,
|
||||
required TResult Function(AboutRecipeStateLoading value) loading,
|
||||
required TResult Function(AboutRecipeStateLoaded value) loaded,
|
||||
required TResult Function(RecipeStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutRecipeState value)? $default, {
|
||||
TResult? Function(AboutRecipeStateInitial value)? initial,
|
||||
TResult? Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult? Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult? Function(RecipeStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value)? $default, {
|
||||
TResult Function(AboutRecipeStateInitial value)? initial,
|
||||
TResult Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult Function(RecipeStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class RecipeStateError implements AboutRecipeState {
|
||||
const factory RecipeStateError({required final String message}) =
|
||||
_$RecipeStateErrorImpl;
|
||||
|
||||
String get message;
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$RecipeStateErrorImplCopyWith<_$RecipeStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'about_recipe_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _AboutRecipeService implements AboutRecipeService {
|
||||
_AboutRecipeService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<void> likeRecipe({required String slug}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/${slug}/like',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> addToFavorite({required String slug}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/${slug}/add_to_favorite',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> removeFromFavorite({required String slug}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/${slug}/remove_from_favorite',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Recipe> getRecipe(String id) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<Recipe>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/show/${id}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late Recipe _value;
|
||||
try {
|
||||
_value = Recipe.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user