forked from eatvio/eatvio_app
feat(profile): add blogPosts of user, charts
This commit is contained in:
@@ -22,6 +22,7 @@ class Datum with _$Datum {
|
||||
@JsonKey(name: "author_profile_icon") required String authorProfileIcon,
|
||||
@JsonKey(name: "body") required String body,
|
||||
@JsonKey(name: "children_comments") required List<Datum> childrenComments,
|
||||
@JsonKey(name: "created_at") required DateTime createdAt,
|
||||
}) = _Datum;
|
||||
|
||||
factory Datum.fromJson(Map<String, Object?> json) => _$DatumFromJson(json);
|
||||
|
||||
@@ -247,6 +247,8 @@ mixin _$Datum {
|
||||
String get body => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "children_comments")
|
||||
List<Datum> get childrenComments => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@JsonKey(ignore: true)
|
||||
@@ -263,7 +265,8 @@ abstract class $DatumCopyWith<$Res> {
|
||||
@JsonKey(name: "author_name") String authorName,
|
||||
@JsonKey(name: "author_profile_icon") String authorProfileIcon,
|
||||
@JsonKey(name: "body") String body,
|
||||
@JsonKey(name: "children_comments") List<Datum> childrenComments});
|
||||
@JsonKey(name: "children_comments") List<Datum> childrenComments,
|
||||
@JsonKey(name: "created_at") DateTime createdAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -284,6 +287,7 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum>
|
||||
Object? authorProfileIcon = null,
|
||||
Object? body = null,
|
||||
Object? childrenComments = null,
|
||||
Object? createdAt = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
@@ -306,6 +310,10 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum>
|
||||
? _value.childrenComments
|
||||
: childrenComments // ignore: cast_nullable_to_non_nullable
|
||||
as List<Datum>,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -322,7 +330,8 @@ abstract class _$$DatumImplCopyWith<$Res> implements $DatumCopyWith<$Res> {
|
||||
@JsonKey(name: "author_name") String authorName,
|
||||
@JsonKey(name: "author_profile_icon") String authorProfileIcon,
|
||||
@JsonKey(name: "body") String body,
|
||||
@JsonKey(name: "children_comments") List<Datum> childrenComments});
|
||||
@JsonKey(name: "children_comments") List<Datum> childrenComments,
|
||||
@JsonKey(name: "created_at") DateTime createdAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -341,6 +350,7 @@ class __$$DatumImplCopyWithImpl<$Res>
|
||||
Object? authorProfileIcon = null,
|
||||
Object? body = null,
|
||||
Object? childrenComments = null,
|
||||
Object? createdAt = null,
|
||||
}) {
|
||||
return _then(_$DatumImpl(
|
||||
id: null == id
|
||||
@@ -363,6 +373,10 @@ class __$$DatumImplCopyWithImpl<$Res>
|
||||
? _value._childrenComments
|
||||
: childrenComments // ignore: cast_nullable_to_non_nullable
|
||||
as List<Datum>,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -376,7 +390,8 @@ class _$DatumImpl implements _Datum {
|
||||
@JsonKey(name: "author_profile_icon") required this.authorProfileIcon,
|
||||
@JsonKey(name: "body") required this.body,
|
||||
@JsonKey(name: "children_comments")
|
||||
required final List<Datum> childrenComments})
|
||||
required final List<Datum> childrenComments,
|
||||
@JsonKey(name: "created_at") required this.createdAt})
|
||||
: _childrenComments = childrenComments;
|
||||
|
||||
factory _$DatumImpl.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -404,9 +419,13 @@ class _$DatumImpl implements _Datum {
|
||||
return EqualUnmodifiableListView(_childrenComments);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey(name: "created_at")
|
||||
final DateTime createdAt;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Datum(id: $id, authorName: $authorName, authorProfileIcon: $authorProfileIcon, body: $body, childrenComments: $childrenComments)';
|
||||
return 'Datum(id: $id, authorName: $authorName, authorProfileIcon: $authorProfileIcon, body: $body, childrenComments: $childrenComments, createdAt: $createdAt)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -421,7 +440,9 @@ class _$DatumImpl implements _Datum {
|
||||
other.authorProfileIcon == authorProfileIcon) &&
|
||||
(identical(other.body, body) || other.body == body) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._childrenComments, _childrenComments));
|
||||
.equals(other._childrenComments, _childrenComments) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@@ -432,7 +453,8 @@ class _$DatumImpl implements _Datum {
|
||||
authorName,
|
||||
authorProfileIcon,
|
||||
body,
|
||||
const DeepCollectionEquality().hash(_childrenComments));
|
||||
const DeepCollectionEquality().hash(_childrenComments),
|
||||
createdAt);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@@ -450,13 +472,15 @@ class _$DatumImpl implements _Datum {
|
||||
|
||||
abstract class _Datum implements Datum {
|
||||
const factory _Datum(
|
||||
{@JsonKey(name: "id") required final int id,
|
||||
@JsonKey(name: "author_name") required final String authorName,
|
||||
@JsonKey(name: "author_profile_icon")
|
||||
required final String authorProfileIcon,
|
||||
@JsonKey(name: "body") required final String body,
|
||||
@JsonKey(name: "children_comments")
|
||||
required final List<Datum> childrenComments}) = _$DatumImpl;
|
||||
{@JsonKey(name: "id") required final int id,
|
||||
@JsonKey(name: "author_name") required final String authorName,
|
||||
@JsonKey(name: "author_profile_icon")
|
||||
required final String authorProfileIcon,
|
||||
@JsonKey(name: "body") required final String body,
|
||||
@JsonKey(name: "children_comments")
|
||||
required final List<Datum> childrenComments,
|
||||
@JsonKey(name: "created_at") required final DateTime createdAt}) =
|
||||
_$DatumImpl;
|
||||
|
||||
factory _Datum.fromJson(Map<String, dynamic> json) = _$DatumImpl.fromJson;
|
||||
|
||||
@@ -476,6 +500,9 @@ abstract class _Datum implements Datum {
|
||||
@JsonKey(name: "children_comments")
|
||||
List<Datum> get childrenComments;
|
||||
@override
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$DatumImplCopyWith<_$DatumImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
@@ -30,6 +30,7 @@ _$DatumImpl _$$DatumImplFromJson(Map<String, dynamic> json) => _$DatumImpl(
|
||||
childrenComments: (json['children_comments'] as List<dynamic>)
|
||||
.map((e) => Datum.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DatumImplToJson(_$DatumImpl instance) =>
|
||||
@@ -39,6 +40,7 @@ Map<String, dynamic> _$$DatumImplToJson(_$DatumImpl instance) =>
|
||||
'author_profile_icon': instance.authorProfileIcon,
|
||||
'body': instance.body,
|
||||
'children_comments': instance.childrenComments,
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
};
|
||||
|
||||
_$LinksImpl _$$LinksImplFromJson(Map<String, dynamic> json) => _$LinksImpl(
|
||||
|
||||
Reference in New Issue
Block a user