forked from eatvio/eatvio_app
feat(feed): add recipes screen
This commit is contained in:
@@ -21,28 +21,34 @@ FeedBlogPostModel _$FeedBlogPostModelFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$FeedBlogPostModel {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
|
||||
String get state => throw _privateConstructorUsedError;
|
||||
|
||||
String get image => throw _privateConstructorUsedError;
|
||||
|
||||
String get description => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "youtube_url")
|
||||
String get youtubeUrl => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "updated_at")
|
||||
DateTime get updatedAt => throw _privateConstructorUsedError;
|
||||
|
||||
String get title => throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
$FeedBlogPostModelCopyWith<FeedBlogPostModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
$FeedBlogPostModelCopyWith<FeedBlogPostModel> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $FeedBlogPostModelCopyWith<$Res> {
|
||||
factory $FeedBlogPostModelCopyWith(
|
||||
FeedBlogPostModel value, $Res Function(FeedBlogPostModel) then) =
|
||||
_$FeedBlogPostModelCopyWithImpl<$Res, FeedBlogPostModel>;
|
||||
factory $FeedBlogPostModelCopyWith(FeedBlogPostModel value, $Res Function(FeedBlogPostModel) then) = _$FeedBlogPostModelCopyWithImpl<$Res, FeedBlogPostModel>;
|
||||
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@@ -56,12 +62,12 @@ abstract class $FeedBlogPostModelCopyWith<$Res> {
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel>
|
||||
implements $FeedBlogPostModelCopyWith<$Res> {
|
||||
class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> implements $FeedBlogPostModelCopyWith<$Res> {
|
||||
_$FeedBlogPostModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -115,11 +121,10 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel>
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FeedBlogPostModelImplCopyWith<$Res>
|
||||
implements $FeedBlogPostModelCopyWith<$Res> {
|
||||
factory _$$FeedBlogPostModelImplCopyWith(_$FeedBlogPostModelImpl value,
|
||||
$Res Function(_$FeedBlogPostModelImpl) then) =
|
||||
abstract class _$$FeedBlogPostModelImplCopyWith<$Res> implements $FeedBlogPostModelCopyWith<$Res> {
|
||||
factory _$$FeedBlogPostModelImplCopyWith(_$FeedBlogPostModelImpl value, $Res Function(_$FeedBlogPostModelImpl) then) =
|
||||
__$$FeedBlogPostModelImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
@@ -134,12 +139,9 @@ abstract class _$$FeedBlogPostModelImplCopyWith<$Res>
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FeedBlogPostModelImplCopyWithImpl<$Res>
|
||||
extends _$FeedBlogPostModelCopyWithImpl<$Res, _$FeedBlogPostModelImpl>
|
||||
class __$$FeedBlogPostModelImplCopyWithImpl<$Res> extends _$FeedBlogPostModelCopyWithImpl<$Res, _$FeedBlogPostModelImpl>
|
||||
implements _$$FeedBlogPostModelImplCopyWith<$Res> {
|
||||
__$$FeedBlogPostModelImplCopyWithImpl(_$FeedBlogPostModelImpl _value,
|
||||
$Res Function(_$FeedBlogPostModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
__$$FeedBlogPostModelImplCopyWithImpl(_$FeedBlogPostModelImpl _value, $Res Function(_$FeedBlogPostModelImpl) _then) : super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
@@ -203,8 +205,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
|
||||
@JsonKey(name: "updated_at") required this.updatedAt,
|
||||
required this.title});
|
||||
|
||||
factory _$FeedBlogPostModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$FeedBlogPostModelImplFromJson(json);
|
||||
factory _$FeedBlogPostModelImpl.fromJson(Map<String, dynamic> json) => _$$FeedBlogPostModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@@ -239,28 +240,21 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.state, state) || other.state == state) &&
|
||||
(identical(other.image, image) || other.image == image) &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description) &&
|
||||
(identical(other.youtubeUrl, youtubeUrl) ||
|
||||
other.youtubeUrl == youtubeUrl) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt) &&
|
||||
(identical(other.description, description) || other.description == description) &&
|
||||
(identical(other.youtubeUrl, youtubeUrl) || other.youtubeUrl == youtubeUrl) &&
|
||||
(identical(other.createdAt, createdAt) || other.createdAt == createdAt) &&
|
||||
(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) &&
|
||||
(identical(other.title, title) || other.title == title));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, state, image, description,
|
||||
youtubeUrl, createdAt, updatedAt, title);
|
||||
int get hashCode => Object.hash(runtimeType, id, state, image, description, youtubeUrl, createdAt, updatedAt, title);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith =>
|
||||
__$$FeedBlogPostModelImplCopyWithImpl<_$FeedBlogPostModelImpl>(
|
||||
this, _$identity);
|
||||
_$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => __$$FeedBlogPostModelImplCopyWithImpl<_$FeedBlogPostModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -281,30 +275,36 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel {
|
||||
@JsonKey(name: "updated_at") required final DateTime updatedAt,
|
||||
required final String title}) = _$FeedBlogPostModelImpl;
|
||||
|
||||
factory _FeedBlogPostModel.fromJson(Map<String, dynamic> json) =
|
||||
_$FeedBlogPostModelImpl.fromJson;
|
||||
factory _FeedBlogPostModel.fromJson(Map<String, dynamic> json) = _$FeedBlogPostModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
|
||||
@override
|
||||
String get state;
|
||||
|
||||
@override
|
||||
String get image;
|
||||
|
||||
@override
|
||||
String get description;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "youtube_url")
|
||||
String get youtubeUrl;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "updated_at")
|
||||
DateTime get updatedAt;
|
||||
|
||||
@override
|
||||
String get title;
|
||||
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
_$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,7 @@ part of 'feed_blog_post_model.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$FeedBlogPostModelImpl(
|
||||
_$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson(Map<String, dynamic> json) => _$FeedBlogPostModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
state: json['state'] as String,
|
||||
image: json['image'] as String,
|
||||
@@ -19,9 +17,7 @@ _$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson(
|
||||
title: json['title'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$FeedBlogPostModelImplToJson(
|
||||
_$FeedBlogPostModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$$FeedBlogPostModelImplToJson(_$FeedBlogPostModelImpl instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'state': instance.state,
|
||||
'image': instance.image,
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'feed_blog_post_settings_model.freezed.dart';
|
||||
|
||||
part 'feed_blog_post_settings_model.g.dart';
|
||||
|
||||
@freezed
|
||||
|
||||
@@ -14,40 +14,37 @@ 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');
|
||||
|
||||
FeedBlogPostSettingsModel _$FeedBlogPostSettingsModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
FeedBlogPostSettingsModel _$FeedBlogPostSettingsModelFromJson(Map<String, dynamic> json) {
|
||||
return _FeedBlogPostSettingsModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$FeedBlogPostSettingsModel {
|
||||
@JsonKey(name: 'data')
|
||||
List<FeedBlogPostModel> get feedBlogPostList =>
|
||||
throw _privateConstructorUsedError;
|
||||
List<FeedBlogPostModel> get feedBlogPostList => throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
$FeedBlogPostSettingsModelCopyWith<FeedBlogPostSettingsModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
$FeedBlogPostSettingsModelCopyWith<FeedBlogPostSettingsModel> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $FeedBlogPostSettingsModelCopyWith<$Res> {
|
||||
factory $FeedBlogPostSettingsModelCopyWith(FeedBlogPostSettingsModel value,
|
||||
$Res Function(FeedBlogPostSettingsModel) then) =
|
||||
factory $FeedBlogPostSettingsModelCopyWith(FeedBlogPostSettingsModel value, $Res Function(FeedBlogPostSettingsModel) then) =
|
||||
_$FeedBlogPostSettingsModelCopyWithImpl<$Res, FeedBlogPostSettingsModel>;
|
||||
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'data') List<FeedBlogPostModel> feedBlogPostList});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$FeedBlogPostSettingsModelCopyWithImpl<$Res,
|
||||
$Val extends FeedBlogPostSettingsModel>
|
||||
implements $FeedBlogPostSettingsModelCopyWith<$Res> {
|
||||
class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, $Val extends FeedBlogPostSettingsModel> implements $FeedBlogPostSettingsModelCopyWith<$Res> {
|
||||
_$FeedBlogPostSettingsModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -66,25 +63,19 @@ class _$FeedBlogPostSettingsModelCopyWithImpl<$Res,
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FeedBlogPostSettingsModelImplCopyWith<$Res>
|
||||
implements $FeedBlogPostSettingsModelCopyWith<$Res> {
|
||||
factory _$$FeedBlogPostSettingsModelImplCopyWith(
|
||||
_$FeedBlogPostSettingsModelImpl value,
|
||||
$Res Function(_$FeedBlogPostSettingsModelImpl) then) =
|
||||
abstract class _$$FeedBlogPostSettingsModelImplCopyWith<$Res> implements $FeedBlogPostSettingsModelCopyWith<$Res> {
|
||||
factory _$$FeedBlogPostSettingsModelImplCopyWith(_$FeedBlogPostSettingsModelImpl value, $Res Function(_$FeedBlogPostSettingsModelImpl) then) =
|
||||
__$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'data') List<FeedBlogPostModel> feedBlogPostList});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res>
|
||||
extends _$FeedBlogPostSettingsModelCopyWithImpl<$Res,
|
||||
_$FeedBlogPostSettingsModelImpl>
|
||||
class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> extends _$FeedBlogPostSettingsModelCopyWithImpl<$Res, _$FeedBlogPostSettingsModelImpl>
|
||||
implements _$$FeedBlogPostSettingsModelImplCopyWith<$Res> {
|
||||
__$$FeedBlogPostSettingsModelImplCopyWithImpl(
|
||||
_$FeedBlogPostSettingsModelImpl _value,
|
||||
$Res Function(_$FeedBlogPostSettingsModelImpl) _then)
|
||||
__$$FeedBlogPostSettingsModelImplCopyWithImpl(_$FeedBlogPostSettingsModelImpl _value, $Res Function(_$FeedBlogPostSettingsModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@@ -104,20 +95,17 @@ class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel {
|
||||
const _$FeedBlogPostSettingsModelImpl(
|
||||
{@JsonKey(name: 'data')
|
||||
required final List<FeedBlogPostModel> feedBlogPostList})
|
||||
const _$FeedBlogPostSettingsModelImpl({@JsonKey(name: 'data') required final List<FeedBlogPostModel> feedBlogPostList})
|
||||
: _feedBlogPostList = feedBlogPostList;
|
||||
|
||||
factory _$FeedBlogPostSettingsModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$FeedBlogPostSettingsModelImplFromJson(json);
|
||||
factory _$FeedBlogPostSettingsModelImpl.fromJson(Map<String, dynamic> json) => _$$FeedBlogPostSettingsModelImplFromJson(json);
|
||||
|
||||
final List<FeedBlogPostModel> _feedBlogPostList;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<FeedBlogPostModel> get feedBlogPostList {
|
||||
if (_feedBlogPostList is EqualUnmodifiableListView)
|
||||
return _feedBlogPostList;
|
||||
if (_feedBlogPostList is EqualUnmodifiableListView) return _feedBlogPostList;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_feedBlogPostList);
|
||||
}
|
||||
@@ -132,21 +120,18 @@ class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$FeedBlogPostSettingsModelImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._feedBlogPostList, _feedBlogPostList));
|
||||
const DeepCollectionEquality().equals(other._feedBlogPostList, _feedBlogPostList));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList));
|
||||
int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList));
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl>
|
||||
get copyWith => __$$FeedBlogPostSettingsModelImplCopyWithImpl<
|
||||
_$FeedBlogPostSettingsModelImpl>(this, _$identity);
|
||||
_$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> get copyWith =>
|
||||
__$$FeedBlogPostSettingsModelImplCopyWithImpl<_$FeedBlogPostSettingsModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -157,19 +142,15 @@ class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel {
|
||||
}
|
||||
|
||||
abstract class _FeedBlogPostSettingsModel implements FeedBlogPostSettingsModel {
|
||||
const factory _FeedBlogPostSettingsModel(
|
||||
{@JsonKey(name: 'data')
|
||||
required final List<FeedBlogPostModel> feedBlogPostList}) =
|
||||
_$FeedBlogPostSettingsModelImpl;
|
||||
const factory _FeedBlogPostSettingsModel({@JsonKey(name: 'data') required final List<FeedBlogPostModel> feedBlogPostList}) = _$FeedBlogPostSettingsModelImpl;
|
||||
|
||||
factory _FeedBlogPostSettingsModel.fromJson(Map<String, dynamic> json) =
|
||||
_$FeedBlogPostSettingsModelImpl.fromJson;
|
||||
factory _FeedBlogPostSettingsModel.fromJson(Map<String, dynamic> json) = _$FeedBlogPostSettingsModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<FeedBlogPostModel> get feedBlogPostList;
|
||||
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
_$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -6,16 +6,14 @@ part of 'feed_blog_post_settings_model.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$FeedBlogPostSettingsModelImpl _$$FeedBlogPostSettingsModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$FeedBlogPostSettingsModelImpl _$$FeedBlogPostSettingsModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$FeedBlogPostSettingsModelImpl(
|
||||
feedBlogPostList: (json['data'] as List<dynamic>)
|
||||
.map((e) => FeedBlogPostModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$FeedBlogPostSettingsModelImplToJson(
|
||||
_$FeedBlogPostSettingsModelImpl instance) =>
|
||||
Map<String, dynamic> _$$FeedBlogPostSettingsModelImplToJson(_$FeedBlogPostSettingsModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.feedBlogPostList,
|
||||
};
|
||||
|
||||
@@ -21,34 +21,48 @@ Recipes _$RecipesFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$Recipes {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
|
||||
String get image => throw _privateConstructorUsedError;
|
||||
|
||||
String get state => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "cooking_time")
|
||||
int get cookingTime => throw _privateConstructorUsedError;
|
||||
|
||||
List<Ingredient> get ingredients => throw _privateConstructorUsedError;
|
||||
|
||||
String get description => throw _privateConstructorUsedError;
|
||||
|
||||
List<Step> get steps => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "video_url")
|
||||
String get videoUrl => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "updated_at")
|
||||
DateTime get updatedAt => throw _privateConstructorUsedError;
|
||||
|
||||
String get title => throw _privateConstructorUsedError;
|
||||
|
||||
String get type => throw _privateConstructorUsedError;
|
||||
|
||||
String get slug => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "comments_count")
|
||||
int get commentsCount => throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
$RecipesCopyWith<Recipes> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $RecipesCopyWith<$Res> {
|
||||
factory $RecipesCopyWith(Recipes value, $Res Function(Recipes) then) =
|
||||
_$RecipesCopyWithImpl<$Res, Recipes>;
|
||||
factory $RecipesCopyWith(Recipes value, $Res Function(Recipes) then) = _$RecipesCopyWithImpl<$Res, Recipes>;
|
||||
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@@ -68,12 +82,12 @@ abstract class $RecipesCopyWith<$Res> {
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$RecipesCopyWithImpl<$Res, $Val extends Recipes>
|
||||
implements $RecipesCopyWith<$Res> {
|
||||
class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> implements $RecipesCopyWith<$Res> {
|
||||
_$RecipesCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -158,9 +172,8 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes>
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RecipesImplCopyWith<$Res> implements $RecipesCopyWith<$Res> {
|
||||
factory _$$RecipesImplCopyWith(
|
||||
_$RecipesImpl value, $Res Function(_$RecipesImpl) then) =
|
||||
__$$RecipesImplCopyWithImpl<$Res>;
|
||||
factory _$$RecipesImplCopyWith(_$RecipesImpl value, $Res Function(_$RecipesImpl) then) = __$$RecipesImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
@@ -181,12 +194,8 @@ abstract class _$$RecipesImplCopyWith<$Res> implements $RecipesCopyWith<$Res> {
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RecipesImplCopyWithImpl<$Res>
|
||||
extends _$RecipesCopyWithImpl<$Res, _$RecipesImpl>
|
||||
implements _$$RecipesImplCopyWith<$Res> {
|
||||
__$$RecipesImplCopyWithImpl(
|
||||
_$RecipesImpl _value, $Res Function(_$RecipesImpl) _then)
|
||||
: super(_value, _then);
|
||||
class __$$RecipesImplCopyWithImpl<$Res> extends _$RecipesCopyWithImpl<$Res, _$RecipesImpl> implements _$$RecipesImplCopyWith<$Res> {
|
||||
__$$RecipesImplCopyWithImpl(_$RecipesImpl _value, $Res Function(_$RecipesImpl) _then) : super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
@@ -288,8 +297,7 @@ class _$RecipesImpl implements _Recipes {
|
||||
: _ingredients = ingredients,
|
||||
_steps = steps;
|
||||
|
||||
factory _$RecipesImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$RecipesImplFromJson(json);
|
||||
factory _$RecipesImpl.fromJson(Map<String, dynamic> json) => _$$RecipesImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@@ -301,6 +309,7 @@ class _$RecipesImpl implements _Recipes {
|
||||
@JsonKey(name: "cooking_time")
|
||||
final int cookingTime;
|
||||
final List<Ingredient> _ingredients;
|
||||
|
||||
@override
|
||||
List<Ingredient> get ingredients {
|
||||
if (_ingredients is EqualUnmodifiableListView) return _ingredients;
|
||||
@@ -311,6 +320,7 @@ class _$RecipesImpl implements _Recipes {
|
||||
@override
|
||||
final String description;
|
||||
final List<Step> _steps;
|
||||
|
||||
@override
|
||||
List<Step> get steps {
|
||||
if (_steps is EqualUnmodifiableListView) return _steps;
|
||||
@@ -350,50 +360,28 @@ class _$RecipesImpl implements _Recipes {
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.image, image) || other.image == image) &&
|
||||
(identical(other.state, state) || other.state == state) &&
|
||||
(identical(other.cookingTime, cookingTime) ||
|
||||
other.cookingTime == cookingTime) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._ingredients, _ingredients) &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description) &&
|
||||
(identical(other.cookingTime, cookingTime) || other.cookingTime == cookingTime) &&
|
||||
const DeepCollectionEquality().equals(other._ingredients, _ingredients) &&
|
||||
(identical(other.description, description) || other.description == description) &&
|
||||
const DeepCollectionEquality().equals(other._steps, _steps) &&
|
||||
(identical(other.videoUrl, videoUrl) ||
|
||||
other.videoUrl == videoUrl) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt) &&
|
||||
(identical(other.videoUrl, videoUrl) || other.videoUrl == videoUrl) &&
|
||||
(identical(other.createdAt, createdAt) || other.createdAt == createdAt) &&
|
||||
(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) &&
|
||||
(identical(other.title, title) || other.title == title) &&
|
||||
(identical(other.type, type) || other.type == type) &&
|
||||
(identical(other.slug, slug) || other.slug == slug) &&
|
||||
(identical(other.commentsCount, commentsCount) ||
|
||||
other.commentsCount == commentsCount));
|
||||
(identical(other.commentsCount, commentsCount) || other.commentsCount == commentsCount));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
image,
|
||||
state,
|
||||
cookingTime,
|
||||
const DeepCollectionEquality().hash(_ingredients),
|
||||
description,
|
||||
const DeepCollectionEquality().hash(_steps),
|
||||
videoUrl,
|
||||
createdAt,
|
||||
updatedAt,
|
||||
title,
|
||||
type,
|
||||
slug,
|
||||
commentsCount);
|
||||
int get hashCode => Object.hash(runtimeType, id, image, state, cookingTime, const DeepCollectionEquality().hash(_ingredients), description,
|
||||
const DeepCollectionEquality().hash(_steps), videoUrl, createdAt, updatedAt, title, type, slug, commentsCount);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RecipesImplCopyWith<_$RecipesImpl> get copyWith =>
|
||||
__$$RecipesImplCopyWithImpl<_$RecipesImpl>(this, _$identity);
|
||||
_$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => __$$RecipesImplCopyWithImpl<_$RecipesImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -405,61 +393,73 @@ class _$RecipesImpl implements _Recipes {
|
||||
|
||||
abstract class _Recipes implements Recipes {
|
||||
const factory _Recipes(
|
||||
{required final int id,
|
||||
required final String image,
|
||||
required final String state,
|
||||
@JsonKey(name: "cooking_time") required final int cookingTime,
|
||||
required final List<Ingredient> ingredients,
|
||||
required final String description,
|
||||
required final List<Step> steps,
|
||||
@JsonKey(name: "video_url") required final String videoUrl,
|
||||
@JsonKey(name: "created_at") required final DateTime createdAt,
|
||||
@JsonKey(name: "updated_at") required final DateTime updatedAt,
|
||||
required final String title,
|
||||
required final String type,
|
||||
required final String slug,
|
||||
@JsonKey(name: "comments_count") required final int commentsCount}) =
|
||||
_$RecipesImpl;
|
||||
{required final int id,
|
||||
required final String image,
|
||||
required final String state,
|
||||
@JsonKey(name: "cooking_time") required final int cookingTime,
|
||||
required final List<Ingredient> ingredients,
|
||||
required final String description,
|
||||
required final List<Step> steps,
|
||||
@JsonKey(name: "video_url") required final String videoUrl,
|
||||
@JsonKey(name: "created_at") required final DateTime createdAt,
|
||||
@JsonKey(name: "updated_at") required final DateTime updatedAt,
|
||||
required final String title,
|
||||
required final String type,
|
||||
required final String slug,
|
||||
@JsonKey(name: "comments_count") required final int commentsCount}) = _$RecipesImpl;
|
||||
|
||||
factory _Recipes.fromJson(Map<String, dynamic> json) = _$RecipesImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
|
||||
@override
|
||||
String get image;
|
||||
|
||||
@override
|
||||
String get state;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "cooking_time")
|
||||
int get cookingTime;
|
||||
|
||||
@override
|
||||
List<Ingredient> get ingredients;
|
||||
|
||||
@override
|
||||
String get description;
|
||||
|
||||
@override
|
||||
List<Step> get steps;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "video_url")
|
||||
String get videoUrl;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "updated_at")
|
||||
DateTime get updatedAt;
|
||||
|
||||
@override
|
||||
String get title;
|
||||
|
||||
@override
|
||||
String get type;
|
||||
|
||||
@override
|
||||
String get slug;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "comments_count")
|
||||
int get commentsCount;
|
||||
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$RecipesImplCopyWith<_$RecipesImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
_$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
Ingredient _$IngredientFromJson(Map<String, dynamic> json) {
|
||||
@@ -469,31 +469,32 @@ Ingredient _$IngredientFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$Ingredient {
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
|
||||
String? get unit => throw _privateConstructorUsedError;
|
||||
|
||||
String get portion => throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
$IngredientCopyWith<Ingredient> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
$IngredientCopyWith<Ingredient> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $IngredientCopyWith<$Res> {
|
||||
factory $IngredientCopyWith(
|
||||
Ingredient value, $Res Function(Ingredient) then) =
|
||||
_$IngredientCopyWithImpl<$Res, Ingredient>;
|
||||
factory $IngredientCopyWith(Ingredient value, $Res Function(Ingredient) then) = _$IngredientCopyWithImpl<$Res, Ingredient>;
|
||||
|
||||
@useResult
|
||||
$Res call({String name, String? unit, String portion});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient>
|
||||
implements $IngredientCopyWith<$Res> {
|
||||
class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> implements $IngredientCopyWith<$Res> {
|
||||
_$IngredientCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -522,23 +523,17 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient>
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$IngredientImplCopyWith<$Res>
|
||||
implements $IngredientCopyWith<$Res> {
|
||||
factory _$$IngredientImplCopyWith(
|
||||
_$IngredientImpl value, $Res Function(_$IngredientImpl) then) =
|
||||
__$$IngredientImplCopyWithImpl<$Res>;
|
||||
abstract class _$$IngredientImplCopyWith<$Res> implements $IngredientCopyWith<$Res> {
|
||||
factory _$$IngredientImplCopyWith(_$IngredientImpl value, $Res Function(_$IngredientImpl) then) = __$$IngredientImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String name, String? unit, String portion});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$IngredientImplCopyWithImpl<$Res>
|
||||
extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl>
|
||||
implements _$$IngredientImplCopyWith<$Res> {
|
||||
__$$IngredientImplCopyWithImpl(
|
||||
_$IngredientImpl _value, $Res Function(_$IngredientImpl) _then)
|
||||
: super(_value, _then);
|
||||
class __$$IngredientImplCopyWithImpl<$Res> extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> implements _$$IngredientImplCopyWith<$Res> {
|
||||
__$$IngredientImplCopyWithImpl(_$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) : super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
@@ -567,11 +562,9 @@ class __$$IngredientImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$IngredientImpl implements _Ingredient {
|
||||
const _$IngredientImpl(
|
||||
{required this.name, this.unit, required this.portion});
|
||||
const _$IngredientImpl({required this.name, this.unit, required this.portion});
|
||||
|
||||
factory _$IngredientImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$IngredientImplFromJson(json);
|
||||
factory _$IngredientImpl.fromJson(Map<String, dynamic> json) => _$$IngredientImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String name;
|
||||
@@ -602,8 +595,7 @@ class _$IngredientImpl implements _Ingredient {
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$IngredientImplCopyWith<_$IngredientImpl> get copyWith =>
|
||||
__$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity);
|
||||
_$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -614,24 +606,22 @@ class _$IngredientImpl implements _Ingredient {
|
||||
}
|
||||
|
||||
abstract class _Ingredient implements Ingredient {
|
||||
const factory _Ingredient(
|
||||
{required final String name,
|
||||
final String? unit,
|
||||
required final String portion}) = _$IngredientImpl;
|
||||
const factory _Ingredient({required final String name, final String? unit, required final String portion}) = _$IngredientImpl;
|
||||
|
||||
factory _Ingredient.fromJson(Map<String, dynamic> json) =
|
||||
_$IngredientImpl.fromJson;
|
||||
factory _Ingredient.fromJson(Map<String, dynamic> json) = _$IngredientImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get name;
|
||||
|
||||
@override
|
||||
String? get unit;
|
||||
|
||||
@override
|
||||
String get portion;
|
||||
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$IngredientImplCopyWith<_$IngredientImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
_$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
Step _$StepFromJson(Map<String, dynamic> json) {
|
||||
@@ -641,28 +631,30 @@ Step _$StepFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$Step {
|
||||
String get image => throw _privateConstructorUsedError;
|
||||
|
||||
String get description => throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
$StepCopyWith<Step> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $StepCopyWith<$Res> {
|
||||
factory $StepCopyWith(Step value, $Res Function(Step) then) =
|
||||
_$StepCopyWithImpl<$Res, Step>;
|
||||
factory $StepCopyWith(Step value, $Res Function(Step) then) = _$StepCopyWithImpl<$Res, Step>;
|
||||
|
||||
@useResult
|
||||
$Res call({String image, String description});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$StepCopyWithImpl<$Res, $Val extends Step>
|
||||
implements $StepCopyWith<$Res> {
|
||||
class _$StepCopyWithImpl<$Res, $Val extends Step> implements $StepCopyWith<$Res> {
|
||||
_$StepCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -687,20 +679,16 @@ class _$StepCopyWithImpl<$Res, $Val extends Step>
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$StepImplCopyWith<$Res> implements $StepCopyWith<$Res> {
|
||||
factory _$$StepImplCopyWith(
|
||||
_$StepImpl value, $Res Function(_$StepImpl) then) =
|
||||
__$$StepImplCopyWithImpl<$Res>;
|
||||
factory _$$StepImplCopyWith(_$StepImpl value, $Res Function(_$StepImpl) then) = __$$StepImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String image, String description});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$StepImplCopyWithImpl<$Res>
|
||||
extends _$StepCopyWithImpl<$Res, _$StepImpl>
|
||||
implements _$$StepImplCopyWith<$Res> {
|
||||
__$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then)
|
||||
: super(_value, _then);
|
||||
class __$$StepImplCopyWithImpl<$Res> extends _$StepCopyWithImpl<$Res, _$StepImpl> implements _$$StepImplCopyWith<$Res> {
|
||||
__$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) : super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
@@ -726,8 +714,7 @@ class __$$StepImplCopyWithImpl<$Res>
|
||||
class _$StepImpl implements _Step {
|
||||
const _$StepImpl({required this.image, required this.description});
|
||||
|
||||
factory _$StepImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$StepImplFromJson(json);
|
||||
factory _$StepImpl.fromJson(Map<String, dynamic> json) => _$$StepImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String image;
|
||||
@@ -745,8 +732,7 @@ class _$StepImpl implements _Step {
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$StepImpl &&
|
||||
(identical(other.image, image) || other.image == image) &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description));
|
||||
(identical(other.description, description) || other.description == description));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@@ -756,8 +742,7 @@ class _$StepImpl implements _Step {
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$StepImplCopyWith<_$StepImpl> get copyWith =>
|
||||
__$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity);
|
||||
_$$StepImplCopyWith<_$StepImpl> get copyWith => __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -768,18 +753,17 @@ class _$StepImpl implements _Step {
|
||||
}
|
||||
|
||||
abstract class _Step implements Step {
|
||||
const factory _Step(
|
||||
{required final String image,
|
||||
required final String description}) = _$StepImpl;
|
||||
const factory _Step({required final String image, required final String description}) = _$StepImpl;
|
||||
|
||||
factory _Step.fromJson(Map<String, dynamic> json) = _$StepImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get image;
|
||||
|
||||
@override
|
||||
String get description;
|
||||
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$StepImplCopyWith<_$StepImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
_$$StepImplCopyWith<_$StepImpl> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -6,19 +6,14 @@ part of 'recipes_model.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$RecipesImpl _$$RecipesImplFromJson(Map<String, dynamic> json) =>
|
||||
_$RecipesImpl(
|
||||
_$RecipesImpl _$$RecipesImplFromJson(Map<String, dynamic> json) => _$RecipesImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
image: json['image'] as String,
|
||||
state: json['state'] as String,
|
||||
cookingTime: (json['cooking_time'] as num).toInt(),
|
||||
ingredients: (json['ingredients'] as List<dynamic>)
|
||||
.map((e) => Ingredient.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
ingredients: (json['ingredients'] as List<dynamic>).map((e) => Ingredient.fromJson(e as Map<String, dynamic>)).toList(),
|
||||
description: json['description'] as String,
|
||||
steps: (json['steps'] as List<dynamic>)
|
||||
.map((e) => Step.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
steps: (json['steps'] as List<dynamic>).map((e) => Step.fromJson(e as Map<String, dynamic>)).toList(),
|
||||
videoUrl: json['video_url'] as String,
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
updatedAt: DateTime.parse(json['updated_at'] as String),
|
||||
@@ -28,8 +23,7 @@ _$RecipesImpl _$$RecipesImplFromJson(Map<String, dynamic> json) =>
|
||||
commentsCount: (json['comments_count'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$RecipesImplToJson(_$RecipesImpl instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$$RecipesImplToJson(_$RecipesImpl instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'image': instance.image,
|
||||
'state': instance.state,
|
||||
@@ -46,15 +40,13 @@ Map<String, dynamic> _$$RecipesImplToJson(_$RecipesImpl instance) =>
|
||||
'comments_count': instance.commentsCount,
|
||||
};
|
||||
|
||||
_$IngredientImpl _$$IngredientImplFromJson(Map<String, dynamic> json) =>
|
||||
_$IngredientImpl(
|
||||
_$IngredientImpl _$$IngredientImplFromJson(Map<String, dynamic> json) => _$IngredientImpl(
|
||||
name: json['name'] as String,
|
||||
unit: json['unit'] as String?,
|
||||
portion: json['portion'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$IngredientImplToJson(_$IngredientImpl instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$$IngredientImplToJson(_$IngredientImpl instance) => <String, dynamic>{
|
||||
'name': instance.name,
|
||||
'unit': instance.unit,
|
||||
'portion': instance.portion,
|
||||
@@ -65,8 +57,7 @@ _$StepImpl _$$StepImplFromJson(Map<String, dynamic> json) => _$StepImpl(
|
||||
description: json['description'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$StepImplToJson(_$StepImpl instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$$StepImplToJson(_$StepImpl instance) => <String, dynamic>{
|
||||
'image': instance.image,
|
||||
'description': instance.description,
|
||||
};
|
||||
|
||||
@@ -2,14 +2,12 @@ import 'package:eatvio_app/features/feed/models/recipes_model.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'recipes_pagination_model.freezed.dart';
|
||||
|
||||
part 'recipes_pagination_model.g.dart';
|
||||
|
||||
@freezed
|
||||
class RecipesPagination with _$RecipesPagination {
|
||||
const factory RecipesPagination({
|
||||
@JsonKey(name: 'data')
|
||||
required List<Recipes> recipesList,
|
||||
@JsonKey(name: 'data') required List<Recipes> recipesList,
|
||||
@JsonKey(name: "current_page") required int currentPage,
|
||||
@JsonKey(name: "first_page_url") required String firstPageUrl,
|
||||
required int from,
|
||||
|
||||
@@ -22,36 +22,46 @@ RecipesPagination _$RecipesPaginationFromJson(Map<String, dynamic> json) {
|
||||
mixin _$RecipesPagination {
|
||||
@JsonKey(name: 'data')
|
||||
List<Recipes> get recipesList => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "current_page")
|
||||
int get currentPage => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "first_page_url")
|
||||
String get firstPageUrl => throw _privateConstructorUsedError;
|
||||
|
||||
int get from => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "last_page")
|
||||
int get lastPage => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "last_page_url")
|
||||
String get lastPageUrl => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "next_page_url")
|
||||
String get nextPageUrl => throw _privateConstructorUsedError;
|
||||
|
||||
String get path => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "per_page")
|
||||
int get perPage => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(name: "prev_page_url")
|
||||
dynamic get prevPageUrl => throw _privateConstructorUsedError;
|
||||
|
||||
int get to => throw _privateConstructorUsedError;
|
||||
|
||||
int get total => throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
$RecipesPaginationCopyWith<RecipesPagination> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
$RecipesPaginationCopyWith<RecipesPagination> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $RecipesPaginationCopyWith<$Res> {
|
||||
factory $RecipesPaginationCopyWith(
|
||||
RecipesPagination value, $Res Function(RecipesPagination) then) =
|
||||
_$RecipesPaginationCopyWithImpl<$Res, RecipesPagination>;
|
||||
factory $RecipesPaginationCopyWith(RecipesPagination value, $Res Function(RecipesPagination) then) = _$RecipesPaginationCopyWithImpl<$Res, RecipesPagination>;
|
||||
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'data') List<Recipes> recipesList,
|
||||
@@ -69,12 +79,12 @@ abstract class $RecipesPaginationCopyWith<$Res> {
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination>
|
||||
implements $RecipesPaginationCopyWith<$Res> {
|
||||
class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> implements $RecipesPaginationCopyWith<$Res> {
|
||||
_$RecipesPaginationCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -148,11 +158,10 @@ class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination>
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RecipesPaginationImplCopyWith<$Res>
|
||||
implements $RecipesPaginationCopyWith<$Res> {
|
||||
factory _$$RecipesPaginationImplCopyWith(_$RecipesPaginationImpl value,
|
||||
$Res Function(_$RecipesPaginationImpl) then) =
|
||||
abstract class _$$RecipesPaginationImplCopyWith<$Res> implements $RecipesPaginationCopyWith<$Res> {
|
||||
factory _$$RecipesPaginationImplCopyWith(_$RecipesPaginationImpl value, $Res Function(_$RecipesPaginationImpl) then) =
|
||||
__$$RecipesPaginationImplCopyWithImpl<$Res>;
|
||||
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
@@ -171,12 +180,9 @@ abstract class _$$RecipesPaginationImplCopyWith<$Res>
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RecipesPaginationImplCopyWithImpl<$Res>
|
||||
extends _$RecipesPaginationCopyWithImpl<$Res, _$RecipesPaginationImpl>
|
||||
class __$$RecipesPaginationImplCopyWithImpl<$Res> extends _$RecipesPaginationCopyWithImpl<$Res, _$RecipesPaginationImpl>
|
||||
implements _$$RecipesPaginationImplCopyWith<$Res> {
|
||||
__$$RecipesPaginationImplCopyWithImpl(_$RecipesPaginationImpl _value,
|
||||
$Res Function(_$RecipesPaginationImpl) _then)
|
||||
: super(_value, _then);
|
||||
__$$RecipesPaginationImplCopyWithImpl(_$RecipesPaginationImpl _value, $Res Function(_$RecipesPaginationImpl) _then) : super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
@@ -265,10 +271,10 @@ class _$RecipesPaginationImpl implements _RecipesPagination {
|
||||
required this.total})
|
||||
: _recipesList = recipesList;
|
||||
|
||||
factory _$RecipesPaginationImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$RecipesPaginationImplFromJson(json);
|
||||
factory _$RecipesPaginationImpl.fromJson(Map<String, dynamic> json) => _$$RecipesPaginationImplFromJson(json);
|
||||
|
||||
final List<Recipes> _recipesList;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<Recipes> get recipesList {
|
||||
@@ -317,50 +323,29 @@ class _$RecipesPaginationImpl implements _RecipesPagination {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$RecipesPaginationImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._recipesList, _recipesList) &&
|
||||
(identical(other.currentPage, currentPage) ||
|
||||
other.currentPage == currentPage) &&
|
||||
(identical(other.firstPageUrl, firstPageUrl) ||
|
||||
other.firstPageUrl == firstPageUrl) &&
|
||||
const DeepCollectionEquality().equals(other._recipesList, _recipesList) &&
|
||||
(identical(other.currentPage, currentPage) || other.currentPage == currentPage) &&
|
||||
(identical(other.firstPageUrl, firstPageUrl) || other.firstPageUrl == firstPageUrl) &&
|
||||
(identical(other.from, from) || other.from == from) &&
|
||||
(identical(other.lastPage, lastPage) ||
|
||||
other.lastPage == lastPage) &&
|
||||
(identical(other.lastPageUrl, lastPageUrl) ||
|
||||
other.lastPageUrl == lastPageUrl) &&
|
||||
(identical(other.nextPageUrl, nextPageUrl) ||
|
||||
other.nextPageUrl == nextPageUrl) &&
|
||||
(identical(other.lastPage, lastPage) || other.lastPage == lastPage) &&
|
||||
(identical(other.lastPageUrl, lastPageUrl) || other.lastPageUrl == lastPageUrl) &&
|
||||
(identical(other.nextPageUrl, nextPageUrl) || other.nextPageUrl == nextPageUrl) &&
|
||||
(identical(other.path, path) || other.path == path) &&
|
||||
(identical(other.perPage, perPage) || other.perPage == perPage) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other.prevPageUrl, prevPageUrl) &&
|
||||
const DeepCollectionEquality().equals(other.prevPageUrl, prevPageUrl) &&
|
||||
(identical(other.to, to) || other.to == to) &&
|
||||
(identical(other.total, total) || other.total == total));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
const DeepCollectionEquality().hash(_recipesList),
|
||||
currentPage,
|
||||
firstPageUrl,
|
||||
from,
|
||||
lastPage,
|
||||
lastPageUrl,
|
||||
nextPageUrl,
|
||||
path,
|
||||
perPage,
|
||||
const DeepCollectionEquality().hash(prevPageUrl),
|
||||
to,
|
||||
total);
|
||||
int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_recipesList), currentPage, firstPageUrl, from, lastPage, lastPageUrl,
|
||||
nextPageUrl, path, perPage, const DeepCollectionEquality().hash(prevPageUrl), to, total);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith =>
|
||||
__$$RecipesPaginationImplCopyWithImpl<_$RecipesPaginationImpl>(
|
||||
this, _$identity);
|
||||
_$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => __$$RecipesPaginationImplCopyWithImpl<_$RecipesPaginationImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -385,43 +370,53 @@ abstract class _RecipesPagination implements RecipesPagination {
|
||||
required final int to,
|
||||
required final int total}) = _$RecipesPaginationImpl;
|
||||
|
||||
factory _RecipesPagination.fromJson(Map<String, dynamic> json) =
|
||||
_$RecipesPaginationImpl.fromJson;
|
||||
factory _RecipesPagination.fromJson(Map<String, dynamic> json) = _$RecipesPaginationImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<Recipes> get recipesList;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "current_page")
|
||||
int get currentPage;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "first_page_url")
|
||||
String get firstPageUrl;
|
||||
|
||||
@override
|
||||
int get from;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "last_page")
|
||||
int get lastPage;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "last_page_url")
|
||||
String get lastPageUrl;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "next_page_url")
|
||||
String get nextPageUrl;
|
||||
|
||||
@override
|
||||
String get path;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "per_page")
|
||||
int get perPage;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "prev_page_url")
|
||||
dynamic get prevPageUrl;
|
||||
|
||||
@override
|
||||
int get to;
|
||||
|
||||
@override
|
||||
int get total;
|
||||
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
_$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -6,12 +6,8 @@ part of 'recipes_pagination_model.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$RecipesPaginationImpl _$$RecipesPaginationImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$RecipesPaginationImpl(
|
||||
recipesList: (json['data'] as List<dynamic>)
|
||||
.map((e) => Recipes.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
_$RecipesPaginationImpl _$$RecipesPaginationImplFromJson(Map<String, dynamic> json) => _$RecipesPaginationImpl(
|
||||
recipesList: (json['data'] as List<dynamic>).map((e) => Recipes.fromJson(e as Map<String, dynamic>)).toList(),
|
||||
currentPage: (json['current_page'] as num).toInt(),
|
||||
firstPageUrl: json['first_page_url'] as String,
|
||||
from: (json['from'] as num).toInt(),
|
||||
@@ -25,9 +21,7 @@ _$RecipesPaginationImpl _$$RecipesPaginationImplFromJson(
|
||||
total: (json['total'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$RecipesPaginationImplToJson(
|
||||
_$RecipesPaginationImpl instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$$RecipesPaginationImplToJson(_$RecipesPaginationImpl instance) => <String, dynamic>{
|
||||
'data': instance.recipesList,
|
||||
'current_page': instance.currentPage,
|
||||
'first_page_url': instance.firstPageUrl,
|
||||
|
||||
@@ -24,6 +24,7 @@ mixin _$FeedState {
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
@@ -70,35 +71,28 @@ mixin _$FeedState {
|
||||
|
||||
/// @nodoc
|
||||
abstract class $FeedStateCopyWith<$Res> {
|
||||
factory $FeedStateCopyWith(FeedState value, $Res Function(FeedState) then) =
|
||||
_$FeedStateCopyWithImpl<$Res, FeedState>;
|
||||
factory $FeedStateCopyWith(FeedState value, $Res Function(FeedState) then) = _$FeedStateCopyWithImpl<$Res, FeedState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState>
|
||||
implements $FeedStateCopyWith<$Res> {
|
||||
class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> implements $FeedStateCopyWith<$Res> {
|
||||
_$FeedStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FeedStateImplCopyWith<$Res> {
|
||||
factory _$$FeedStateImplCopyWith(
|
||||
_$FeedStateImpl value, $Res Function(_$FeedStateImpl) then) =
|
||||
__$$FeedStateImplCopyWithImpl<$Res>;
|
||||
factory _$$FeedStateImplCopyWith(_$FeedStateImpl value, $Res Function(_$FeedStateImpl) then) = __$$FeedStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FeedStateImplCopyWithImpl<$Res>
|
||||
extends _$FeedStateCopyWithImpl<$Res, _$FeedStateImpl>
|
||||
implements _$$FeedStateImplCopyWith<$Res> {
|
||||
__$$FeedStateImplCopyWithImpl(
|
||||
_$FeedStateImpl _value, $Res Function(_$FeedStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
class __$$FeedStateImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateImpl> implements _$$FeedStateImplCopyWith<$Res> {
|
||||
__$$FeedStateImplCopyWithImpl(_$FeedStateImpl _value, $Res Function(_$FeedStateImpl) _then) : super(_value, _then);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -113,8 +107,7 @@ class _$FeedStateImpl implements _FeedState {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$FeedStateImpl);
|
||||
return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -201,18 +194,14 @@ abstract class _FeedState implements FeedState {
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FeedStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$FeedStateLoadingImplCopyWith(_$FeedStateLoadingImpl value,
|
||||
$Res Function(_$FeedStateLoadingImpl) then) =
|
||||
factory _$$FeedStateLoadingImplCopyWith(_$FeedStateLoadingImpl value, $Res Function(_$FeedStateLoadingImpl) then) =
|
||||
__$$FeedStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FeedStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadingImpl>
|
||||
class __$$FeedStateLoadingImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadingImpl>
|
||||
implements _$$FeedStateLoadingImplCopyWith<$Res> {
|
||||
__$$FeedStateLoadingImplCopyWithImpl(_$FeedStateLoadingImpl _value,
|
||||
$Res Function(_$FeedStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
__$$FeedStateLoadingImplCopyWithImpl(_$FeedStateLoadingImpl _value, $Res Function(_$FeedStateLoadingImpl) _then) : super(_value, _then);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -227,8 +216,7 @@ class _$FeedStateLoadingImpl implements FeedStateLoading {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$FeedStateLoadingImpl);
|
||||
return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -315,20 +303,15 @@ abstract class FeedStateLoading implements FeedState {
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FeedStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$FeedStateLoadedImplCopyWith(_$FeedStateLoadedImpl value,
|
||||
$Res Function(_$FeedStateLoadedImpl) then) =
|
||||
__$$FeedStateLoadedImplCopyWithImpl<$Res>;
|
||||
factory _$$FeedStateLoadedImplCopyWith(_$FeedStateLoadedImpl value, $Res Function(_$FeedStateLoadedImpl) then) = __$$FeedStateLoadedImplCopyWithImpl<$Res>;
|
||||
|
||||
@useResult
|
||||
$Res call({List<FeedBlogPostModel> feedBlogPostList});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FeedStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadedImpl>
|
||||
implements _$$FeedStateLoadedImplCopyWith<$Res> {
|
||||
__$$FeedStateLoadedImplCopyWithImpl(
|
||||
_$FeedStateLoadedImpl _value, $Res Function(_$FeedStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
class __$$FeedStateLoadedImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadedImpl> implements _$$FeedStateLoadedImplCopyWith<$Res> {
|
||||
__$$FeedStateLoadedImplCopyWithImpl(_$FeedStateLoadedImpl _value, $Res Function(_$FeedStateLoadedImpl) _then) : super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
@@ -347,15 +330,13 @@ class __$$FeedStateLoadedImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
|
||||
class _$FeedStateLoadedImpl implements FeedStateLoaded {
|
||||
const _$FeedStateLoadedImpl(
|
||||
{required final List<FeedBlogPostModel> feedBlogPostList})
|
||||
: _feedBlogPostList = feedBlogPostList;
|
||||
const _$FeedStateLoadedImpl({required final List<FeedBlogPostModel> feedBlogPostList}) : _feedBlogPostList = feedBlogPostList;
|
||||
|
||||
final List<FeedBlogPostModel> _feedBlogPostList;
|
||||
|
||||
@override
|
||||
List<FeedBlogPostModel> get feedBlogPostList {
|
||||
if (_feedBlogPostList is EqualUnmodifiableListView)
|
||||
return _feedBlogPostList;
|
||||
if (_feedBlogPostList is EqualUnmodifiableListView) return _feedBlogPostList;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_feedBlogPostList);
|
||||
}
|
||||
@@ -370,20 +351,16 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$FeedStateLoadedImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._feedBlogPostList, _feedBlogPostList));
|
||||
const DeepCollectionEquality().equals(other._feedBlogPostList, _feedBlogPostList));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList));
|
||||
int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList));
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith =>
|
||||
__$$FeedStateLoadedImplCopyWithImpl<_$FeedStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
_$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => __$$FeedStateLoadedImplCopyWithImpl<_$FeedStateLoadedImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
@@ -461,32 +438,25 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded {
|
||||
}
|
||||
|
||||
abstract class FeedStateLoaded implements FeedState {
|
||||
const factory FeedStateLoaded(
|
||||
{required final List<FeedBlogPostModel> feedBlogPostList}) =
|
||||
_$FeedStateLoadedImpl;
|
||||
const factory FeedStateLoaded({required final List<FeedBlogPostModel> feedBlogPostList}) = _$FeedStateLoadedImpl;
|
||||
|
||||
List<FeedBlogPostModel> get feedBlogPostList;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
_$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
_$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FeedStateErrorImplCopyWith<$Res> {
|
||||
factory _$$FeedStateErrorImplCopyWith(_$FeedStateErrorImpl value,
|
||||
$Res Function(_$FeedStateErrorImpl) then) =
|
||||
__$$FeedStateErrorImplCopyWithImpl<$Res>;
|
||||
factory _$$FeedStateErrorImplCopyWith(_$FeedStateErrorImpl value, $Res Function(_$FeedStateErrorImpl) then) = __$$FeedStateErrorImplCopyWithImpl<$Res>;
|
||||
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FeedStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$FeedStateCopyWithImpl<$Res, _$FeedStateErrorImpl>
|
||||
implements _$$FeedStateErrorImplCopyWith<$Res> {
|
||||
__$$FeedStateErrorImplCopyWithImpl(
|
||||
_$FeedStateErrorImpl _value, $Res Function(_$FeedStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
class __$$FeedStateErrorImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateErrorImpl> implements _$$FeedStateErrorImplCopyWith<$Res> {
|
||||
__$$FeedStateErrorImplCopyWithImpl(_$FeedStateErrorImpl _value, $Res Function(_$FeedStateErrorImpl) _then) : super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
@@ -520,8 +490,7 @@ class _$FeedStateErrorImpl implements FeedStateError {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$FeedStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -530,9 +499,7 @@ class _$FeedStateErrorImpl implements FeedStateError {
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith =>
|
||||
__$$FeedStateErrorImplCopyWithImpl<_$FeedStateErrorImpl>(
|
||||
this, _$identity);
|
||||
_$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => __$$FeedStateErrorImplCopyWithImpl<_$FeedStateErrorImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
@@ -610,11 +577,10 @@ class _$FeedStateErrorImpl implements FeedStateError {
|
||||
}
|
||||
|
||||
abstract class FeedStateError implements FeedState {
|
||||
const factory FeedStateError({required final String errorMessage}) =
|
||||
_$FeedStateErrorImpl;
|
||||
const factory FeedStateError({required final String errorMessage}) = _$FeedStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
_$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
_$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -15,4 +15,4 @@ class RecipesCubit extends Cubit<RecipesState> {
|
||||
emit(RecipesState.error(errorMessage: e.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ mixin _$RecipesState {
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
@@ -70,36 +71,28 @@ mixin _$RecipesState {
|
||||
|
||||
/// @nodoc
|
||||
abstract class $RecipesStateCopyWith<$Res> {
|
||||
factory $RecipesStateCopyWith(
|
||||
RecipesState value, $Res Function(RecipesState) then) =
|
||||
_$RecipesStateCopyWithImpl<$Res, RecipesState>;
|
||||
factory $RecipesStateCopyWith(RecipesState value, $Res Function(RecipesState) then) = _$RecipesStateCopyWithImpl<$Res, RecipesState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState>
|
||||
implements $RecipesStateCopyWith<$Res> {
|
||||
class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> implements $RecipesStateCopyWith<$Res> {
|
||||
_$RecipesStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RecipesStateImplCopyWith<$Res> {
|
||||
factory _$$RecipesStateImplCopyWith(
|
||||
_$RecipesStateImpl value, $Res Function(_$RecipesStateImpl) then) =
|
||||
__$$RecipesStateImplCopyWithImpl<$Res>;
|
||||
factory _$$RecipesStateImplCopyWith(_$RecipesStateImpl value, $Res Function(_$RecipesStateImpl) then) = __$$RecipesStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RecipesStateImplCopyWithImpl<$Res>
|
||||
extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateImpl>
|
||||
implements _$$RecipesStateImplCopyWith<$Res> {
|
||||
__$$RecipesStateImplCopyWithImpl(
|
||||
_$RecipesStateImpl _value, $Res Function(_$RecipesStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
class __$$RecipesStateImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateImpl> implements _$$RecipesStateImplCopyWith<$Res> {
|
||||
__$$RecipesStateImplCopyWithImpl(_$RecipesStateImpl _value, $Res Function(_$RecipesStateImpl) _then) : super(_value, _then);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -114,8 +107,7 @@ class _$RecipesStateImpl implements _RecipesState {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$RecipesStateImpl);
|
||||
return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -202,18 +194,14 @@ abstract class _RecipesState implements RecipesState {
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RecipesStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$RecipesStateLoadingImplCopyWith(_$RecipesStateLoadingImpl value,
|
||||
$Res Function(_$RecipesStateLoadingImpl) then) =
|
||||
factory _$$RecipesStateLoadingImplCopyWith(_$RecipesStateLoadingImpl value, $Res Function(_$RecipesStateLoadingImpl) then) =
|
||||
__$$RecipesStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RecipesStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadingImpl>
|
||||
class __$$RecipesStateLoadingImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadingImpl>
|
||||
implements _$$RecipesStateLoadingImplCopyWith<$Res> {
|
||||
__$$RecipesStateLoadingImplCopyWithImpl(_$RecipesStateLoadingImpl _value,
|
||||
$Res Function(_$RecipesStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
__$$RecipesStateLoadingImplCopyWithImpl(_$RecipesStateLoadingImpl _value, $Res Function(_$RecipesStateLoadingImpl) _then) : super(_value, _then);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -228,9 +216,7 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$RecipesStateLoadingImpl);
|
||||
return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -317,20 +303,17 @@ abstract class RecipesStateLoading implements RecipesState {
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RecipesStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$RecipesStateLoadedImplCopyWith(_$RecipesStateLoadedImpl value,
|
||||
$Res Function(_$RecipesStateLoadedImpl) then) =
|
||||
factory _$$RecipesStateLoadedImplCopyWith(_$RecipesStateLoadedImpl value, $Res Function(_$RecipesStateLoadedImpl) then) =
|
||||
__$$RecipesStateLoadedImplCopyWithImpl<$Res>;
|
||||
|
||||
@useResult
|
||||
$Res call({List<Recipes> recipesList});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RecipesStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadedImpl>
|
||||
class __$$RecipesStateLoadedImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadedImpl>
|
||||
implements _$$RecipesStateLoadedImplCopyWith<$Res> {
|
||||
__$$RecipesStateLoadedImplCopyWithImpl(_$RecipesStateLoadedImpl _value,
|
||||
$Res Function(_$RecipesStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
__$$RecipesStateLoadedImplCopyWithImpl(_$RecipesStateLoadedImpl _value, $Res Function(_$RecipesStateLoadedImpl) _then) : super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
@@ -349,10 +332,10 @@ class __$$RecipesStateLoadedImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
|
||||
class _$RecipesStateLoadedImpl implements RecipesStateLoaded {
|
||||
const _$RecipesStateLoadedImpl({required final List<Recipes> recipesList})
|
||||
: _recipesList = recipesList;
|
||||
const _$RecipesStateLoadedImpl({required final List<Recipes> recipesList}) : _recipesList = recipesList;
|
||||
|
||||
final List<Recipes> _recipesList;
|
||||
|
||||
@override
|
||||
List<Recipes> get recipesList {
|
||||
if (_recipesList is EqualUnmodifiableListView) return _recipesList;
|
||||
@@ -368,22 +351,17 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded {
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$RecipesStateLoadedImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._recipesList, _recipesList));
|
||||
(other.runtimeType == runtimeType && other is _$RecipesStateLoadedImpl && const DeepCollectionEquality().equals(other._recipesList, _recipesList));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_recipesList));
|
||||
int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_recipesList));
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith =>
|
||||
__$$RecipesStateLoadedImplCopyWithImpl<_$RecipesStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
__$$RecipesStateLoadedImplCopyWithImpl<_$RecipesStateLoadedImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
@@ -461,31 +439,27 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded {
|
||||
}
|
||||
|
||||
abstract class RecipesStateLoaded implements RecipesState {
|
||||
const factory RecipesStateLoaded({required final List<Recipes> recipesList}) =
|
||||
_$RecipesStateLoadedImpl;
|
||||
const factory RecipesStateLoaded({required final List<Recipes> recipesList}) = _$RecipesStateLoadedImpl;
|
||||
|
||||
List<Recipes> get recipesList;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
_$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
_$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RecipesStateErrorImplCopyWith<$Res> {
|
||||
factory _$$RecipesStateErrorImplCopyWith(_$RecipesStateErrorImpl value,
|
||||
$Res Function(_$RecipesStateErrorImpl) then) =
|
||||
factory _$$RecipesStateErrorImplCopyWith(_$RecipesStateErrorImpl value, $Res Function(_$RecipesStateErrorImpl) then) =
|
||||
__$$RecipesStateErrorImplCopyWithImpl<$Res>;
|
||||
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RecipesStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateErrorImpl>
|
||||
class __$$RecipesStateErrorImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateErrorImpl>
|
||||
implements _$$RecipesStateErrorImplCopyWith<$Res> {
|
||||
__$$RecipesStateErrorImplCopyWithImpl(_$RecipesStateErrorImpl _value,
|
||||
$Res Function(_$RecipesStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
__$$RecipesStateErrorImplCopyWithImpl(_$RecipesStateErrorImpl _value, $Res Function(_$RecipesStateErrorImpl) _then) : super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
@@ -519,8 +493,7 @@ class _$RecipesStateErrorImpl implements RecipesStateError {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$RecipesStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -529,9 +502,7 @@ class _$RecipesStateErrorImpl implements RecipesStateError {
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith =>
|
||||
__$$RecipesStateErrorImplCopyWithImpl<_$RecipesStateErrorImpl>(
|
||||
this, _$identity);
|
||||
_$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => __$$RecipesStateErrorImplCopyWithImpl<_$RecipesStateErrorImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
@@ -609,11 +580,10 @@ class _$RecipesStateErrorImpl implements RecipesStateError {
|
||||
}
|
||||
|
||||
abstract class RecipesStateError implements RecipesState {
|
||||
const factory RecipesStateError({required final String errorMessage}) =
|
||||
_$RecipesStateErrorImpl;
|
||||
const factory RecipesStateError({required final String errorMessage}) = _$RecipesStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
_$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
_$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -20,10 +20,11 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
onTap: () => GoRouter.of(context).pushNamed(
|
||||
'blogPostScreen',
|
||||
extra: widget.feedBlogPostModel.id.toString(),
|
||||
),
|
||||
onTap: () =>
|
||||
GoRouter.of(context).pushNamed(
|
||||
'blogPostScreen',
|
||||
extra: widget.feedBlogPostModel.id.toString(),
|
||||
),
|
||||
child: Ink(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart';
|
||||
import 'package:eatvio_app/features/feed/models/recipes_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
class RecipesWidget extends StatefulWidget {
|
||||
final Recipes recipes;
|
||||
@@ -19,7 +20,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
onTap: () {},
|
||||
onTap: () => GoRouter.of(context).pushNamed('aboutRecipesScreen', extra: widget.recipes),
|
||||
child: Ink(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
@@ -30,7 +31,6 @@ class _RecipesWidgetState extends State<RecipesWidget> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(
|
||||
alignment: Alignment.bottomLeft,
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
|
||||
@@ -52,64 +52,78 @@ class _RecipesWidgetState extends State<RecipesWidget> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
Positioned(
|
||||
left: 8,
|
||||
bottom: 8,
|
||||
child: Wrap(
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white54,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.visibility_rounded,
|
||||
size: 20,
|
||||
color: Colors.black,
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(
|
||||
'0',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
_iconButton(Icons.fastfood, '139.9 ккал'),
|
||||
SizedBox(width: 8),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white54,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.favorite_border_rounded,
|
||||
size: 20,
|
||||
color: Colors.black,
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(
|
||||
'0',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
_iconButton(Icons.timer_rounded, widget.recipes.cookingTime.toString() + ' минут'),
|
||||
SizedBox(width: 8),
|
||||
_iconButton(Icons.fast_forward_rounded, widget.recipes.steps.length.toString() + ' этапов'),
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 8,
|
||||
top: 8,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.8),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.favorite_rounded,
|
||||
size: 16,
|
||||
color: Colors.black,
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(
|
||||
'0',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 8,
|
||||
top: 8,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.8),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.visibility_rounded,
|
||||
size: 16,
|
||||
color: Colors.black,
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(
|
||||
'0',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
@@ -134,20 +148,6 @@ class _RecipesWidgetState extends State<RecipesWidget> {
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: Wrap(
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
_iconButton(Icons.fastfood, '139.9 ккал'),
|
||||
SizedBox(width: 8),
|
||||
_iconButton(Icons.timer_rounded, widget.recipes.cookingTime.toString() + ' минут'),
|
||||
SizedBox(width: 8),
|
||||
_iconButton(Icons.fast_forward_rounded, widget.recipes.steps.length.toString() + ' этапов'),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -155,10 +155,10 @@ class _RecipesWidgetState extends State<RecipesWidget> {
|
||||
}
|
||||
|
||||
_iconButton(IconData icon, [String? text]) {
|
||||
return Ink(
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.gray100,
|
||||
color: Colors.white.withOpacity(0.8),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
height: 32,
|
||||
@@ -167,16 +167,16 @@ class _RecipesWidgetState extends State<RecipesWidget> {
|
||||
children: [
|
||||
Icon(
|
||||
icon,
|
||||
size: 20,
|
||||
color: appTheme.gray600,
|
||||
size: 16,
|
||||
color: Colors.black,
|
||||
),
|
||||
if (text != null) SizedBox(width: 8),
|
||||
if (text != null)
|
||||
Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: appTheme.gray600,
|
||||
fontSize: 12,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -24,23 +24,22 @@ class _FeedService implements FeedService {
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(
|
||||
_setStreamType<FeedBlogPostSettingsModel>(Options(
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_setStreamType<FeedBlogPostSettingsModel>(Options(
|
||||
method: 'GET',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/blogPosts/index',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(
|
||||
baseUrl: _combineBaseUrls(
|
||||
_dio.options.baseUrl,
|
||||
baseUrl,
|
||||
))));
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/blogPosts/index',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(
|
||||
baseUrl: _combineBaseUrls(
|
||||
_dio.options.baseUrl,
|
||||
baseUrl,
|
||||
))));
|
||||
final _value = FeedBlogPostSettingsModel.fromJson(_result.data!);
|
||||
return _value;
|
||||
}
|
||||
@@ -51,31 +50,28 @@ class _FeedService implements FeedService {
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _result = await _dio
|
||||
.fetch<Map<String, dynamic>>(_setStreamType<RecipesPagination>(Options(
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_setStreamType<RecipesPagination>(Options(
|
||||
method: 'GET',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/index',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(
|
||||
baseUrl: _combineBaseUrls(
|
||||
_dio.options.baseUrl,
|
||||
baseUrl,
|
||||
))));
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/index',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(
|
||||
baseUrl: _combineBaseUrls(
|
||||
_dio.options.baseUrl,
|
||||
baseUrl,
|
||||
))));
|
||||
final _value = RecipesPagination.fromJson(_result.data!);
|
||||
return _value;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user