forked from eatvio/eatvio_app
refactor: profile model
This commit is contained in:
@@ -22,7 +22,7 @@ class Meta with _$Meta {
|
||||
@JsonKey(name: "from") required dynamic from,
|
||||
@JsonKey(name: "last_page") required int lastPage,
|
||||
@JsonKey(name: "links") required List<Link> links,
|
||||
@JsonKey(name: "path") required String path,
|
||||
@JsonKey(name: "path") String? path,
|
||||
@JsonKey(name: "per_page") required int perPage,
|
||||
@JsonKey(name: "to") required dynamic to,
|
||||
@JsonKey(name: "total") required int total,
|
||||
@@ -34,9 +34,9 @@ class Meta with _$Meta {
|
||||
@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,
|
||||
@JsonKey(name: "url") String? url,
|
||||
@JsonKey(name: "label") String? label,
|
||||
@JsonKey(name: "active") bool? active,
|
||||
}) = _Link;
|
||||
|
||||
factory Link.fromJson(Map<String, Object?> json) => _$LinkFromJson(json);
|
||||
|
||||
@@ -29,8 +29,12 @@ mixin _$Links {
|
||||
@JsonKey(name: "next")
|
||||
dynamic get next => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Links to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@JsonKey(ignore: true)
|
||||
|
||||
/// Create a copy of Links
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$LinksCopyWith<Links> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -56,6 +60,8 @@ class _$LinksCopyWithImpl<$Res, $Val extends Links>
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Links
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
@@ -107,6 +113,8 @@ class __$$LinksImplCopyWithImpl<$Res>
|
||||
_$LinksImpl _value, $Res Function(_$LinksImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Links
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
@@ -177,7 +185,7 @@ class _$LinksImpl implements _Links {
|
||||
const DeepCollectionEquality().equals(other.next, next));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
@@ -186,7 +194,9 @@ class _$LinksImpl implements _Links {
|
||||
const DeepCollectionEquality().hash(prev),
|
||||
const DeepCollectionEquality().hash(next));
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
/// Create a copy of Links
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LinksImplCopyWith<_$LinksImpl> get copyWith =>
|
||||
@@ -221,8 +231,11 @@ abstract class _Links implements Links {
|
||||
@override
|
||||
@JsonKey(name: "next")
|
||||
dynamic get next;
|
||||
|
||||
/// Create a copy of Links
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LinksImplCopyWith<_$LinksImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -242,7 +255,7 @@ mixin _$Meta {
|
||||
@JsonKey(name: "links")
|
||||
List<Link> get links => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "path")
|
||||
String get path => throw _privateConstructorUsedError;
|
||||
String? get path => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "per_page")
|
||||
int get perPage => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "to")
|
||||
@@ -250,8 +263,12 @@ mixin _$Meta {
|
||||
@JsonKey(name: "total")
|
||||
int get total => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Meta to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@JsonKey(ignore: true)
|
||||
|
||||
/// Create a copy of Meta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$MetaCopyWith<Meta> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -265,7 +282,7 @@ abstract class $MetaCopyWith<$Res> {
|
||||
@JsonKey(name: "from") dynamic from,
|
||||
@JsonKey(name: "last_page") int lastPage,
|
||||
@JsonKey(name: "links") List<Link> links,
|
||||
@JsonKey(name: "path") String path,
|
||||
@JsonKey(name: "path") String? path,
|
||||
@JsonKey(name: "per_page") int perPage,
|
||||
@JsonKey(name: "to") dynamic to,
|
||||
@JsonKey(name: "total") int total});
|
||||
@@ -281,6 +298,8 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta>
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Meta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
@@ -288,7 +307,7 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta>
|
||||
Object? from = freezed,
|
||||
Object? lastPage = null,
|
||||
Object? links = null,
|
||||
Object? path = null,
|
||||
Object? path = freezed,
|
||||
Object? perPage = null,
|
||||
Object? to = freezed,
|
||||
Object? total = null,
|
||||
@@ -310,10 +329,10 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta>
|
||||
? _value.links
|
||||
: links // ignore: cast_nullable_to_non_nullable
|
||||
as List<Link>,
|
||||
path: null == path
|
||||
path: freezed == path
|
||||
? _value.path
|
||||
: path // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as String?,
|
||||
perPage: null == perPage
|
||||
? _value.perPage
|
||||
: perPage // ignore: cast_nullable_to_non_nullable
|
||||
@@ -342,7 +361,7 @@ abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> {
|
||||
@JsonKey(name: "from") dynamic from,
|
||||
@JsonKey(name: "last_page") int lastPage,
|
||||
@JsonKey(name: "links") List<Link> links,
|
||||
@JsonKey(name: "path") String path,
|
||||
@JsonKey(name: "path") String? path,
|
||||
@JsonKey(name: "per_page") int perPage,
|
||||
@JsonKey(name: "to") dynamic to,
|
||||
@JsonKey(name: "total") int total});
|
||||
@@ -355,6 +374,8 @@ class __$$MetaImplCopyWithImpl<$Res>
|
||||
__$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Meta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
@@ -362,7 +383,7 @@ class __$$MetaImplCopyWithImpl<$Res>
|
||||
Object? from = freezed,
|
||||
Object? lastPage = null,
|
||||
Object? links = null,
|
||||
Object? path = null,
|
||||
Object? path = freezed,
|
||||
Object? perPage = null,
|
||||
Object? to = freezed,
|
||||
Object? total = null,
|
||||
@@ -384,10 +405,10 @@ class __$$MetaImplCopyWithImpl<$Res>
|
||||
? _value._links
|
||||
: links // ignore: cast_nullable_to_non_nullable
|
||||
as List<Link>,
|
||||
path: null == path
|
||||
path: freezed == path
|
||||
? _value.path
|
||||
: path // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as String?,
|
||||
perPage: null == perPage
|
||||
? _value.perPage
|
||||
: perPage // ignore: cast_nullable_to_non_nullable
|
||||
@@ -412,7 +433,7 @@ class _$MetaImpl implements _Meta {
|
||||
@JsonKey(name: "from") required this.from,
|
||||
@JsonKey(name: "last_page") required this.lastPage,
|
||||
@JsonKey(name: "links") required final List<Link> links,
|
||||
@JsonKey(name: "path") required this.path,
|
||||
@JsonKey(name: "path") this.path,
|
||||
@JsonKey(name: "per_page") required this.perPage,
|
||||
@JsonKey(name: "to") required this.to,
|
||||
@JsonKey(name: "total") required this.total})
|
||||
@@ -441,7 +462,7 @@ class _$MetaImpl implements _Meta {
|
||||
|
||||
@override
|
||||
@JsonKey(name: "path")
|
||||
final String path;
|
||||
final String? path;
|
||||
@override
|
||||
@JsonKey(name: "per_page")
|
||||
final int perPage;
|
||||
@@ -474,7 +495,7 @@ class _$MetaImpl implements _Meta {
|
||||
(identical(other.total, total) || other.total == total));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
@@ -487,7 +508,9 @@ class _$MetaImpl implements _Meta {
|
||||
const DeepCollectionEquality().hash(to),
|
||||
total);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
/// Create a copy of Meta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$MetaImplCopyWith<_$MetaImpl> get copyWith =>
|
||||
@@ -507,7 +530,7 @@ abstract class _Meta implements Meta {
|
||||
@JsonKey(name: "from") required final dynamic from,
|
||||
@JsonKey(name: "last_page") required final int lastPage,
|
||||
@JsonKey(name: "links") required final List<Link> links,
|
||||
@JsonKey(name: "path") required final String path,
|
||||
@JsonKey(name: "path") final String? path,
|
||||
@JsonKey(name: "per_page") required final int perPage,
|
||||
@JsonKey(name: "to") required final dynamic to,
|
||||
@JsonKey(name: "total") required final int total}) = _$MetaImpl;
|
||||
@@ -528,7 +551,7 @@ abstract class _Meta implements Meta {
|
||||
List<Link> get links;
|
||||
@override
|
||||
@JsonKey(name: "path")
|
||||
String get path;
|
||||
String? get path;
|
||||
@override
|
||||
@JsonKey(name: "per_page")
|
||||
int get perPage;
|
||||
@@ -538,8 +561,11 @@ abstract class _Meta implements Meta {
|
||||
@override
|
||||
@JsonKey(name: "total")
|
||||
int get total;
|
||||
|
||||
/// Create a copy of Meta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$MetaImplCopyWith<_$MetaImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -553,12 +579,16 @@ mixin _$Link {
|
||||
@JsonKey(name: "url")
|
||||
String? get url => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "label")
|
||||
String get label => throw _privateConstructorUsedError;
|
||||
String? get label => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "active")
|
||||
bool get active => throw _privateConstructorUsedError;
|
||||
bool? get active => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Link to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@JsonKey(ignore: true)
|
||||
|
||||
/// Create a copy of Link
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$LinkCopyWith<Link> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -569,8 +599,8 @@ abstract class $LinkCopyWith<$Res> {
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "url") String? url,
|
||||
@JsonKey(name: "label") String label,
|
||||
@JsonKey(name: "active") bool active});
|
||||
@JsonKey(name: "label") String? label,
|
||||
@JsonKey(name: "active") bool? active});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -583,26 +613,28 @@ class _$LinkCopyWithImpl<$Res, $Val extends Link>
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Link
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? url = freezed,
|
||||
Object? label = null,
|
||||
Object? active = null,
|
||||
Object? label = freezed,
|
||||
Object? active = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
url: freezed == url
|
||||
? _value.url
|
||||
: url // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
label: null == label
|
||||
label: freezed == label
|
||||
? _value.label
|
||||
: label // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
active: null == active
|
||||
as String?,
|
||||
active: freezed == active
|
||||
? _value.active
|
||||
: active // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
as bool?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -616,8 +648,8 @@ abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$Res> {
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "url") String? url,
|
||||
@JsonKey(name: "label") String label,
|
||||
@JsonKey(name: "active") bool active});
|
||||
@JsonKey(name: "label") String? label,
|
||||
@JsonKey(name: "active") bool? active});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -627,26 +659,28 @@ class __$$LinkImplCopyWithImpl<$Res>
|
||||
__$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Link
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? url = freezed,
|
||||
Object? label = null,
|
||||
Object? active = null,
|
||||
Object? label = freezed,
|
||||
Object? active = freezed,
|
||||
}) {
|
||||
return _then(_$LinkImpl(
|
||||
url: freezed == url
|
||||
? _value.url
|
||||
: url // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
label: null == label
|
||||
label: freezed == label
|
||||
? _value.label
|
||||
: label // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
active: null == active
|
||||
as String?,
|
||||
active: freezed == active
|
||||
? _value.active
|
||||
: active // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
as bool?,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -655,9 +689,9 @@ class __$$LinkImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$LinkImpl implements _Link {
|
||||
const _$LinkImpl(
|
||||
{@JsonKey(name: "url") required this.url,
|
||||
@JsonKey(name: "label") required this.label,
|
||||
@JsonKey(name: "active") required this.active});
|
||||
{@JsonKey(name: "url") this.url,
|
||||
@JsonKey(name: "label") this.label,
|
||||
@JsonKey(name: "active") this.active});
|
||||
|
||||
factory _$LinkImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$LinkImplFromJson(json);
|
||||
@@ -667,10 +701,10 @@ class _$LinkImpl implements _Link {
|
||||
final String? url;
|
||||
@override
|
||||
@JsonKey(name: "label")
|
||||
final String label;
|
||||
final String? label;
|
||||
@override
|
||||
@JsonKey(name: "active")
|
||||
final bool active;
|
||||
final bool? active;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@@ -687,11 +721,13 @@ class _$LinkImpl implements _Link {
|
||||
(identical(other.active, active) || other.active == active));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, url, label, active);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
/// Create a copy of Link
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LinkImplCopyWith<_$LinkImpl> get copyWith =>
|
||||
@@ -707,9 +743,9 @@ class _$LinkImpl implements _Link {
|
||||
|
||||
abstract class _Link implements Link {
|
||||
const factory _Link(
|
||||
{@JsonKey(name: "url") required final String? url,
|
||||
@JsonKey(name: "label") required final String label,
|
||||
@JsonKey(name: "active") required final bool active}) = _$LinkImpl;
|
||||
{@JsonKey(name: "url") final String? url,
|
||||
@JsonKey(name: "label") final String? label,
|
||||
@JsonKey(name: "active") final bool? active}) = _$LinkImpl;
|
||||
|
||||
factory _Link.fromJson(Map<String, dynamic> json) = _$LinkImpl.fromJson;
|
||||
|
||||
@@ -718,12 +754,15 @@ abstract class _Link implements Link {
|
||||
String? get url;
|
||||
@override
|
||||
@JsonKey(name: "label")
|
||||
String get label;
|
||||
String? get label;
|
||||
@override
|
||||
@JsonKey(name: "active")
|
||||
bool get active;
|
||||
bool? get active;
|
||||
|
||||
/// Create a copy of Link
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LinkImplCopyWith<_$LinkImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ _$MetaImpl _$$MetaImplFromJson(Map<String, dynamic> json) => _$MetaImpl(
|
||||
links: (json['links'] as List<dynamic>)
|
||||
.map((e) => Link.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
path: json['path'] as String,
|
||||
path: json['path'] as String?,
|
||||
perPage: (json['per_page'] as num).toInt(),
|
||||
to: json['to'],
|
||||
total: (json['total'] as num).toInt(),
|
||||
@@ -48,8 +48,8 @@ Map<String, dynamic> _$$MetaImplToJson(_$MetaImpl instance) =>
|
||||
|
||||
_$LinkImpl _$$LinkImplFromJson(Map<String, dynamic> json) => _$LinkImpl(
|
||||
url: json['url'] as String?,
|
||||
label: json['label'] as String,
|
||||
active: json['active'] as bool,
|
||||
label: json['label'] as String?,
|
||||
active: json['active'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$LinkImplToJson(_$LinkImpl instance) =>
|
||||
|
||||
Reference in New Issue
Block a user