feat(order info): added order info screen

This commit is contained in:
Username1548
2025-04-04 20:21:31 +07:00
parent 9715f4cac9
commit 748484cf8f
387 changed files with 16171 additions and 18199 deletions

View File

@@ -12,8 +12,7 @@ part of 'ingredient.dart';
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',
);
'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');
Ingredient _$IngredientFromJson(Map<String, dynamic> json) {
return _Ingredient.fromJson(json);
@@ -38,9 +37,8 @@ mixin _$Ingredient {
/// @nodoc
abstract class $IngredientCopyWith<$Res> {
factory $IngredientCopyWith(
Ingredient value,
$Res Function(Ingredient) then,
) = _$IngredientCopyWithImpl<$Res, Ingredient>;
Ingredient value, $Res Function(Ingredient) then) =
_$IngredientCopyWithImpl<$Res, Ingredient>;
@useResult
$Res call({String name, String unit, String portion});
}
@@ -64,26 +62,20 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient>
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,
);
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);
}
}
@@ -91,9 +83,8 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient>
abstract class _$$IngredientImplCopyWith<$Res>
implements $IngredientCopyWith<$Res> {
factory _$$IngredientImplCopyWith(
_$IngredientImpl value,
$Res Function(_$IngredientImpl) then,
) = __$$IngredientImplCopyWithImpl<$Res>;
_$IngredientImpl value, $Res Function(_$IngredientImpl) then) =
__$$IngredientImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String name, String unit, String portion});
@@ -104,9 +95,8 @@ class __$$IngredientImplCopyWithImpl<$Res>
extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl>
implements _$$IngredientImplCopyWith<$Res> {
__$$IngredientImplCopyWithImpl(
_$IngredientImpl _value,
$Res Function(_$IngredientImpl) _then,
) : super(_value, _then);
_$IngredientImpl _value, $Res Function(_$IngredientImpl) _then)
: super(_value, _then);
/// Create a copy of Ingredient
/// with the given fields replaced by the non-null parameter values.
@@ -117,36 +107,28 @@ class __$$IngredientImplCopyWithImpl<$Res>
Object? unit = null,
Object? portion = null,
}) {
return _then(
_$IngredientImpl(
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,
),
);
return _then(_$IngredientImpl(
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
@JsonSerializable()
class _$IngredientImpl implements _Ingredient {
const _$IngredientImpl({
required this.name,
required this.unit,
required this.portion,
});
const _$IngredientImpl(
{required this.name, required this.unit, required this.portion});
factory _$IngredientImpl.fromJson(Map<String, dynamic> json) =>
_$$IngredientImplFromJson(json);
@@ -187,16 +169,17 @@ class _$IngredientImpl implements _Ingredient {
@override
Map<String, dynamic> toJson() {
return _$$IngredientImplToJson(this);
return _$$IngredientImplToJson(
this,
);
}
}
abstract class _Ingredient implements Ingredient {
const factory _Ingredient({
required final String name,
required final String unit,
required final String portion,
}) = _$IngredientImpl;
const factory _Ingredient(
{required final String name,
required final String unit,
required final String portion}) = _$IngredientImpl;
factory _Ingredient.fromJson(Map<String, dynamic> json) =
_$IngredientImpl.fromJson;

View File

@@ -12,8 +12,7 @@ part of 'product.dart';
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',
);
'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');
Product _$ProductFromJson(Map<String, dynamic> json) {
return _Product.fromJson(json);
@@ -55,31 +54,28 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? id = null, Object? name = null}) {
return _then(
_value.copyWith(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
$Res call({
Object? id = null,
Object? name = null,
}) {
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$ProductImplCopyWith<$Res> implements $ProductCopyWith<$Res> {
factory _$$ProductImplCopyWith(
_$ProductImpl value,
$Res Function(_$ProductImpl) then,
) = __$$ProductImplCopyWithImpl<$Res>;
_$ProductImpl value, $Res Function(_$ProductImpl) then) =
__$$ProductImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id, String name});
@@ -90,29 +86,27 @@ class __$$ProductImplCopyWithImpl<$Res>
extends _$ProductCopyWithImpl<$Res, _$ProductImpl>
implements _$$ProductImplCopyWith<$Res> {
__$$ProductImplCopyWithImpl(
_$ProductImpl _value,
$Res Function(_$ProductImpl) _then,
) : super(_value, _then);
_$ProductImpl _value, $Res Function(_$ProductImpl) _then)
: super(_value, _then);
/// Create a copy of Product
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? id = null, Object? name = null}) {
return _then(
_$ProductImpl(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? id = null,
Object? name = null,
}) {
return _then(_$ProductImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -157,7 +151,9 @@ class _$ProductImpl implements _Product {
@override
Map<String, dynamic> toJson() {
return _$$ProductImplToJson(this);
return _$$ProductImplToJson(
this,
);
}
}

View File

@@ -13,4 +13,7 @@ _$ProductImpl _$$ProductImplFromJson(Map<String, dynamic> json) =>
);
Map<String, dynamic> _$$ProductImplToJson(_$ProductImpl instance) =>
<String, dynamic>{'id': instance.id, 'name': instance.name};
<String, dynamic>{
'id': instance.id,
'name': instance.name,
};

View File

@@ -7,8 +7,8 @@ part 'recipe_create_model.freezed.dart';
part 'recipe_create_model.g.dart';
enum RecipeType {
first_meals,
second_meals,
@JsonKey(name: 'first_meals') firstMeals,
@JsonKey(name: 'second_meals') secondMeals,
salads,
snacks,
sweets,

View File

@@ -12,8 +12,7 @@ part of 'recipe_create_model.dart';
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',
);
'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');
RecipeCreateModel _$RecipeCreateModelFromJson(Map<String, dynamic> json) {
return _RecipeCreateModel.fromJson(json);
@@ -52,24 +51,22 @@ mixin _$RecipeCreateModel {
/// @nodoc
abstract class $RecipeCreateModelCopyWith<$Res> {
factory $RecipeCreateModelCopyWith(
RecipeCreateModel value,
$Res Function(RecipeCreateModel) then,
) = _$RecipeCreateModelCopyWithImpl<$Res, RecipeCreateModel>;
RecipeCreateModel value, $Res Function(RecipeCreateModel) then) =
_$RecipeCreateModelCopyWithImpl<$Res, RecipeCreateModel>;
@useResult
$Res call({
String title,
String state,
@JsonKey(name: 'description_md') String description,
RecipeType type,
@JsonKey(name: 'video_url') String? videoUrl,
@JsonKey(name: 'cooking_time') String? cookingTime,
@JsonKey(name: 'active_time') String? activeTime,
String servings,
@JsonKey(name: 'energy_per_serving') String energyPerServing,
List<String> tags,
List<Ingredient> ingredients,
List<Step> steps,
});
$Res call(
{String title,
String state,
@JsonKey(name: 'description_md') String description,
RecipeType type,
@JsonKey(name: 'video_url') String? videoUrl,
@JsonKey(name: 'cooking_time') String? cookingTime,
@JsonKey(name: 'active_time') String? activeTime,
String servings,
@JsonKey(name: 'energy_per_serving') String energyPerServing,
List<String> tags,
List<Ingredient> ingredients,
List<Step> steps});
}
/// @nodoc
@@ -100,107 +97,89 @@ class _$RecipeCreateModelCopyWithImpl<$Res, $Val extends RecipeCreateModel>
Object? ingredients = null,
Object? steps = null,
}) {
return _then(
_value.copyWith(
title:
null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
state:
null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
description:
null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
type:
null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as RecipeType,
videoUrl:
freezed == videoUrl
? _value.videoUrl
: videoUrl // ignore: cast_nullable_to_non_nullable
as String?,
cookingTime:
freezed == cookingTime
? _value.cookingTime
: cookingTime // ignore: cast_nullable_to_non_nullable
as String?,
activeTime:
freezed == activeTime
? _value.activeTime
: activeTime // ignore: cast_nullable_to_non_nullable
as String?,
servings:
null == servings
? _value.servings
: servings // ignore: cast_nullable_to_non_nullable
as String,
energyPerServing:
null == energyPerServing
? _value.energyPerServing
: energyPerServing // ignore: cast_nullable_to_non_nullable
as String,
tags:
null == tags
? _value.tags
: tags // ignore: cast_nullable_to_non_nullable
as List<String>,
ingredients:
null == ingredients
? _value.ingredients
: ingredients // ignore: cast_nullable_to_non_nullable
as List<Ingredient>,
steps:
null == steps
? _value.steps
: steps // ignore: cast_nullable_to_non_nullable
as List<Step>,
)
as $Val,
);
return _then(_value.copyWith(
title: null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
description: null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
type: null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as RecipeType,
videoUrl: freezed == videoUrl
? _value.videoUrl
: videoUrl // ignore: cast_nullable_to_non_nullable
as String?,
cookingTime: freezed == cookingTime
? _value.cookingTime
: cookingTime // ignore: cast_nullable_to_non_nullable
as String?,
activeTime: freezed == activeTime
? _value.activeTime
: activeTime // ignore: cast_nullable_to_non_nullable
as String?,
servings: null == servings
? _value.servings
: servings // ignore: cast_nullable_to_non_nullable
as String,
energyPerServing: null == energyPerServing
? _value.energyPerServing
: energyPerServing // ignore: cast_nullable_to_non_nullable
as String,
tags: null == tags
? _value.tags
: tags // ignore: cast_nullable_to_non_nullable
as List<String>,
ingredients: null == ingredients
? _value.ingredients
: ingredients // ignore: cast_nullable_to_non_nullable
as List<Ingredient>,
steps: null == steps
? _value.steps
: steps // ignore: cast_nullable_to_non_nullable
as List<Step>,
) as $Val);
}
}
/// @nodoc
abstract class _$$RecipeCreateModelImplCopyWith<$Res>
implements $RecipeCreateModelCopyWith<$Res> {
factory _$$RecipeCreateModelImplCopyWith(
_$RecipeCreateModelImpl value,
$Res Function(_$RecipeCreateModelImpl) then,
) = __$$RecipeCreateModelImplCopyWithImpl<$Res>;
factory _$$RecipeCreateModelImplCopyWith(_$RecipeCreateModelImpl value,
$Res Function(_$RecipeCreateModelImpl) then) =
__$$RecipeCreateModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
String title,
String state,
@JsonKey(name: 'description_md') String description,
RecipeType type,
@JsonKey(name: 'video_url') String? videoUrl,
@JsonKey(name: 'cooking_time') String? cookingTime,
@JsonKey(name: 'active_time') String? activeTime,
String servings,
@JsonKey(name: 'energy_per_serving') String energyPerServing,
List<String> tags,
List<Ingredient> ingredients,
List<Step> steps,
});
$Res call(
{String title,
String state,
@JsonKey(name: 'description_md') String description,
RecipeType type,
@JsonKey(name: 'video_url') String? videoUrl,
@JsonKey(name: 'cooking_time') String? cookingTime,
@JsonKey(name: 'active_time') String? activeTime,
String servings,
@JsonKey(name: 'energy_per_serving') String energyPerServing,
List<String> tags,
List<Ingredient> ingredients,
List<Step> steps});
}
/// @nodoc
class __$$RecipeCreateModelImplCopyWithImpl<$Res>
extends _$RecipeCreateModelCopyWithImpl<$Res, _$RecipeCreateModelImpl>
implements _$$RecipeCreateModelImplCopyWith<$Res> {
__$$RecipeCreateModelImplCopyWithImpl(
_$RecipeCreateModelImpl _value,
$Res Function(_$RecipeCreateModelImpl) _then,
) : super(_value, _then);
__$$RecipeCreateModelImplCopyWithImpl(_$RecipeCreateModelImpl _value,
$Res Function(_$RecipeCreateModelImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeCreateModel
/// with the given fields replaced by the non-null parameter values.
@@ -220,92 +199,78 @@ class __$$RecipeCreateModelImplCopyWithImpl<$Res>
Object? ingredients = null,
Object? steps = null,
}) {
return _then(
_$RecipeCreateModelImpl(
title:
null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
state:
null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
description:
null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
type:
null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as RecipeType,
videoUrl:
freezed == videoUrl
? _value.videoUrl
: videoUrl // ignore: cast_nullable_to_non_nullable
as String?,
cookingTime:
freezed == cookingTime
? _value.cookingTime
: cookingTime // ignore: cast_nullable_to_non_nullable
as String?,
activeTime:
freezed == activeTime
? _value.activeTime
: activeTime // ignore: cast_nullable_to_non_nullable
as String?,
servings:
null == servings
? _value.servings
: servings // ignore: cast_nullable_to_non_nullable
as String,
energyPerServing:
null == energyPerServing
? _value.energyPerServing
: energyPerServing // ignore: cast_nullable_to_non_nullable
as String,
tags:
null == tags
? _value._tags
: tags // ignore: cast_nullable_to_non_nullable
as List<String>,
ingredients:
null == ingredients
? _value._ingredients
: ingredients // ignore: cast_nullable_to_non_nullable
as List<Ingredient>,
steps:
null == steps
? _value._steps
: steps // ignore: cast_nullable_to_non_nullable
as List<Step>,
),
);
return _then(_$RecipeCreateModelImpl(
title: null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
description: null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
type: null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as RecipeType,
videoUrl: freezed == videoUrl
? _value.videoUrl
: videoUrl // ignore: cast_nullable_to_non_nullable
as String?,
cookingTime: freezed == cookingTime
? _value.cookingTime
: cookingTime // ignore: cast_nullable_to_non_nullable
as String?,
activeTime: freezed == activeTime
? _value.activeTime
: activeTime // ignore: cast_nullable_to_non_nullable
as String?,
servings: null == servings
? _value.servings
: servings // ignore: cast_nullable_to_non_nullable
as String,
energyPerServing: null == energyPerServing
? _value.energyPerServing
: energyPerServing // ignore: cast_nullable_to_non_nullable
as String,
tags: null == tags
? _value._tags
: tags // ignore: cast_nullable_to_non_nullable
as List<String>,
ingredients: null == ingredients
? _value._ingredients
: ingredients // ignore: cast_nullable_to_non_nullable
as List<Ingredient>,
steps: null == steps
? _value._steps
: steps // ignore: cast_nullable_to_non_nullable
as List<Step>,
));
}
}
/// @nodoc
@JsonSerializable()
class _$RecipeCreateModelImpl implements _RecipeCreateModel {
const _$RecipeCreateModelImpl({
required this.title,
required this.state,
@JsonKey(name: 'description_md') required this.description,
required this.type,
@JsonKey(name: 'video_url') this.videoUrl,
@JsonKey(name: 'cooking_time') this.cookingTime,
@JsonKey(name: 'active_time') this.activeTime,
required this.servings,
@JsonKey(name: 'energy_per_serving') required this.energyPerServing,
required final List<String> tags,
required final List<Ingredient> ingredients,
required final List<Step> steps,
}) : _tags = tags,
_ingredients = ingredients,
_steps = steps;
const _$RecipeCreateModelImpl(
{required this.title,
required this.state,
@JsonKey(name: 'description_md') required this.description,
required this.type,
@JsonKey(name: 'video_url') this.videoUrl,
@JsonKey(name: 'cooking_time') this.cookingTime,
@JsonKey(name: 'active_time') this.activeTime,
required this.servings,
@JsonKey(name: 'energy_per_serving') required this.energyPerServing,
required final List<String> tags,
required final List<Ingredient> ingredients,
required final List<Step> steps})
: _tags = tags,
_ingredients = ingredients,
_steps = steps;
factory _$RecipeCreateModelImpl.fromJson(Map<String, dynamic> json) =>
_$$RecipeCreateModelImplFromJson(json);
@@ -383,30 +348,27 @@ class _$RecipeCreateModelImpl implements _RecipeCreateModel {
(identical(other.energyPerServing, energyPerServing) ||
other.energyPerServing == energyPerServing) &&
const DeepCollectionEquality().equals(other._tags, _tags) &&
const DeepCollectionEquality().equals(
other._ingredients,
_ingredients,
) &&
const DeepCollectionEquality()
.equals(other._ingredients, _ingredients) &&
const DeepCollectionEquality().equals(other._steps, _steps));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
title,
state,
description,
type,
videoUrl,
cookingTime,
activeTime,
servings,
energyPerServing,
const DeepCollectionEquality().hash(_tags),
const DeepCollectionEquality().hash(_ingredients),
const DeepCollectionEquality().hash(_steps),
);
runtimeType,
title,
state,
description,
type,
videoUrl,
cookingTime,
activeTime,
servings,
energyPerServing,
const DeepCollectionEquality().hash(_tags),
const DeepCollectionEquality().hash(_ingredients),
const DeepCollectionEquality().hash(_steps));
/// Create a copy of RecipeCreateModel
/// with the given fields replaced by the non-null parameter values.
@@ -415,31 +377,31 @@ class _$RecipeCreateModelImpl implements _RecipeCreateModel {
@pragma('vm:prefer-inline')
_$$RecipeCreateModelImplCopyWith<_$RecipeCreateModelImpl> get copyWith =>
__$$RecipeCreateModelImplCopyWithImpl<_$RecipeCreateModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$RecipeCreateModelImplToJson(this);
return _$$RecipeCreateModelImplToJson(
this,
);
}
}
abstract class _RecipeCreateModel implements RecipeCreateModel {
const factory _RecipeCreateModel({
required final String title,
required final String state,
@JsonKey(name: 'description_md') required final String description,
required final RecipeType type,
@JsonKey(name: 'video_url') final String? videoUrl,
@JsonKey(name: 'cooking_time') final String? cookingTime,
@JsonKey(name: 'active_time') final String? activeTime,
required final String servings,
@JsonKey(name: 'energy_per_serving') required final String energyPerServing,
required final List<String> tags,
required final List<Ingredient> ingredients,
required final List<Step> steps,
}) = _$RecipeCreateModelImpl;
const factory _RecipeCreateModel(
{required final String title,
required final String state,
@JsonKey(name: 'description_md') required final String description,
required final RecipeType type,
@JsonKey(name: 'video_url') final String? videoUrl,
@JsonKey(name: 'cooking_time') final String? cookingTime,
@JsonKey(name: 'active_time') final String? activeTime,
required final String servings,
@JsonKey(name: 'energy_per_serving')
required final String energyPerServing,
required final List<String> tags,
required final List<Ingredient> ingredients,
required final List<Step> steps}) = _$RecipeCreateModelImpl;
factory _RecipeCreateModel.fromJson(Map<String, dynamic> json) =
_$RecipeCreateModelImpl.fromJson;

View File

@@ -7,48 +7,46 @@ part of 'recipe_create_model.dart';
// **************************************************************************
_$RecipeCreateModelImpl _$$RecipeCreateModelImplFromJson(
Map<String, dynamic> json,
) => _$RecipeCreateModelImpl(
title: json['title'] as String,
state: json['state'] as String,
description: json['description_md'] as String,
type: $enumDecode(_$RecipeTypeEnumMap, json['type']),
videoUrl: json['video_url'] as String?,
cookingTime: json['cooking_time'] as String?,
activeTime: json['active_time'] as String?,
servings: json['servings'] as String,
energyPerServing: json['energy_per_serving'] as String,
tags: (json['tags'] as List<dynamic>).map((e) => e as String).toList(),
ingredients:
(json['ingredients'] as List<dynamic>)
Map<String, dynamic> json) =>
_$RecipeCreateModelImpl(
title: json['title'] as String,
state: json['state'] as String,
description: json['description_md'] as String,
type: $enumDecode(_$RecipeTypeEnumMap, json['type']),
videoUrl: json['video_url'] as String?,
cookingTime: json['cooking_time'] as String?,
activeTime: json['active_time'] as String?,
servings: json['servings'] as String,
energyPerServing: json['energy_per_serving'] as String,
tags: (json['tags'] as List<dynamic>).map((e) => e as String).toList(),
ingredients: (json['ingredients'] as List<dynamic>)
.map((e) => Ingredient.fromJson(e as Map<String, dynamic>))
.toList(),
steps:
(json['steps'] as List<dynamic>)
steps: (json['steps'] as List<dynamic>)
.map((e) => Step.fromJson(e as Map<String, dynamic>))
.toList(),
);
);
Map<String, dynamic> _$$RecipeCreateModelImplToJson(
_$RecipeCreateModelImpl instance,
) => <String, dynamic>{
'title': instance.title,
'state': instance.state,
'description_md': instance.description,
'type': _$RecipeTypeEnumMap[instance.type]!,
'video_url': instance.videoUrl,
'cooking_time': instance.cookingTime,
'active_time': instance.activeTime,
'servings': instance.servings,
'energy_per_serving': instance.energyPerServing,
'tags': instance.tags,
'ingredients': instance.ingredients,
'steps': instance.steps,
};
_$RecipeCreateModelImpl instance) =>
<String, dynamic>{
'title': instance.title,
'state': instance.state,
'description_md': instance.description,
'type': _$RecipeTypeEnumMap[instance.type]!,
'video_url': instance.videoUrl,
'cooking_time': instance.cookingTime,
'active_time': instance.activeTime,
'servings': instance.servings,
'energy_per_serving': instance.energyPerServing,
'tags': instance.tags,
'ingredients': instance.ingredients,
'steps': instance.steps,
};
const _$RecipeTypeEnumMap = {
RecipeType.first_meals: 'first_meals',
RecipeType.second_meals: 'second_meals',
RecipeType.firstMeals: 'firstMeals',
RecipeType.secondMeals: 'secondMeals',
RecipeType.salads: 'salads',
RecipeType.snacks: 'snacks',
RecipeType.sweets: 'sweets',

View File

@@ -16,12 +16,12 @@ class RecipeModel with _$RecipeModel {
String? state,
String? title,
String? description,
String? video_url,
@JsonKey(name: 'video_url') String? videoUrl,
String? image,
int? totalCookingTime,
int? activeCookTime,
int? servings,
int? energyPerServing,
int? servings,
int? energyPerServing,
}) = _RecipeModel;
factory RecipeModel.fromJson(Map<String, Object?> json) => _$RecipeModelFromJson(json);

View File

@@ -12,8 +12,7 @@ part of 'recipe_model.dart';
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',
);
'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');
RecipeModel _$RecipeModelFromJson(Map<String, dynamic> json) {
return _RecipeModel.fromJson(json);
@@ -28,7 +27,8 @@ mixin _$RecipeModel {
String? get state => throw _privateConstructorUsedError;
String? get title => throw _privateConstructorUsedError;
String? get description => throw _privateConstructorUsedError;
String? get video_url => throw _privateConstructorUsedError;
@JsonKey(name: 'video_url')
String? get videoUrl => throw _privateConstructorUsedError;
String? get image => throw _privateConstructorUsedError;
int? get totalCookingTime => throw _privateConstructorUsedError;
int? get activeCookTime => throw _privateConstructorUsedError;
@@ -48,25 +48,23 @@ mixin _$RecipeModel {
/// @nodoc
abstract class $RecipeModelCopyWith<$Res> {
factory $RecipeModelCopyWith(
RecipeModel value,
$Res Function(RecipeModel) then,
) = _$RecipeModelCopyWithImpl<$Res, RecipeModel>;
RecipeModel value, $Res Function(RecipeModel) then) =
_$RecipeModelCopyWithImpl<$Res, RecipeModel>;
@useResult
$Res call({
List<Ingredient?>? ingredients,
List<Step?>? steps,
List<String>? tags,
String? type,
String? state,
String? title,
String? description,
String? video_url,
String? image,
int? totalCookingTime,
int? activeCookTime,
int? servings,
int? energyPerServing,
});
$Res call(
{List<Ingredient?>? ingredients,
List<Step?>? steps,
List<String>? tags,
String? type,
String? state,
String? title,
String? description,
@JsonKey(name: 'video_url') String? videoUrl,
String? image,
int? totalCookingTime,
int? activeCookTime,
int? servings,
int? energyPerServing});
}
/// @nodoc
@@ -91,83 +89,67 @@ class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel>
Object? state = freezed,
Object? title = freezed,
Object? description = freezed,
Object? video_url = freezed,
Object? videoUrl = freezed,
Object? image = freezed,
Object? totalCookingTime = freezed,
Object? activeCookTime = freezed,
Object? servings = freezed,
Object? energyPerServing = freezed,
}) {
return _then(
_value.copyWith(
ingredients:
freezed == ingredients
? _value.ingredients
: ingredients // ignore: cast_nullable_to_non_nullable
as List<Ingredient?>?,
steps:
freezed == steps
? _value.steps
: steps // ignore: cast_nullable_to_non_nullable
as List<Step?>?,
tags:
freezed == tags
? _value.tags
: tags // ignore: cast_nullable_to_non_nullable
as List<String>?,
type:
freezed == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as String?,
state:
freezed == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String?,
title:
freezed == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String?,
description:
freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
video_url:
freezed == video_url
? _value.video_url
: video_url // ignore: cast_nullable_to_non_nullable
as String?,
image:
freezed == image
? _value.image
: image // ignore: cast_nullable_to_non_nullable
as String?,
totalCookingTime:
freezed == totalCookingTime
? _value.totalCookingTime
: totalCookingTime // ignore: cast_nullable_to_non_nullable
as int?,
activeCookTime:
freezed == activeCookTime
? _value.activeCookTime
: activeCookTime // ignore: cast_nullable_to_non_nullable
as int?,
servings:
freezed == servings
? _value.servings
: servings // ignore: cast_nullable_to_non_nullable
as int?,
energyPerServing:
freezed == energyPerServing
? _value.energyPerServing
: energyPerServing // ignore: cast_nullable_to_non_nullable
as int?,
)
as $Val,
);
return _then(_value.copyWith(
ingredients: freezed == ingredients
? _value.ingredients
: ingredients // ignore: cast_nullable_to_non_nullable
as List<Ingredient?>?,
steps: freezed == steps
? _value.steps
: steps // ignore: cast_nullable_to_non_nullable
as List<Step?>?,
tags: freezed == tags
? _value.tags
: tags // ignore: cast_nullable_to_non_nullable
as List<String>?,
type: freezed == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as String?,
state: freezed == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String?,
title: freezed == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String?,
description: freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
videoUrl: freezed == videoUrl
? _value.videoUrl
: videoUrl // ignore: cast_nullable_to_non_nullable
as String?,
image: freezed == image
? _value.image
: image // ignore: cast_nullable_to_non_nullable
as String?,
totalCookingTime: freezed == totalCookingTime
? _value.totalCookingTime
: totalCookingTime // ignore: cast_nullable_to_non_nullable
as int?,
activeCookTime: freezed == activeCookTime
? _value.activeCookTime
: activeCookTime // ignore: cast_nullable_to_non_nullable
as int?,
servings: freezed == servings
? _value.servings
: servings // ignore: cast_nullable_to_non_nullable
as int?,
energyPerServing: freezed == energyPerServing
? _value.energyPerServing
: energyPerServing // ignore: cast_nullable_to_non_nullable
as int?,
) as $Val);
}
}
@@ -175,26 +157,24 @@ class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel>
abstract class _$$RecipeModelImplCopyWith<$Res>
implements $RecipeModelCopyWith<$Res> {
factory _$$RecipeModelImplCopyWith(
_$RecipeModelImpl value,
$Res Function(_$RecipeModelImpl) then,
) = __$$RecipeModelImplCopyWithImpl<$Res>;
_$RecipeModelImpl value, $Res Function(_$RecipeModelImpl) then) =
__$$RecipeModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
List<Ingredient?>? ingredients,
List<Step?>? steps,
List<String>? tags,
String? type,
String? state,
String? title,
String? description,
String? video_url,
String? image,
int? totalCookingTime,
int? activeCookTime,
int? servings,
int? energyPerServing,
});
$Res call(
{List<Ingredient?>? ingredients,
List<Step?>? steps,
List<String>? tags,
String? type,
String? state,
String? title,
String? description,
@JsonKey(name: 'video_url') String? videoUrl,
String? image,
int? totalCookingTime,
int? activeCookTime,
int? servings,
int? energyPerServing});
}
/// @nodoc
@@ -202,9 +182,8 @@ class __$$RecipeModelImplCopyWithImpl<$Res>
extends _$RecipeModelCopyWithImpl<$Res, _$RecipeModelImpl>
implements _$$RecipeModelImplCopyWith<$Res> {
__$$RecipeModelImplCopyWithImpl(
_$RecipeModelImpl _value,
$Res Function(_$RecipeModelImpl) _then,
) : super(_value, _then);
_$RecipeModelImpl _value, $Res Function(_$RecipeModelImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeModel
/// with the given fields replaced by the non-null parameter values.
@@ -218,105 +197,90 @@ class __$$RecipeModelImplCopyWithImpl<$Res>
Object? state = freezed,
Object? title = freezed,
Object? description = freezed,
Object? video_url = freezed,
Object? videoUrl = freezed,
Object? image = freezed,
Object? totalCookingTime = freezed,
Object? activeCookTime = freezed,
Object? servings = freezed,
Object? energyPerServing = freezed,
}) {
return _then(
_$RecipeModelImpl(
ingredients:
freezed == ingredients
? _value._ingredients
: ingredients // ignore: cast_nullable_to_non_nullable
as List<Ingredient?>?,
steps:
freezed == steps
? _value._steps
: steps // ignore: cast_nullable_to_non_nullable
as List<Step?>?,
tags:
freezed == tags
? _value._tags
: tags // ignore: cast_nullable_to_non_nullable
as List<String>?,
type:
freezed == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as String?,
state:
freezed == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String?,
title:
freezed == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String?,
description:
freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
video_url:
freezed == video_url
? _value.video_url
: video_url // ignore: cast_nullable_to_non_nullable
as String?,
image:
freezed == image
? _value.image
: image // ignore: cast_nullable_to_non_nullable
as String?,
totalCookingTime:
freezed == totalCookingTime
? _value.totalCookingTime
: totalCookingTime // ignore: cast_nullable_to_non_nullable
as int?,
activeCookTime:
freezed == activeCookTime
? _value.activeCookTime
: activeCookTime // ignore: cast_nullable_to_non_nullable
as int?,
servings:
freezed == servings
? _value.servings
: servings // ignore: cast_nullable_to_non_nullable
as int?,
energyPerServing:
freezed == energyPerServing
? _value.energyPerServing
: energyPerServing // ignore: cast_nullable_to_non_nullable
as int?,
),
);
return _then(_$RecipeModelImpl(
ingredients: freezed == ingredients
? _value._ingredients
: ingredients // ignore: cast_nullable_to_non_nullable
as List<Ingredient?>?,
steps: freezed == steps
? _value._steps
: steps // ignore: cast_nullable_to_non_nullable
as List<Step?>?,
tags: freezed == tags
? _value._tags
: tags // ignore: cast_nullable_to_non_nullable
as List<String>?,
type: freezed == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as String?,
state: freezed == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String?,
title: freezed == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String?,
description: freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
videoUrl: freezed == videoUrl
? _value.videoUrl
: videoUrl // ignore: cast_nullable_to_non_nullable
as String?,
image: freezed == image
? _value.image
: image // ignore: cast_nullable_to_non_nullable
as String?,
totalCookingTime: freezed == totalCookingTime
? _value.totalCookingTime
: totalCookingTime // ignore: cast_nullable_to_non_nullable
as int?,
activeCookTime: freezed == activeCookTime
? _value.activeCookTime
: activeCookTime // ignore: cast_nullable_to_non_nullable
as int?,
servings: freezed == servings
? _value.servings
: servings // ignore: cast_nullable_to_non_nullable
as int?,
energyPerServing: freezed == energyPerServing
? _value.energyPerServing
: energyPerServing // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$RecipeModelImpl implements _RecipeModel {
const _$RecipeModelImpl({
final List<Ingredient?>? ingredients,
final List<Step?>? steps,
final List<String>? tags,
this.type,
this.state,
this.title,
this.description,
this.video_url,
this.image,
this.totalCookingTime,
this.activeCookTime,
this.servings,
this.energyPerServing,
}) : _ingredients = ingredients,
_steps = steps,
_tags = tags;
const _$RecipeModelImpl(
{final List<Ingredient?>? ingredients,
final List<Step?>? steps,
final List<String>? tags,
this.type,
this.state,
this.title,
this.description,
@JsonKey(name: 'video_url') this.videoUrl,
this.image,
this.totalCookingTime,
this.activeCookTime,
this.servings,
this.energyPerServing})
: _ingredients = ingredients,
_steps = steps,
_tags = tags;
factory _$RecipeModelImpl.fromJson(Map<String, dynamic> json) =>
_$$RecipeModelImplFromJson(json);
@@ -360,7 +324,8 @@ class _$RecipeModelImpl implements _RecipeModel {
@override
final String? description;
@override
final String? video_url;
@JsonKey(name: 'video_url')
final String? videoUrl;
@override
final String? image;
@override
@@ -374,7 +339,7 @@ class _$RecipeModelImpl implements _RecipeModel {
@override
String toString() {
return 'RecipeModel(ingredients: $ingredients, steps: $steps, tags: $tags, type: $type, state: $state, title: $title, description: $description, video_url: $video_url, image: $image, totalCookingTime: $totalCookingTime, activeCookTime: $activeCookTime, servings: $servings, energyPerServing: $energyPerServing)';
return 'RecipeModel(ingredients: $ingredients, steps: $steps, tags: $tags, type: $type, state: $state, title: $title, description: $description, videoUrl: $videoUrl, image: $image, totalCookingTime: $totalCookingTime, activeCookTime: $activeCookTime, servings: $servings, energyPerServing: $energyPerServing)';
}
@override
@@ -382,10 +347,8 @@ class _$RecipeModelImpl implements _RecipeModel {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$RecipeModelImpl &&
const DeepCollectionEquality().equals(
other._ingredients,
_ingredients,
) &&
const DeepCollectionEquality()
.equals(other._ingredients, _ingredients) &&
const DeepCollectionEquality().equals(other._steps, _steps) &&
const DeepCollectionEquality().equals(other._tags, _tags) &&
(identical(other.type, type) || other.type == type) &&
@@ -393,8 +356,8 @@ class _$RecipeModelImpl implements _RecipeModel {
(identical(other.title, title) || other.title == title) &&
(identical(other.description, description) ||
other.description == description) &&
(identical(other.video_url, video_url) ||
other.video_url == video_url) &&
(identical(other.videoUrl, videoUrl) ||
other.videoUrl == videoUrl) &&
(identical(other.image, image) || other.image == image) &&
(identical(other.totalCookingTime, totalCookingTime) ||
other.totalCookingTime == totalCookingTime) &&
@@ -409,21 +372,20 @@ class _$RecipeModelImpl implements _RecipeModel {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_ingredients),
const DeepCollectionEquality().hash(_steps),
const DeepCollectionEquality().hash(_tags),
type,
state,
title,
description,
video_url,
image,
totalCookingTime,
activeCookTime,
servings,
energyPerServing,
);
runtimeType,
const DeepCollectionEquality().hash(_ingredients),
const DeepCollectionEquality().hash(_steps),
const DeepCollectionEquality().hash(_tags),
type,
state,
title,
description,
videoUrl,
image,
totalCookingTime,
activeCookTime,
servings,
energyPerServing);
/// Create a copy of RecipeModel
/// with the given fields replaced by the non-null parameter values.
@@ -435,26 +397,27 @@ class _$RecipeModelImpl implements _RecipeModel {
@override
Map<String, dynamic> toJson() {
return _$$RecipeModelImplToJson(this);
return _$$RecipeModelImplToJson(
this,
);
}
}
abstract class _RecipeModel implements RecipeModel {
const factory _RecipeModel({
final List<Ingredient?>? ingredients,
final List<Step?>? steps,
final List<String>? tags,
final String? type,
final String? state,
final String? title,
final String? description,
final String? video_url,
final String? image,
final int? totalCookingTime,
final int? activeCookTime,
final int? servings,
final int? energyPerServing,
}) = _$RecipeModelImpl;
const factory _RecipeModel(
{final List<Ingredient?>? ingredients,
final List<Step?>? steps,
final List<String>? tags,
final String? type,
final String? state,
final String? title,
final String? description,
@JsonKey(name: 'video_url') final String? videoUrl,
final String? image,
final int? totalCookingTime,
final int? activeCookTime,
final int? servings,
final int? energyPerServing}) = _$RecipeModelImpl;
factory _RecipeModel.fromJson(Map<String, dynamic> json) =
_$RecipeModelImpl.fromJson;
@@ -474,7 +437,8 @@ abstract class _RecipeModel implements RecipeModel {
@override
String? get description;
@override
String? get video_url;
@JsonKey(name: 'video_url')
String? get videoUrl;
@override
String? get image;
@override

View File

@@ -8,28 +8,20 @@ part of 'recipe_model.dart';
_$RecipeModelImpl _$$RecipeModelImplFromJson(Map<String, dynamic> json) =>
_$RecipeModelImpl(
ingredients:
(json['ingredients'] as List<dynamic>?)
?.map(
(e) =>
e == null
? null
: Ingredient.fromJson(e as Map<String, dynamic>),
)
.toList(),
steps:
(json['steps'] as List<dynamic>?)
?.map(
(e) =>
e == null ? null : Step.fromJson(e as Map<String, dynamic>),
)
.toList(),
ingredients: (json['ingredients'] as List<dynamic>?)
?.map((e) =>
e == null ? null : Ingredient.fromJson(e as Map<String, dynamic>))
.toList(),
steps: (json['steps'] as List<dynamic>?)
?.map((e) =>
e == null ? null : Step.fromJson(e as Map<String, dynamic>))
.toList(),
tags: (json['tags'] as List<dynamic>?)?.map((e) => e as String).toList(),
type: json['type'] as String?,
state: json['state'] as String?,
title: json['title'] as String?,
description: json['description'] as String?,
video_url: json['video_url'] as String?,
videoUrl: json['video_url'] as String?,
image: json['image'] as String?,
totalCookingTime: (json['totalCookingTime'] as num?)?.toInt(),
activeCookTime: (json['activeCookTime'] as num?)?.toInt(),
@@ -46,7 +38,7 @@ Map<String, dynamic> _$$RecipeModelImplToJson(_$RecipeModelImpl instance) =>
'state': instance.state,
'title': instance.title,
'description': instance.description,
'video_url': instance.video_url,
'video_url': instance.videoUrl,
'image': instance.image,
'totalCookingTime': instance.totalCookingTime,
'activeCookTime': instance.activeCookTime,

View File

@@ -12,8 +12,7 @@ part of 'recipe_tag_model.dart';
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',
);
'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');
RecipeTagModel _$RecipeTagModelFromJson(Map<String, dynamic> json) {
return _RecipeTagModel.fromJson(json);
@@ -41,15 +40,13 @@ mixin _$RecipeTagModel {
/// @nodoc
abstract class $RecipeTagModelCopyWith<$Res> {
factory $RecipeTagModelCopyWith(
RecipeTagModel value,
$Res Function(RecipeTagModel) then,
) = _$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>;
RecipeTagModel value, $Res Function(RecipeTagModel) then) =
_$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>;
@useResult
$Res call({
@JsonKey(name: "data") List<RecipeTag> data,
@JsonKey(name: "links") Links links,
@JsonKey(name: "meta") Meta meta,
});
$Res call(
{@JsonKey(name: "data") List<RecipeTag> data,
@JsonKey(name: "links") Links links,
@JsonKey(name: "meta") Meta meta});
$LinksCopyWith<$Res> get links;
$MetaCopyWith<$Res> get meta;
@@ -69,27 +66,25 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? data = null, Object? links = null, Object? meta = null}) {
return _then(
_value.copyWith(
data:
null == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as List<RecipeTag>,
links:
null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
as Links,
meta:
null == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as Meta,
)
as $Val,
);
$Res call({
Object? data = null,
Object? links = null,
Object? meta = null,
}) {
return _then(_value.copyWith(
data: null == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as List<RecipeTag>,
links: null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
as Links,
meta: null == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as Meta,
) as $Val);
}
/// Create a copy of RecipeTagModel
@@ -116,17 +111,15 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel>
/// @nodoc
abstract class _$$RecipeTagModelImplCopyWith<$Res>
implements $RecipeTagModelCopyWith<$Res> {
factory _$$RecipeTagModelImplCopyWith(
_$RecipeTagModelImpl value,
$Res Function(_$RecipeTagModelImpl) then,
) = __$$RecipeTagModelImplCopyWithImpl<$Res>;
factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value,
$Res Function(_$RecipeTagModelImpl) then) =
__$$RecipeTagModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: "data") List<RecipeTag> data,
@JsonKey(name: "links") Links links,
@JsonKey(name: "meta") Meta meta,
});
$Res call(
{@JsonKey(name: "data") List<RecipeTag> data,
@JsonKey(name: "links") Links links,
@JsonKey(name: "meta") Meta meta});
@override
$LinksCopyWith<$Res> get links;
@@ -139,45 +132,43 @@ class __$$RecipeTagModelImplCopyWithImpl<$Res>
extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl>
implements _$$RecipeTagModelImplCopyWith<$Res> {
__$$RecipeTagModelImplCopyWithImpl(
_$RecipeTagModelImpl _value,
$Res Function(_$RecipeTagModelImpl) _then,
) : super(_value, _then);
_$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeTagModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? data = null, Object? links = null, Object? meta = null}) {
return _then(
_$RecipeTagModelImpl(
data:
null == data
? _value._data
: data // ignore: cast_nullable_to_non_nullable
as List<RecipeTag>,
links:
null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
as Links,
meta:
null == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as Meta,
),
);
$Res call({
Object? data = null,
Object? links = null,
Object? meta = null,
}) {
return _then(_$RecipeTagModelImpl(
data: null == data
? _value._data
: data // ignore: cast_nullable_to_non_nullable
as List<RecipeTag>,
links: null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
as Links,
meta: null == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as Meta,
));
}
}
/// @nodoc
@JsonSerializable()
class _$RecipeTagModelImpl implements _RecipeTagModel {
const _$RecipeTagModelImpl({
@JsonKey(name: "data") required final List<RecipeTag> data,
@JsonKey(name: "links") required this.links,
@JsonKey(name: "meta") required this.meta,
}) : _data = data;
const _$RecipeTagModelImpl(
{@JsonKey(name: "data") required final List<RecipeTag> data,
@JsonKey(name: "links") required this.links,
@JsonKey(name: "meta") required this.meta})
: _data = data;
factory _$RecipeTagModelImpl.fromJson(Map<String, dynamic> json) =>
_$$RecipeTagModelImplFromJson(json);
@@ -216,11 +207,7 @@ class _$RecipeTagModelImpl implements _RecipeTagModel {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_data),
links,
meta,
);
runtimeType, const DeepCollectionEquality().hash(_data), links, meta);
/// Create a copy of RecipeTagModel
/// with the given fields replaced by the non-null parameter values.
@@ -229,22 +216,21 @@ class _$RecipeTagModelImpl implements _RecipeTagModel {
@pragma('vm:prefer-inline')
_$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith =>
__$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$RecipeTagModelImplToJson(this);
return _$$RecipeTagModelImplToJson(
this,
);
}
}
abstract class _RecipeTagModel implements RecipeTagModel {
const factory _RecipeTagModel({
@JsonKey(name: "data") required final List<RecipeTag> data,
@JsonKey(name: "links") required final Links links,
@JsonKey(name: "meta") required final Meta meta,
}) = _$RecipeTagModelImpl;
const factory _RecipeTagModel(
{@JsonKey(name: "data") required final List<RecipeTag> data,
@JsonKey(name: "links") required final Links links,
@JsonKey(name: "meta") required final Meta meta}) = _$RecipeTagModelImpl;
factory _RecipeTagModel.fromJson(Map<String, dynamic> json) =
_$RecipeTagModelImpl.fromJson;
@@ -299,13 +285,12 @@ abstract class $RecipeTagCopyWith<$Res> {
factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) =
_$RecipeTagCopyWithImpl<$Res, RecipeTag>;
@useResult
$Res call({
@JsonKey(name: "id") int id,
@JsonKey(name: "name") String name,
@JsonKey(name: "recipes_count") int recipesCount,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt,
});
$Res call(
{@JsonKey(name: "id") int id,
@JsonKey(name: "name") String name,
@JsonKey(name: "recipes_count") int recipesCount,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt});
}
/// @nodoc
@@ -329,36 +314,28 @@ class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag>
Object? createdAt = null,
Object? updatedAt = null,
}) {
return _then(
_value.copyWith(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
recipesCount:
null == recipesCount
? _value.recipesCount
: recipesCount // ignore: cast_nullable_to_non_nullable
as int,
createdAt:
null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt:
null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
)
as $Val,
);
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
recipesCount: null == recipesCount
? _value.recipesCount
: recipesCount // ignore: cast_nullable_to_non_nullable
as int,
createdAt: null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
) as $Val);
}
}
@@ -366,18 +343,16 @@ class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag>
abstract class _$$RecipeTagImplCopyWith<$Res>
implements $RecipeTagCopyWith<$Res> {
factory _$$RecipeTagImplCopyWith(
_$RecipeTagImpl value,
$Res Function(_$RecipeTagImpl) then,
) = __$$RecipeTagImplCopyWithImpl<$Res>;
_$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) =
__$$RecipeTagImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: "id") int id,
@JsonKey(name: "name") String name,
@JsonKey(name: "recipes_count") int recipesCount,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt,
});
$Res call(
{@JsonKey(name: "id") int id,
@JsonKey(name: "name") String name,
@JsonKey(name: "recipes_count") int recipesCount,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt});
}
/// @nodoc
@@ -385,9 +360,8 @@ class __$$RecipeTagImplCopyWithImpl<$Res>
extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl>
implements _$$RecipeTagImplCopyWith<$Res> {
__$$RecipeTagImplCopyWithImpl(
_$RecipeTagImpl _value,
$Res Function(_$RecipeTagImpl) _then,
) : super(_value, _then);
_$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeTag
/// with the given fields replaced by the non-null parameter values.
@@ -400,48 +374,40 @@ class __$$RecipeTagImplCopyWithImpl<$Res>
Object? createdAt = null,
Object? updatedAt = null,
}) {
return _then(
_$RecipeTagImpl(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
recipesCount:
null == recipesCount
? _value.recipesCount
: recipesCount // ignore: cast_nullable_to_non_nullable
as int,
createdAt:
null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt:
null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
),
);
return _then(_$RecipeTagImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
recipesCount: null == recipesCount
? _value.recipesCount
: recipesCount // ignore: cast_nullable_to_non_nullable
as int,
createdAt: null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
));
}
}
/// @nodoc
@JsonSerializable()
class _$RecipeTagImpl implements _RecipeTag {
const _$RecipeTagImpl({
@JsonKey(name: "id") required this.id,
@JsonKey(name: "name") required this.name,
@JsonKey(name: "recipes_count") required this.recipesCount,
@JsonKey(name: "created_at") required this.createdAt,
@JsonKey(name: "updated_at") required this.updatedAt,
});
const _$RecipeTagImpl(
{@JsonKey(name: "id") required this.id,
@JsonKey(name: "name") required this.name,
@JsonKey(name: "recipes_count") required this.recipesCount,
@JsonKey(name: "created_at") required this.createdAt,
@JsonKey(name: "updated_at") required this.updatedAt});
factory _$RecipeTagImpl.fromJson(Map<String, dynamic> json) =>
_$$RecipeTagImplFromJson(json);
@@ -497,18 +463,20 @@ class _$RecipeTagImpl implements _RecipeTag {
@override
Map<String, dynamic> toJson() {
return _$$RecipeTagImplToJson(this);
return _$$RecipeTagImplToJson(
this,
);
}
}
abstract class _RecipeTag implements RecipeTag {
const factory _RecipeTag({
@JsonKey(name: "id") required final int id,
@JsonKey(name: "name") required final String name,
@JsonKey(name: "recipes_count") required final int recipesCount,
@JsonKey(name: "created_at") required final DateTime createdAt,
@JsonKey(name: "updated_at") required final DateTime updatedAt,
}) = _$RecipeTagImpl;
const factory _RecipeTag(
{@JsonKey(name: "id") required final int id,
@JsonKey(name: "name") required final String name,
@JsonKey(name: "recipes_count") required final int recipesCount,
@JsonKey(name: "created_at") required final DateTime createdAt,
@JsonKey(name: "updated_at") required final DateTime updatedAt}) =
_$RecipeTagImpl;
factory _RecipeTag.fromJson(Map<String, dynamic> json) =
_$RecipeTagImpl.fromJson;

View File

@@ -8,21 +8,20 @@ part of 'recipe_tag_model.dart';
_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map<String, dynamic> json) =>
_$RecipeTagModelImpl(
data:
(json['data'] as List<dynamic>)
.map((e) => RecipeTag.fromJson(e as Map<String, dynamic>))
.toList(),
data: (json['data'] as List<dynamic>)
.map((e) => RecipeTag.fromJson(e as Map<String, dynamic>))
.toList(),
links: Links.fromJson(json['links'] as Map<String, dynamic>),
meta: Meta.fromJson(json['meta'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$RecipeTagModelImplToJson(
_$RecipeTagModelImpl instance,
) => <String, dynamic>{
'data': instance.data,
'links': instance.links,
'meta': instance.meta,
};
_$RecipeTagModelImpl instance) =>
<String, dynamic>{
'data': instance.data,
'links': instance.links,
'meta': instance.meta,
};
_$RecipeTagImpl _$$RecipeTagImplFromJson(Map<String, dynamic> json) =>
_$RecipeTagImpl(

View File

@@ -12,8 +12,7 @@ part of 'step.dart';
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',
);
'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');
Step _$StepFromJson(Map<String, dynamic> json) {
return _Step.fromJson(json);
@@ -55,31 +54,28 @@ class _$StepCopyWithImpl<$Res, $Val extends Step>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? image = freezed, Object? description = freezed}) {
return _then(
_value.copyWith(
image:
freezed == image
? _value.image
: image // ignore: cast_nullable_to_non_nullable
as String?,
description:
freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
)
as $Val,
);
$Res call({
Object? image = freezed,
Object? description = freezed,
}) {
return _then(_value.copyWith(
image: freezed == image
? _value.image
: image // ignore: cast_nullable_to_non_nullable
as String?,
description: freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
}
/// @nodoc
abstract class _$$StepImplCopyWith<$Res> implements $StepCopyWith<$Res> {
factory _$$StepImplCopyWith(
_$StepImpl value,
$Res Function(_$StepImpl) then,
) = __$$StepImplCopyWithImpl<$Res>;
_$StepImpl value, $Res Function(_$StepImpl) then) =
__$$StepImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String? image, String? description});
@@ -90,27 +86,26 @@ class __$$StepImplCopyWithImpl<$Res>
extends _$StepCopyWithImpl<$Res, _$StepImpl>
implements _$$StepImplCopyWith<$Res> {
__$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then)
: super(_value, _then);
: super(_value, _then);
/// Create a copy of Step
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? image = freezed, Object? description = freezed}) {
return _then(
_$StepImpl(
image:
freezed == image
? _value.image
: image // ignore: cast_nullable_to_non_nullable
as String?,
description:
freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
),
);
$Res call({
Object? image = freezed,
Object? description = freezed,
}) {
return _then(_$StepImpl(
image: freezed == image
? _value.image
: image // ignore: cast_nullable_to_non_nullable
as String?,
description: freezed == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
@@ -156,7 +151,9 @@ class _$StepImpl implements _Step {
@override
Map<String, dynamic> toJson() {
return _$$StepImplToJson(this);
return _$$StepImplToJson(
this,
);
}
}

View File

@@ -7,9 +7,9 @@ part of 'step.dart';
// **************************************************************************
_$StepImpl _$$StepImplFromJson(Map<String, dynamic> json) => _$StepImpl(
image: json['image'] as String?,
description: json['description'] as String?,
);
image: json['image'] as String?,
description: json['description'] as String?,
);
Map<String, dynamic> _$$StepImplToJson(_$StepImpl instance) =>
<String, dynamic>{