forked from eatvio/eatvio_app
feat: consultants rating
This commit is contained in:
30
lib/features/feed/models/feed_consultant_model.dart
Normal file
30
lib/features/feed/models/feed_consultant_model.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:eatvio_app/core/models/pagination_model.dart';
|
||||
import 'package:eatvio_app/features/profile/models/badge_model.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'feed_consultant_model.freezed.dart';
|
||||
part 'feed_consultant_model.g.dart';
|
||||
|
||||
@freezed
|
||||
class FeedConsultantPaginationModel with _$FeedConsultantPaginationModel {
|
||||
const factory FeedConsultantPaginationModel({
|
||||
required List<FeedConsultantModel> data,
|
||||
required Links links,
|
||||
required Meta meta,
|
||||
}) = _FeedConsultantPaginationModel;
|
||||
|
||||
factory FeedConsultantPaginationModel.fromJson(Map<String, Object?> json) => _$FeedConsultantPaginationModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class FeedConsultantModel with _$FeedConsultantModel {
|
||||
const factory FeedConsultantModel({
|
||||
required String slug,
|
||||
required String name,
|
||||
@JsonKey(name: 'rating_place') required int ratingPlace,
|
||||
@JsonKey(name: 'profile_photo_url') required String photo,
|
||||
required List<BadgeModel> badges,
|
||||
}) = _FeedConsultantModel;
|
||||
|
||||
factory FeedConsultantModel.fromJson(Map<String, Object?> json) => _$FeedConsultantModelFromJson(json);
|
||||
}
|
||||
499
lib/features/feed/models/feed_consultant_model.freezed.dart
Normal file
499
lib/features/feed/models/feed_consultant_model.freezed.dart
Normal file
@@ -0,0 +1,499 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'feed_consultant_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
FeedConsultantPaginationModel _$FeedConsultantPaginationModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _FeedConsultantPaginationModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$FeedConsultantPaginationModel {
|
||||
List<FeedConsultantModel> get data => throw _privateConstructorUsedError;
|
||||
Links get links => throw _privateConstructorUsedError;
|
||||
Meta get meta => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this FeedConsultantPaginationModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$FeedConsultantPaginationModelCopyWith<FeedConsultantPaginationModel>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $FeedConsultantPaginationModelCopyWith<$Res> {
|
||||
factory $FeedConsultantPaginationModelCopyWith(
|
||||
FeedConsultantPaginationModel value,
|
||||
$Res Function(FeedConsultantPaginationModel) then) =
|
||||
_$FeedConsultantPaginationModelCopyWithImpl<$Res,
|
||||
FeedConsultantPaginationModel>;
|
||||
@useResult
|
||||
$Res call({List<FeedConsultantModel> data, Links links, Meta meta});
|
||||
|
||||
$LinksCopyWith<$Res> get links;
|
||||
$MetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$FeedConsultantPaginationModelCopyWithImpl<$Res,
|
||||
$Val extends FeedConsultantPaginationModel>
|
||||
implements $FeedConsultantPaginationModelCopyWith<$Res> {
|
||||
_$FeedConsultantPaginationModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? data = null,
|
||||
Object? links = null,
|
||||
Object? meta = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
data: null == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as List<FeedConsultantModel>,
|
||||
links: null == links
|
||||
? _value.links
|
||||
: links // ignore: cast_nullable_to_non_nullable
|
||||
as Links,
|
||||
meta: null == meta
|
||||
? _value.meta
|
||||
: meta // ignore: cast_nullable_to_non_nullable
|
||||
as Meta,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$LinksCopyWith<$Res> get links {
|
||||
return $LinksCopyWith<$Res>(_value.links, (value) {
|
||||
return _then(_value.copyWith(links: value) as $Val);
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$MetaCopyWith<$Res> get meta {
|
||||
return $MetaCopyWith<$Res>(_value.meta, (value) {
|
||||
return _then(_value.copyWith(meta: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FeedConsultantPaginationModelImplCopyWith<$Res>
|
||||
implements $FeedConsultantPaginationModelCopyWith<$Res> {
|
||||
factory _$$FeedConsultantPaginationModelImplCopyWith(
|
||||
_$FeedConsultantPaginationModelImpl value,
|
||||
$Res Function(_$FeedConsultantPaginationModelImpl) then) =
|
||||
__$$FeedConsultantPaginationModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({List<FeedConsultantModel> data, Links links, Meta meta});
|
||||
|
||||
@override
|
||||
$LinksCopyWith<$Res> get links;
|
||||
@override
|
||||
$MetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FeedConsultantPaginationModelImplCopyWithImpl<$Res>
|
||||
extends _$FeedConsultantPaginationModelCopyWithImpl<$Res,
|
||||
_$FeedConsultantPaginationModelImpl>
|
||||
implements _$$FeedConsultantPaginationModelImplCopyWith<$Res> {
|
||||
__$$FeedConsultantPaginationModelImplCopyWithImpl(
|
||||
_$FeedConsultantPaginationModelImpl _value,
|
||||
$Res Function(_$FeedConsultantPaginationModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? data = null,
|
||||
Object? links = null,
|
||||
Object? meta = null,
|
||||
}) {
|
||||
return _then(_$FeedConsultantPaginationModelImpl(
|
||||
data: null == data
|
||||
? _value._data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as List<FeedConsultantModel>,
|
||||
links: null == links
|
||||
? _value.links
|
||||
: links // ignore: cast_nullable_to_non_nullable
|
||||
as Links,
|
||||
meta: null == meta
|
||||
? _value.meta
|
||||
: meta // ignore: cast_nullable_to_non_nullable
|
||||
as Meta,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$FeedConsultantPaginationModelImpl
|
||||
implements _FeedConsultantPaginationModel {
|
||||
const _$FeedConsultantPaginationModelImpl(
|
||||
{required final List<FeedConsultantModel> data,
|
||||
required this.links,
|
||||
required this.meta})
|
||||
: _data = data;
|
||||
|
||||
factory _$FeedConsultantPaginationModelImpl.fromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$$FeedConsultantPaginationModelImplFromJson(json);
|
||||
|
||||
final List<FeedConsultantModel> _data;
|
||||
@override
|
||||
List<FeedConsultantModel> get data {
|
||||
if (_data is EqualUnmodifiableListView) return _data;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_data);
|
||||
}
|
||||
|
||||
@override
|
||||
final Links links;
|
||||
@override
|
||||
final Meta meta;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'FeedConsultantPaginationModel(data: $data, links: $links, meta: $meta)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$FeedConsultantPaginationModelImpl &&
|
||||
const DeepCollectionEquality().equals(other._data, _data) &&
|
||||
(identical(other.links, links) || other.links == links) &&
|
||||
(identical(other.meta, meta) || other.meta == meta));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_data), links, meta);
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$FeedConsultantPaginationModelImplCopyWith<
|
||||
_$FeedConsultantPaginationModelImpl>
|
||||
get copyWith => __$$FeedConsultantPaginationModelImplCopyWithImpl<
|
||||
_$FeedConsultantPaginationModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$FeedConsultantPaginationModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _FeedConsultantPaginationModel
|
||||
implements FeedConsultantPaginationModel {
|
||||
const factory _FeedConsultantPaginationModel(
|
||||
{required final List<FeedConsultantModel> data,
|
||||
required final Links links,
|
||||
required final Meta meta}) = _$FeedConsultantPaginationModelImpl;
|
||||
|
||||
factory _FeedConsultantPaginationModel.fromJson(Map<String, dynamic> json) =
|
||||
_$FeedConsultantPaginationModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
List<FeedConsultantModel> get data;
|
||||
@override
|
||||
Links get links;
|
||||
@override
|
||||
Meta get meta;
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$FeedConsultantPaginationModelImplCopyWith<
|
||||
_$FeedConsultantPaginationModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
FeedConsultantModel _$FeedConsultantModelFromJson(Map<String, dynamic> json) {
|
||||
return _FeedConsultantModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$FeedConsultantModel {
|
||||
String get slug => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'rating_place')
|
||||
int get ratingPlace => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'profile_photo_url')
|
||||
String get photo => throw _privateConstructorUsedError;
|
||||
List<BadgeModel> get badges => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this FeedConsultantModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of FeedConsultantModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$FeedConsultantModelCopyWith<FeedConsultantModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $FeedConsultantModelCopyWith<$Res> {
|
||||
factory $FeedConsultantModelCopyWith(
|
||||
FeedConsultantModel value, $Res Function(FeedConsultantModel) then) =
|
||||
_$FeedConsultantModelCopyWithImpl<$Res, FeedConsultantModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String slug,
|
||||
String name,
|
||||
@JsonKey(name: 'rating_place') int ratingPlace,
|
||||
@JsonKey(name: 'profile_photo_url') String photo,
|
||||
List<BadgeModel> badges});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$FeedConsultantModelCopyWithImpl<$Res, $Val extends FeedConsultantModel>
|
||||
implements $FeedConsultantModelCopyWith<$Res> {
|
||||
_$FeedConsultantModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of FeedConsultantModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? slug = null,
|
||||
Object? name = null,
|
||||
Object? ratingPlace = null,
|
||||
Object? photo = null,
|
||||
Object? badges = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
slug: null == slug
|
||||
? _value.slug
|
||||
: slug // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
ratingPlace: null == ratingPlace
|
||||
? _value.ratingPlace
|
||||
: ratingPlace // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
photo: null == photo
|
||||
? _value.photo
|
||||
: photo // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
badges: null == badges
|
||||
? _value.badges
|
||||
: badges // ignore: cast_nullable_to_non_nullable
|
||||
as List<BadgeModel>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FeedConsultantModelImplCopyWith<$Res>
|
||||
implements $FeedConsultantModelCopyWith<$Res> {
|
||||
factory _$$FeedConsultantModelImplCopyWith(_$FeedConsultantModelImpl value,
|
||||
$Res Function(_$FeedConsultantModelImpl) then) =
|
||||
__$$FeedConsultantModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String slug,
|
||||
String name,
|
||||
@JsonKey(name: 'rating_place') int ratingPlace,
|
||||
@JsonKey(name: 'profile_photo_url') String photo,
|
||||
List<BadgeModel> badges});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FeedConsultantModelImplCopyWithImpl<$Res>
|
||||
extends _$FeedConsultantModelCopyWithImpl<$Res, _$FeedConsultantModelImpl>
|
||||
implements _$$FeedConsultantModelImplCopyWith<$Res> {
|
||||
__$$FeedConsultantModelImplCopyWithImpl(_$FeedConsultantModelImpl _value,
|
||||
$Res Function(_$FeedConsultantModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of FeedConsultantModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? slug = null,
|
||||
Object? name = null,
|
||||
Object? ratingPlace = null,
|
||||
Object? photo = null,
|
||||
Object? badges = null,
|
||||
}) {
|
||||
return _then(_$FeedConsultantModelImpl(
|
||||
slug: null == slug
|
||||
? _value.slug
|
||||
: slug // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
ratingPlace: null == ratingPlace
|
||||
? _value.ratingPlace
|
||||
: ratingPlace // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
photo: null == photo
|
||||
? _value.photo
|
||||
: photo // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
badges: null == badges
|
||||
? _value._badges
|
||||
: badges // ignore: cast_nullable_to_non_nullable
|
||||
as List<BadgeModel>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$FeedConsultantModelImpl implements _FeedConsultantModel {
|
||||
const _$FeedConsultantModelImpl(
|
||||
{required this.slug,
|
||||
required this.name,
|
||||
@JsonKey(name: 'rating_place') required this.ratingPlace,
|
||||
@JsonKey(name: 'profile_photo_url') required this.photo,
|
||||
required final List<BadgeModel> badges})
|
||||
: _badges = badges;
|
||||
|
||||
factory _$FeedConsultantModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$FeedConsultantModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String slug;
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
@JsonKey(name: 'rating_place')
|
||||
final int ratingPlace;
|
||||
@override
|
||||
@JsonKey(name: 'profile_photo_url')
|
||||
final String photo;
|
||||
final List<BadgeModel> _badges;
|
||||
@override
|
||||
List<BadgeModel> get badges {
|
||||
if (_badges is EqualUnmodifiableListView) return _badges;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_badges);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'FeedConsultantModel(slug: $slug, name: $name, ratingPlace: $ratingPlace, photo: $photo, badges: $badges)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$FeedConsultantModelImpl &&
|
||||
(identical(other.slug, slug) || other.slug == slug) &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.ratingPlace, ratingPlace) ||
|
||||
other.ratingPlace == ratingPlace) &&
|
||||
(identical(other.photo, photo) || other.photo == photo) &&
|
||||
const DeepCollectionEquality().equals(other._badges, _badges));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, slug, name, ratingPlace, photo,
|
||||
const DeepCollectionEquality().hash(_badges));
|
||||
|
||||
/// Create a copy of FeedConsultantModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$FeedConsultantModelImplCopyWith<_$FeedConsultantModelImpl> get copyWith =>
|
||||
__$$FeedConsultantModelImplCopyWithImpl<_$FeedConsultantModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$FeedConsultantModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _FeedConsultantModel implements FeedConsultantModel {
|
||||
const factory _FeedConsultantModel(
|
||||
{required final String slug,
|
||||
required final String name,
|
||||
@JsonKey(name: 'rating_place') required final int ratingPlace,
|
||||
@JsonKey(name: 'profile_photo_url') required final String photo,
|
||||
required final List<BadgeModel> badges}) = _$FeedConsultantModelImpl;
|
||||
|
||||
factory _FeedConsultantModel.fromJson(Map<String, dynamic> json) =
|
||||
_$FeedConsultantModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get slug;
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
@JsonKey(name: 'rating_place')
|
||||
int get ratingPlace;
|
||||
@override
|
||||
@JsonKey(name: 'profile_photo_url')
|
||||
String get photo;
|
||||
@override
|
||||
List<BadgeModel> get badges;
|
||||
|
||||
/// Create a copy of FeedConsultantModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$FeedConsultantModelImplCopyWith<_$FeedConsultantModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
48
lib/features/feed/models/feed_consultant_model.g.dart
Normal file
48
lib/features/feed/models/feed_consultant_model.g.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'feed_consultant_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$FeedConsultantPaginationModelImpl
|
||||
_$$FeedConsultantPaginationModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$FeedConsultantPaginationModelImpl(
|
||||
data: (json['data'] as List<dynamic>)
|
||||
.map((e) =>
|
||||
FeedConsultantModel.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> _$$FeedConsultantPaginationModelImplToJson(
|
||||
_$FeedConsultantPaginationModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.data,
|
||||
'links': instance.links,
|
||||
'meta': instance.meta,
|
||||
};
|
||||
|
||||
_$FeedConsultantModelImpl _$$FeedConsultantModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$FeedConsultantModelImpl(
|
||||
slug: json['slug'] as String,
|
||||
name: json['name'] as String,
|
||||
ratingPlace: (json['rating_place'] as num).toInt(),
|
||||
photo: json['profile_photo_url'] as String,
|
||||
badges: (json['badges'] as List<dynamic>)
|
||||
.map((e) => BadgeModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$FeedConsultantModelImplToJson(
|
||||
_$FeedConsultantModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'slug': instance.slug,
|
||||
'name': instance.name,
|
||||
'rating_place': instance.ratingPlace,
|
||||
'profile_photo_url': instance.photo,
|
||||
'badges': instance.badges,
|
||||
};
|
||||
@@ -21,6 +21,8 @@ class Recipes with _$Recipes {
|
||||
required String type,
|
||||
required String slug,
|
||||
@JsonKey(name: 'total_comments') required int commentsCount,
|
||||
@JsonKey(name: 'was_liked_by_me') required bool wasLikedByMe,
|
||||
@JsonKey(name: 'energy_per_serving') required double calories,
|
||||
@JsonKey(name: 'total_likes') required int likesCount,
|
||||
@JsonKey(name: 'total_views') required int viewsCount,
|
||||
required Author author,
|
||||
|
||||
@@ -39,6 +39,10 @@ mixin _$Recipes {
|
||||
String get slug => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'total_comments')
|
||||
int get commentsCount => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'was_liked_by_me')
|
||||
bool get wasLikedByMe => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'energy_per_serving')
|
||||
double get calories => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'total_likes')
|
||||
int get likesCount => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'total_views')
|
||||
@@ -74,6 +78,8 @@ abstract class $RecipesCopyWith<$Res> {
|
||||
String type,
|
||||
String slug,
|
||||
@JsonKey(name: 'total_comments') int commentsCount,
|
||||
@JsonKey(name: 'was_liked_by_me') bool wasLikedByMe,
|
||||
@JsonKey(name: 'energy_per_serving') double calories,
|
||||
@JsonKey(name: 'total_likes') int likesCount,
|
||||
@JsonKey(name: 'total_views') int viewsCount,
|
||||
Author author});
|
||||
@@ -110,6 +116,8 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes>
|
||||
Object? type = null,
|
||||
Object? slug = null,
|
||||
Object? commentsCount = null,
|
||||
Object? wasLikedByMe = null,
|
||||
Object? calories = null,
|
||||
Object? likesCount = null,
|
||||
Object? viewsCount = null,
|
||||
Object? author = null,
|
||||
@@ -171,6 +179,14 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes>
|
||||
? _value.commentsCount
|
||||
: commentsCount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
wasLikedByMe: null == wasLikedByMe
|
||||
? _value.wasLikedByMe
|
||||
: wasLikedByMe // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
calories: null == calories
|
||||
? _value.calories
|
||||
: calories // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
likesCount: null == likesCount
|
||||
? _value.likesCount
|
||||
: likesCount // ignore: cast_nullable_to_non_nullable
|
||||
@@ -219,6 +235,8 @@ abstract class _$$RecipesImplCopyWith<$Res> implements $RecipesCopyWith<$Res> {
|
||||
String type,
|
||||
String slug,
|
||||
@JsonKey(name: 'total_comments') int commentsCount,
|
||||
@JsonKey(name: 'was_liked_by_me') bool wasLikedByMe,
|
||||
@JsonKey(name: 'energy_per_serving') double calories,
|
||||
@JsonKey(name: 'total_likes') int likesCount,
|
||||
@JsonKey(name: 'total_views') int viewsCount,
|
||||
Author author});
|
||||
@@ -254,6 +272,8 @@ class __$$RecipesImplCopyWithImpl<$Res>
|
||||
Object? type = null,
|
||||
Object? slug = null,
|
||||
Object? commentsCount = null,
|
||||
Object? wasLikedByMe = null,
|
||||
Object? calories = null,
|
||||
Object? likesCount = null,
|
||||
Object? viewsCount = null,
|
||||
Object? author = null,
|
||||
@@ -315,6 +335,14 @@ class __$$RecipesImplCopyWithImpl<$Res>
|
||||
? _value.commentsCount
|
||||
: commentsCount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
wasLikedByMe: null == wasLikedByMe
|
||||
? _value.wasLikedByMe
|
||||
: wasLikedByMe // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
calories: null == calories
|
||||
? _value.calories
|
||||
: calories // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
likesCount: null == likesCount
|
||||
? _value.likesCount
|
||||
: likesCount // ignore: cast_nullable_to_non_nullable
|
||||
@@ -349,6 +377,8 @@ class _$RecipesImpl implements _Recipes {
|
||||
required this.type,
|
||||
required this.slug,
|
||||
@JsonKey(name: 'total_comments') required this.commentsCount,
|
||||
@JsonKey(name: 'was_liked_by_me') required this.wasLikedByMe,
|
||||
@JsonKey(name: 'energy_per_serving') required this.calories,
|
||||
@JsonKey(name: 'total_likes') required this.likesCount,
|
||||
@JsonKey(name: 'total_views') required this.viewsCount,
|
||||
required this.author})
|
||||
@@ -404,6 +434,12 @@ class _$RecipesImpl implements _Recipes {
|
||||
@JsonKey(name: 'total_comments')
|
||||
final int commentsCount;
|
||||
@override
|
||||
@JsonKey(name: 'was_liked_by_me')
|
||||
final bool wasLikedByMe;
|
||||
@override
|
||||
@JsonKey(name: 'energy_per_serving')
|
||||
final double calories;
|
||||
@override
|
||||
@JsonKey(name: 'total_likes')
|
||||
final int likesCount;
|
||||
@override
|
||||
@@ -414,7 +450,7 @@ class _$RecipesImpl implements _Recipes {
|
||||
|
||||
@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, likesCount: $likesCount, viewsCount: $viewsCount, author: $author)';
|
||||
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, wasLikedByMe: $wasLikedByMe, calories: $calories, likesCount: $likesCount, viewsCount: $viewsCount, author: $author)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -443,6 +479,10 @@ class _$RecipesImpl implements _Recipes {
|
||||
(identical(other.slug, slug) || other.slug == slug) &&
|
||||
(identical(other.commentsCount, commentsCount) ||
|
||||
other.commentsCount == commentsCount) &&
|
||||
(identical(other.wasLikedByMe, wasLikedByMe) ||
|
||||
other.wasLikedByMe == wasLikedByMe) &&
|
||||
(identical(other.calories, calories) ||
|
||||
other.calories == calories) &&
|
||||
(identical(other.likesCount, likesCount) ||
|
||||
other.likesCount == likesCount) &&
|
||||
(identical(other.viewsCount, viewsCount) ||
|
||||
@@ -452,25 +492,28 @@ class _$RecipesImpl implements _Recipes {
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@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,
|
||||
likesCount,
|
||||
viewsCount,
|
||||
author);
|
||||
int get hashCode => Object.hashAll([
|
||||
runtimeType,
|
||||
id,
|
||||
image,
|
||||
state,
|
||||
cookingTime,
|
||||
const DeepCollectionEquality().hash(_ingredients),
|
||||
description,
|
||||
const DeepCollectionEquality().hash(_steps),
|
||||
videoUrl,
|
||||
createdAt,
|
||||
updatedAt,
|
||||
title,
|
||||
type,
|
||||
slug,
|
||||
commentsCount,
|
||||
wasLikedByMe,
|
||||
calories,
|
||||
likesCount,
|
||||
viewsCount,
|
||||
author
|
||||
]);
|
||||
|
||||
/// Create a copy of Recipes
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -504,6 +547,8 @@ abstract class _Recipes implements Recipes {
|
||||
required final String type,
|
||||
required final String slug,
|
||||
@JsonKey(name: 'total_comments') required final int commentsCount,
|
||||
@JsonKey(name: 'was_liked_by_me') required final bool wasLikedByMe,
|
||||
@JsonKey(name: 'energy_per_serving') required final double calories,
|
||||
@JsonKey(name: 'total_likes') required final int likesCount,
|
||||
@JsonKey(name: 'total_views') required final int viewsCount,
|
||||
required final Author author}) = _$RecipesImpl;
|
||||
@@ -544,6 +589,12 @@ abstract class _Recipes implements Recipes {
|
||||
@JsonKey(name: 'total_comments')
|
||||
int get commentsCount;
|
||||
@override
|
||||
@JsonKey(name: 'was_liked_by_me')
|
||||
bool get wasLikedByMe;
|
||||
@override
|
||||
@JsonKey(name: 'energy_per_serving')
|
||||
double get calories;
|
||||
@override
|
||||
@JsonKey(name: 'total_likes')
|
||||
int get likesCount;
|
||||
@override
|
||||
|
||||
@@ -26,6 +26,8 @@ _$RecipesImpl _$$RecipesImplFromJson(Map<String, dynamic> json) =>
|
||||
type: json['type'] as String,
|
||||
slug: json['slug'] as String,
|
||||
commentsCount: (json['total_comments'] as num).toInt(),
|
||||
wasLikedByMe: json['was_liked_by_me'] as bool,
|
||||
calories: (json['energy_per_serving'] as num).toDouble(),
|
||||
likesCount: (json['total_likes'] as num).toInt(),
|
||||
viewsCount: (json['total_views'] as num).toInt(),
|
||||
author: Author.fromJson(json['author'] as Map<String, dynamic>),
|
||||
@@ -47,6 +49,8 @@ Map<String, dynamic> _$$RecipesImplToJson(_$RecipesImpl instance) =>
|
||||
'type': instance.type,
|
||||
'slug': instance.slug,
|
||||
'total_comments': instance.commentsCount,
|
||||
'was_liked_by_me': instance.wasLikedByMe,
|
||||
'energy_per_serving': instance.calories,
|
||||
'total_likes': instance.likesCount,
|
||||
'total_views': instance.viewsCount,
|
||||
'author': instance.author,
|
||||
|
||||
Reference in New Issue
Block a user