feat(feed): add diets api and create blog post screen, fix status bar

This commit is contained in:
mso7nueh
2024-08-08 10:39:53 +03:00
parent 21e03d956c
commit f4c6aebdff
67 changed files with 4253 additions and 1617 deletions

View File

@@ -0,0 +1,133 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'diets_pagination_model.freezed.dart';
part 'diets_pagination_model.g.dart';
@freezed
class DietsPagination with _$DietsPagination {
const factory DietsPagination({
@JsonKey(name: "data") required List<Datum> data,
@JsonKey(name: "links") required Links links,
@JsonKey(name: "meta") required Meta meta,
}) = _DietsPagination;
factory DietsPagination.fromJson(Map<String, dynamic> json) => _$DietsPaginationFromJson(json);
}
@freezed
class Datum with _$Datum {
const factory Datum({
@JsonKey(name: "id") required int id,
@JsonKey(name: "name") required String name,
@JsonKey(name: "image") required String image,
@JsonKey(name: "duration") required int duration,
@JsonKey(name: "state") required String state,
@JsonKey(name: "type") required Type type,
@JsonKey(name: "details") required String details,
@JsonKey(name: "daily_schedule") required List<List<List<DailySchedule>>> dailySchedule,
@JsonKey(name: "author") required Author author,
@JsonKey(name: "total_likes") required int totalLikes,
@JsonKey(name: "total_views") required int totalViews,
@JsonKey(name: "total_comments") required int totalComments,
}) = _Datum;
factory Datum.fromJson(Map<String, dynamic> json) => _$DatumFromJson(json);
}
@freezed
class Author with _$Author {
const factory Author({
@JsonKey(name: "author_slug") required String authorSlug,
@JsonKey(name: "author_name") required String authorName,
@JsonKey(name: "author_profile_icon") required String authorProfileIcon,
@JsonKey(name: "author_is_me") required bool authorIsMe,
}) = _Author;
factory Author.fromJson(Map<String, dynamic> json) => _$AuthorFromJson(json);
}
@freezed
class DailySchedule with _$DailySchedule {
const factory DailySchedule({
@JsonKey(name: "name") required String name,
@JsonKey(name: "uniq") required String uniq,
@JsonKey(name: "portion") required Portion portion,
@JsonKey(name: "quantity") required int quantity,
}) = _DailySchedule;
factory DailySchedule.fromJson(Map<String, dynamic> json) => _$DailyScheduleFromJson(json);
}
enum Portion {
@JsonValue("grams")
GRAMS,
@JsonValue("milliliters")
MILLILITERS,
@JsonValue("pcs")
PCS
}
final portionValues = EnumValues({"grams": Portion.GRAMS, "milliliters": Portion.MILLILITERS, "pcs": Portion.PCS});
@freezed
class Type with _$Type {
const factory Type({
@JsonKey(name: "alko") bool? alko,
@JsonKey(name: "veg") bool? veg,
@JsonKey(name: "corb") bool? corb,
@JsonKey(name: "meat") bool? meat,
}) = _Type;
factory Type.fromJson(Map<String, dynamic> json) => _$TypeFromJson(json);
}
@freezed
class Links with _$Links {
const factory Links({
@JsonKey(name: "first") required String first,
@JsonKey(name: "last") required String last,
@JsonKey(name: "prev") required dynamic prev,
@JsonKey(name: "next") required dynamic next,
}) = _Links;
factory Links.fromJson(Map<String, dynamic> json) => _$LinksFromJson(json);
}
@freezed
class Meta with _$Meta {
const factory Meta({
@JsonKey(name: "current_page") required int currentPage,
@JsonKey(name: "from") required int from,
@JsonKey(name: "last_page") required int lastPage,
@JsonKey(name: "links") required List<Link> links,
@JsonKey(name: "path") required String path,
@JsonKey(name: "per_page") required int perPage,
@JsonKey(name: "to") required int to,
@JsonKey(name: "total") required int total,
}) = _Meta;
factory Meta.fromJson(Map<String, dynamic> json) => _$MetaFromJson(json);
}
@freezed
class Link with _$Link {
const factory Link({
@JsonKey(name: "url") required String? url,
@JsonKey(name: "label") required String label,
@JsonKey(name: "active") required bool active,
}) = _Link;
factory Link.fromJson(Map<String, dynamic> json) => _$LinkFromJson(json);
}
class EnumValues<T> {
Map<String, T> map;
late Map<T, String> reverseMap;
EnumValues(this.map);
Map<T, String> get reverse {
reverseMap = map.map((k, v) => MapEntry(v, k));
return reverseMap;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,167 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'diets_pagination_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$DietsPaginationImpl _$$DietsPaginationImplFromJson(
Map<String, dynamic> json) =>
_$DietsPaginationImpl(
data: (json['data'] as List<dynamic>)
.map((e) => Datum.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> _$$DietsPaginationImplToJson(
_$DietsPaginationImpl instance) =>
<String, dynamic>{
'data': instance.data,
'links': instance.links,
'meta': instance.meta,
};
_$DatumImpl _$$DatumImplFromJson(Map<String, dynamic> json) => _$DatumImpl(
id: (json['id'] as num).toInt(),
name: json['name'] as String,
image: json['image'] as String,
duration: (json['duration'] as num).toInt(),
state: json['state'] as String,
type: Type.fromJson(json['type'] as Map<String, dynamic>),
details: json['details'] as String,
dailySchedule: (json['daily_schedule'] as List<dynamic>)
.map((e) => (e as List<dynamic>)
.map((e) => (e as List<dynamic>)
.map((e) => DailySchedule.fromJson(e as Map<String, dynamic>))
.toList())
.toList())
.toList(),
author: Author.fromJson(json['author'] as Map<String, dynamic>),
totalLikes: (json['total_likes'] as num).toInt(),
totalViews: (json['total_views'] as num).toInt(),
totalComments: (json['total_comments'] as num).toInt(),
);
Map<String, dynamic> _$$DatumImplToJson(_$DatumImpl instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
'image': instance.image,
'duration': instance.duration,
'state': instance.state,
'type': instance.type,
'details': instance.details,
'daily_schedule': instance.dailySchedule,
'author': instance.author,
'total_likes': instance.totalLikes,
'total_views': instance.totalViews,
'total_comments': instance.totalComments,
};
_$AuthorImpl _$$AuthorImplFromJson(Map<String, dynamic> json) => _$AuthorImpl(
authorSlug: json['author_slug'] as String,
authorName: json['author_name'] as String,
authorProfileIcon: json['author_profile_icon'] as String,
authorIsMe: json['author_is_me'] as bool,
);
Map<String, dynamic> _$$AuthorImplToJson(_$AuthorImpl instance) =>
<String, dynamic>{
'author_slug': instance.authorSlug,
'author_name': instance.authorName,
'author_profile_icon': instance.authorProfileIcon,
'author_is_me': instance.authorIsMe,
};
_$DailyScheduleImpl _$$DailyScheduleImplFromJson(Map<String, dynamic> json) =>
_$DailyScheduleImpl(
name: json['name'] as String,
uniq: json['uniq'] as String,
portion: $enumDecode(_$PortionEnumMap, json['portion']),
quantity: (json['quantity'] as num).toInt(),
);
Map<String, dynamic> _$$DailyScheduleImplToJson(_$DailyScheduleImpl instance) =>
<String, dynamic>{
'name': instance.name,
'uniq': instance.uniq,
'portion': _$PortionEnumMap[instance.portion]!,
'quantity': instance.quantity,
};
const _$PortionEnumMap = {
Portion.GRAMS: 'grams',
Portion.MILLILITERS: 'milliliters',
Portion.PCS: 'pcs',
};
_$TypeImpl _$$TypeImplFromJson(Map<String, dynamic> json) => _$TypeImpl(
alko: json['alko'] as bool?,
veg: json['veg'] as bool?,
corb: json['corb'] as bool?,
meat: json['meat'] as bool?,
);
Map<String, dynamic> _$$TypeImplToJson(_$TypeImpl instance) =>
<String, dynamic>{
'alko': instance.alko,
'veg': instance.veg,
'corb': instance.corb,
'meat': instance.meat,
};
_$LinksImpl _$$LinksImplFromJson(Map<String, dynamic> json) => _$LinksImpl(
first: json['first'] as String,
last: json['last'] as String,
prev: json['prev'],
next: json['next'],
);
Map<String, dynamic> _$$LinksImplToJson(_$LinksImpl instance) =>
<String, dynamic>{
'first': instance.first,
'last': instance.last,
'prev': instance.prev,
'next': instance.next,
};
_$MetaImpl _$$MetaImplFromJson(Map<String, dynamic> json) => _$MetaImpl(
currentPage: (json['current_page'] as num).toInt(),
from: (json['from'] as num).toInt(),
lastPage: (json['last_page'] as num).toInt(),
links: (json['links'] as List<dynamic>)
.map((e) => Link.fromJson(e as Map<String, dynamic>))
.toList(),
path: json['path'] as String,
perPage: (json['per_page'] as num).toInt(),
to: (json['to'] as num).toInt(),
total: (json['total'] as num).toInt(),
);
Map<String, dynamic> _$$MetaImplToJson(_$MetaImpl instance) =>
<String, dynamic>{
'current_page': instance.currentPage,
'from': instance.from,
'last_page': instance.lastPage,
'links': instance.links,
'path': instance.path,
'per_page': instance.perPage,
'to': instance.to,
'total': instance.total,
};
_$LinkImpl _$$LinkImplFromJson(Map<String, dynamic> json) => _$LinkImpl(
url: json['url'] as String?,
label: json['label'] as String,
active: json['active'] as bool,
);
Map<String, dynamic> _$$LinkImplToJson(_$LinkImpl instance) =>
<String, dynamic>{
'url': instance.url,
'label': instance.label,
'active': instance.active,
};

View File

@@ -21,34 +21,28 @@ 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,
@@ -62,12 +56,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;
@@ -121,10 +115,11 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> impl
}
/// @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(
@@ -139,9 +134,12 @@ abstract class _$$FeedBlogPostModelImplCopyWith<$Res> implements $FeedBlogPostMo
}
/// @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
@@ -205,7 +203,8 @@ 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;
@@ -240,21 +239,28 @@ 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() {
@@ -275,36 +281,30 @@ 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;
}

View File

@@ -6,7 +6,9 @@ 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,
@@ -17,7 +19,9 @@ _$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson(Map<String, dynamic> js
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,

View File

@@ -14,37 +14,40 @@ 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;
@@ -63,19 +66,25 @@ class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, $Val extends FeedBlogPostSet
}
/// @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')
@@ -95,17 +104,20 @@ class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> extends _$FeedBlogPost
/// @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);
}
@@ -120,18 +132,21 @@ 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() {
@@ -142,15 +157,19 @@ 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;
}

View File

@@ -6,14 +6,16 @@ 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,
};

View File

@@ -9,17 +9,19 @@ class Recipes with _$Recipes {
required int id,
required String image,
required String state,
@JsonKey(name: "cooking_time") required int cookingTime,
@JsonKey(name: 'cooking_time') required int cookingTime,
required List<Ingredient> ingredients,
required String description,
required List<Step> steps,
@JsonKey(name: "video_url") required String videoUrl,
@JsonKey(name: "created_at") required DateTime createdAt,
@JsonKey(name: "updated_at") required DateTime updatedAt,
@JsonKey(name: 'video_url') required String videoUrl,
@JsonKey(name: 'created_at') required DateTime createdAt,
@JsonKey(name: 'updated_at') required DateTime updatedAt,
required String title,
required String type,
required String slug,
@JsonKey(name: "comments_count") required int commentsCount,
@JsonKey(name: 'total_comments') required int commentsCount,
@JsonKey(name: 'total_likes') required int likesCount,
@JsonKey(name: 'total_views') required int viewsCount,
}) = _Recipes;
factory Recipes.fromJson(Map<String, Object?> json) => _$RecipesFromJson(json);

View File

@@ -21,73 +21,65 @@ 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")
@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")
@JsonKey(name: 'video_url')
String get videoUrl => throw _privateConstructorUsedError;
@JsonKey(name: "created_at")
@JsonKey(name: 'created_at')
DateTime get createdAt => throw _privateConstructorUsedError;
@JsonKey(name: "updated_at")
@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")
@JsonKey(name: 'total_comments')
int get commentsCount => throw _privateConstructorUsedError;
@JsonKey(name: 'total_likes')
int get likesCount => throw _privateConstructorUsedError;
@JsonKey(name: 'total_views')
int get viewsCount => 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,
String image,
String state,
@JsonKey(name: "cooking_time") int cookingTime,
@JsonKey(name: 'cooking_time') int cookingTime,
List<Ingredient> ingredients,
String description,
List<Step> steps,
@JsonKey(name: "video_url") String videoUrl,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt,
@JsonKey(name: 'video_url') String videoUrl,
@JsonKey(name: 'created_at') DateTime createdAt,
@JsonKey(name: 'updated_at') DateTime updatedAt,
String title,
String type,
String slug,
@JsonKey(name: "comments_count") int commentsCount});
@JsonKey(name: 'total_comments') int commentsCount,
@JsonKey(name: 'total_likes') int likesCount,
@JsonKey(name: 'total_views') int viewsCount});
}
/// @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;
@@ -108,6 +100,8 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> implements $RecipesCopyW
Object? type = null,
Object? slug = null,
Object? commentsCount = null,
Object? likesCount = null,
Object? viewsCount = null,
}) {
return _then(_value.copyWith(
id: null == id
@@ -166,36 +160,51 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> implements $RecipesCopyW
? _value.commentsCount
: commentsCount // ignore: cast_nullable_to_non_nullable
as int,
likesCount: null == likesCount
? _value.likesCount
: likesCount // ignore: cast_nullable_to_non_nullable
as int,
viewsCount: null == viewsCount
? _value.viewsCount
: viewsCount // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
}
/// @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(
{int id,
String image,
String state,
@JsonKey(name: "cooking_time") int cookingTime,
@JsonKey(name: 'cooking_time') int cookingTime,
List<Ingredient> ingredients,
String description,
List<Step> steps,
@JsonKey(name: "video_url") String videoUrl,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt,
@JsonKey(name: 'video_url') String videoUrl,
@JsonKey(name: 'created_at') DateTime createdAt,
@JsonKey(name: 'updated_at') DateTime updatedAt,
String title,
String type,
String slug,
@JsonKey(name: "comments_count") int commentsCount});
@JsonKey(name: 'total_comments') int commentsCount,
@JsonKey(name: 'total_likes') int likesCount,
@JsonKey(name: 'total_views') int viewsCount});
}
/// @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
@@ -214,6 +223,8 @@ class __$$RecipesImplCopyWithImpl<$Res> extends _$RecipesCopyWithImpl<$Res, _$Re
Object? type = null,
Object? slug = null,
Object? commentsCount = null,
Object? likesCount = null,
Object? viewsCount = null,
}) {
return _then(_$RecipesImpl(
id: null == id
@@ -272,6 +283,14 @@ class __$$RecipesImplCopyWithImpl<$Res> extends _$RecipesCopyWithImpl<$Res, _$Re
? _value.commentsCount
: commentsCount // ignore: cast_nullable_to_non_nullable
as int,
likesCount: null == likesCount
? _value.likesCount
: likesCount // ignore: cast_nullable_to_non_nullable
as int,
viewsCount: null == viewsCount
? _value.viewsCount
: viewsCount // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
@@ -283,21 +302,24 @@ class _$RecipesImpl implements _Recipes {
{required this.id,
required this.image,
required this.state,
@JsonKey(name: "cooking_time") required this.cookingTime,
@JsonKey(name: 'cooking_time') required this.cookingTime,
required final List<Ingredient> ingredients,
required this.description,
required final List<Step> steps,
@JsonKey(name: "video_url") required this.videoUrl,
@JsonKey(name: "created_at") required this.createdAt,
@JsonKey(name: "updated_at") required this.updatedAt,
@JsonKey(name: 'video_url') required this.videoUrl,
@JsonKey(name: 'created_at') required this.createdAt,
@JsonKey(name: 'updated_at') required this.updatedAt,
required this.title,
required this.type,
required this.slug,
@JsonKey(name: "comments_count") required this.commentsCount})
@JsonKey(name: 'total_comments') required this.commentsCount,
@JsonKey(name: 'total_likes') required this.likesCount,
@JsonKey(name: 'total_views') required this.viewsCount})
: _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;
@@ -306,10 +328,9 @@ class _$RecipesImpl implements _Recipes {
@override
final String state;
@override
@JsonKey(name: "cooking_time")
@JsonKey(name: 'cooking_time')
final int cookingTime;
final List<Ingredient> _ingredients;
@override
List<Ingredient> get ingredients {
if (_ingredients is EqualUnmodifiableListView) return _ingredients;
@@ -320,7 +341,6 @@ class _$RecipesImpl implements _Recipes {
@override
final String description;
final List<Step> _steps;
@override
List<Step> get steps {
if (_steps is EqualUnmodifiableListView) return _steps;
@@ -329,13 +349,13 @@ class _$RecipesImpl implements _Recipes {
}
@override
@JsonKey(name: "video_url")
@JsonKey(name: 'video_url')
final String videoUrl;
@override
@JsonKey(name: "created_at")
@JsonKey(name: 'created_at')
final DateTime createdAt;
@override
@JsonKey(name: "updated_at")
@JsonKey(name: 'updated_at')
final DateTime updatedAt;
@override
final String title;
@@ -344,12 +364,18 @@ class _$RecipesImpl implements _Recipes {
@override
final String slug;
@override
@JsonKey(name: "comments_count")
@JsonKey(name: 'total_comments')
final int commentsCount;
@override
@JsonKey(name: 'total_likes')
final int likesCount;
@override
@JsonKey(name: 'total_views')
final int viewsCount;
@override
String toString() {
return 'Recipes(id: $id, image: $image, state: $state, cookingTime: $cookingTime, ingredients: $ingredients, description: $description, steps: $steps, videoUrl: $videoUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, type: $type, slug: $slug, commentsCount: $commentsCount)';
return 'Recipes(id: $id, image: $image, state: $state, cookingTime: $cookingTime, ingredients: $ingredients, description: $description, steps: $steps, videoUrl: $videoUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, type: $type, slug: $slug, commentsCount: $commentsCount, likesCount: $likesCount, viewsCount: $viewsCount)';
}
@override
@@ -360,28 +386,56 @@ 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) &&
(identical(other.likesCount, likesCount) ||
other.likesCount == likesCount) &&
(identical(other.viewsCount, viewsCount) ||
other.viewsCount == viewsCount));
}
@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,
likesCount,
viewsCount);
@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() {
@@ -393,73 +447,69 @@ 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: 'total_comments') required final int commentsCount,
@JsonKey(name: 'total_likes') required final int likesCount,
@JsonKey(name: 'total_views') required final int viewsCount}) =
_$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")
@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")
@JsonKey(name: 'video_url')
String get videoUrl;
@override
@JsonKey(name: "created_at")
@JsonKey(name: 'created_at')
DateTime get createdAt;
@override
@JsonKey(name: "updated_at")
@JsonKey(name: 'updated_at')
DateTime get updatedAt;
@override
String get title;
@override
String get type;
@override
String get slug;
@override
@JsonKey(name: "comments_count")
@JsonKey(name: 'total_comments')
int get commentsCount;
@override
@JsonKey(name: 'total_likes')
int get likesCount;
@override
@JsonKey(name: 'total_views')
int get viewsCount;
@override
@JsonKey(ignore: true)
_$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => throw _privateConstructorUsedError;
_$$RecipesImplCopyWith<_$RecipesImpl> get copyWith =>
throw _privateConstructorUsedError;
}
Ingredient _$IngredientFromJson(Map<String, dynamic> json) {
@@ -469,32 +519,31 @@ 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;
@@ -523,17 +572,23 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> implements $Ingred
}
/// @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
@@ -562,9 +617,11 @@ class __$$IngredientImplCopyWithImpl<$Res> extends _$IngredientCopyWithImpl<$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;
@@ -595,7 +652,8 @@ 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() {
@@ -606,22 +664,24 @@ 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) {
@@ -631,30 +691,28 @@ 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;
@@ -679,16 +737,20 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> implements $StepCopyWith<$Res>
/// @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
@@ -714,7 +776,8 @@ class __$$StepImplCopyWithImpl<$Res> extends _$StepCopyWithImpl<$Res, _$StepImpl
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;
@@ -732,7 +795,8 @@ 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)
@@ -742,7 +806,8 @@ 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() {
@@ -753,17 +818,18 @@ 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;
}

View File

@@ -6,24 +6,32 @@ 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),
title: json['title'] as String,
type: json['type'] as String,
slug: json['slug'] as String,
commentsCount: (json['comments_count'] as num).toInt(),
commentsCount: (json['total_comments'] as num).toInt(),
likesCount: (json['total_likes'] as num).toInt(),
viewsCount: (json['total_views'] 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,
@@ -37,16 +45,20 @@ Map<String, dynamic> _$$RecipesImplToJson(_$RecipesImpl instance) => <String, dy
'title': instance.title,
'type': instance.type,
'slug': instance.slug,
'comments_count': instance.commentsCount,
'total_comments': instance.commentsCount,
'total_likes': instance.likesCount,
'total_views': instance.viewsCount,
};
_$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,
@@ -57,7 +69,8 @@ _$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,
};

View File

@@ -8,17 +8,17 @@ part 'recipes_pagination_model.g.dart';
class RecipesPagination with _$RecipesPagination {
const factory RecipesPagination({
@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,
@JsonKey(name: "last_page") required int lastPage,
@JsonKey(name: "last_page_url") required String lastPageUrl,
@JsonKey(name: "next_page_url") required String nextPageUrl,
required String path,
@JsonKey(name: "per_page") required int perPage,
@JsonKey(name: "prev_page_url") required dynamic prevPageUrl,
required int to,
required int total,
// @JsonKey(name: "current_page") required int currentPage,
// @JsonKey(name: "first_page_url") required String firstPageUrl,
// required int from,
// @JsonKey(name: "last_page") required int lastPage,
// @JsonKey(name: "last_page_url") required String lastPageUrl,
// @JsonKey(name: "next_page_url") required String nextPageUrl,
// required String path,
// @JsonKey(name: "per_page") required int perPage,
// @JsonKey(name: "prev_page_url") required dynamic prevPageUrl,
// required int to,
// required int total,
}) = _RecipesPagination;
factory RecipesPagination.fromJson(Map<String, Object?> json) => _$RecipesPaginationFromJson(json);

View File

@@ -23,68 +23,28 @@ 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,
@JsonKey(name: "current_page") int currentPage,
@JsonKey(name: "first_page_url") String firstPageUrl,
int from,
@JsonKey(name: "last_page") int lastPage,
@JsonKey(name: "last_page_url") String lastPageUrl,
@JsonKey(name: "next_page_url") String nextPageUrl,
String path,
@JsonKey(name: "per_page") int perPage,
@JsonKey(name: "prev_page_url") dynamic prevPageUrl,
int to,
int total});
$Res call({@JsonKey(name: 'data') List<Recipes> recipesList});
}
/// @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;
@@ -92,163 +52,45 @@ class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> impl
@override
$Res call({
Object? recipesList = null,
Object? currentPage = null,
Object? firstPageUrl = null,
Object? from = null,
Object? lastPage = null,
Object? lastPageUrl = null,
Object? nextPageUrl = null,
Object? path = null,
Object? perPage = null,
Object? prevPageUrl = freezed,
Object? to = null,
Object? total = null,
}) {
return _then(_value.copyWith(
recipesList: null == recipesList
? _value.recipesList
: recipesList // ignore: cast_nullable_to_non_nullable
as List<Recipes>,
currentPage: null == currentPage
? _value.currentPage
: currentPage // ignore: cast_nullable_to_non_nullable
as int,
firstPageUrl: null == firstPageUrl
? _value.firstPageUrl
: firstPageUrl // ignore: cast_nullable_to_non_nullable
as String,
from: null == from
? _value.from
: from // ignore: cast_nullable_to_non_nullable
as int,
lastPage: null == lastPage
? _value.lastPage
: lastPage // ignore: cast_nullable_to_non_nullable
as int,
lastPageUrl: null == lastPageUrl
? _value.lastPageUrl
: lastPageUrl // ignore: cast_nullable_to_non_nullable
as String,
nextPageUrl: null == nextPageUrl
? _value.nextPageUrl
: nextPageUrl // ignore: cast_nullable_to_non_nullable
as String,
path: null == path
? _value.path
: path // ignore: cast_nullable_to_non_nullable
as String,
perPage: null == perPage
? _value.perPage
: perPage // ignore: cast_nullable_to_non_nullable
as int,
prevPageUrl: freezed == prevPageUrl
? _value.prevPageUrl
: prevPageUrl // ignore: cast_nullable_to_non_nullable
as dynamic,
to: null == to
? _value.to
: to // ignore: cast_nullable_to_non_nullable
as int,
total: null == total
? _value.total
: total // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
}
/// @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(
{@JsonKey(name: 'data') List<Recipes> recipesList,
@JsonKey(name: "current_page") int currentPage,
@JsonKey(name: "first_page_url") String firstPageUrl,
int from,
@JsonKey(name: "last_page") int lastPage,
@JsonKey(name: "last_page_url") String lastPageUrl,
@JsonKey(name: "next_page_url") String nextPageUrl,
String path,
@JsonKey(name: "per_page") int perPage,
@JsonKey(name: "prev_page_url") dynamic prevPageUrl,
int to,
int total});
$Res call({@JsonKey(name: 'data') List<Recipes> recipesList});
}
/// @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
$Res call({
Object? recipesList = null,
Object? currentPage = null,
Object? firstPageUrl = null,
Object? from = null,
Object? lastPage = null,
Object? lastPageUrl = null,
Object? nextPageUrl = null,
Object? path = null,
Object? perPage = null,
Object? prevPageUrl = freezed,
Object? to = null,
Object? total = null,
}) {
return _then(_$RecipesPaginationImpl(
recipesList: null == recipesList
? _value._recipesList
: recipesList // ignore: cast_nullable_to_non_nullable
as List<Recipes>,
currentPage: null == currentPage
? _value.currentPage
: currentPage // ignore: cast_nullable_to_non_nullable
as int,
firstPageUrl: null == firstPageUrl
? _value.firstPageUrl
: firstPageUrl // ignore: cast_nullable_to_non_nullable
as String,
from: null == from
? _value.from
: from // ignore: cast_nullable_to_non_nullable
as int,
lastPage: null == lastPage
? _value.lastPage
: lastPage // ignore: cast_nullable_to_non_nullable
as int,
lastPageUrl: null == lastPageUrl
? _value.lastPageUrl
: lastPageUrl // ignore: cast_nullable_to_non_nullable
as String,
nextPageUrl: null == nextPageUrl
? _value.nextPageUrl
: nextPageUrl // ignore: cast_nullable_to_non_nullable
as String,
path: null == path
? _value.path
: path // ignore: cast_nullable_to_non_nullable
as String,
perPage: null == perPage
? _value.perPage
: perPage // ignore: cast_nullable_to_non_nullable
as int,
prevPageUrl: freezed == prevPageUrl
? _value.prevPageUrl
: prevPageUrl // ignore: cast_nullable_to_non_nullable
as dynamic,
to: null == to
? _value.to
: to // ignore: cast_nullable_to_non_nullable
as int,
total: null == total
? _value.total
: total // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
@@ -257,24 +99,13 @@ class __$$RecipesPaginationImplCopyWithImpl<$Res> extends _$RecipesPaginationCop
@JsonSerializable()
class _$RecipesPaginationImpl implements _RecipesPagination {
const _$RecipesPaginationImpl(
{@JsonKey(name: 'data') required final List<Recipes> recipesList,
@JsonKey(name: "current_page") required this.currentPage,
@JsonKey(name: "first_page_url") required this.firstPageUrl,
required this.from,
@JsonKey(name: "last_page") required this.lastPage,
@JsonKey(name: "last_page_url") required this.lastPageUrl,
@JsonKey(name: "next_page_url") required this.nextPageUrl,
required this.path,
@JsonKey(name: "per_page") required this.perPage,
@JsonKey(name: "prev_page_url") required this.prevPageUrl,
required this.to,
required this.total})
{@JsonKey(name: 'data') required final List<Recipes> recipesList})
: _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 {
@@ -283,39 +114,9 @@ class _$RecipesPaginationImpl implements _RecipesPagination {
return EqualUnmodifiableListView(_recipesList);
}
@override
@JsonKey(name: "current_page")
final int currentPage;
@override
@JsonKey(name: "first_page_url")
final String firstPageUrl;
@override
final int from;
@override
@JsonKey(name: "last_page")
final int lastPage;
@override
@JsonKey(name: "last_page_url")
final String lastPageUrl;
@override
@JsonKey(name: "next_page_url")
final String nextPageUrl;
@override
final String path;
@override
@JsonKey(name: "per_page")
final int perPage;
@override
@JsonKey(name: "prev_page_url")
final dynamic prevPageUrl;
@override
final int to;
@override
final int total;
@override
String toString() {
return 'RecipesPagination(recipesList: $recipesList, currentPage: $currentPage, firstPageUrl: $firstPageUrl, from: $from, lastPage: $lastPage, lastPageUrl: $lastPageUrl, nextPageUrl: $nextPageUrl, path: $path, perPage: $perPage, prevPageUrl: $prevPageUrl, to: $to, total: $total)';
return 'RecipesPagination(recipesList: $recipesList)';
}
@override
@@ -323,29 +124,21 @@ 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) &&
(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.path, path) || other.path == path) &&
(identical(other.perPage, perPage) || other.perPage == perPage) &&
const DeepCollectionEquality().equals(other.prevPageUrl, prevPageUrl) &&
(identical(other.to, to) || other.to == to) &&
(identical(other.total, total) || other.total == total));
const DeepCollectionEquality()
.equals(other._recipesList, _recipesList));
}
@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));
@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() {
@@ -357,66 +150,17 @@ class _$RecipesPaginationImpl implements _RecipesPagination {
abstract class _RecipesPagination implements RecipesPagination {
const factory _RecipesPagination(
{@JsonKey(name: 'data') required final List<Recipes> recipesList,
@JsonKey(name: "current_page") required final int currentPage,
@JsonKey(name: "first_page_url") required final String firstPageUrl,
required final int from,
@JsonKey(name: "last_page") required final int lastPage,
@JsonKey(name: "last_page_url") required final String lastPageUrl,
@JsonKey(name: "next_page_url") required final String nextPageUrl,
required final String path,
@JsonKey(name: "per_page") required final int perPage,
@JsonKey(name: "prev_page_url") required final dynamic prevPageUrl,
required final int to,
required final int total}) = _$RecipesPaginationImpl;
{@JsonKey(name: 'data') required final List<Recipes> recipesList}) =
_$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;
}

View File

@@ -6,32 +6,16 @@ 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(),
currentPage: (json['current_page'] as num).toInt(),
firstPageUrl: json['first_page_url'] as String,
from: (json['from'] as num).toInt(),
lastPage: (json['last_page'] as num).toInt(),
lastPageUrl: json['last_page_url'] as String,
nextPageUrl: json['next_page_url'] as String,
path: json['path'] as String,
perPage: (json['per_page'] as num).toInt(),
prevPageUrl: json['prev_page_url'],
to: (json['to'] as num).toInt(),
total: (json['total'] as num).toInt(),
_$RecipesPaginationImpl _$$RecipesPaginationImplFromJson(
Map<String, dynamic> json) =>
_$RecipesPaginationImpl(
recipesList: (json['data'] as List<dynamic>)
.map((e) => Recipes.fromJson(e as Map<String, dynamic>))
.toList(),
);
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,
'from': instance.from,
'last_page': instance.lastPage,
'last_page_url': instance.lastPageUrl,
'next_page_url': instance.nextPageUrl,
'path': instance.path,
'per_page': instance.perPage,
'prev_page_url': instance.prevPageUrl,
'to': instance.to,
'total': instance.total,
};