👽 Support new mixed feed

This commit is contained in:
2025-04-06 01:20:55 +08:00
parent 151f917b07
commit 48f40099f4
13 changed files with 194 additions and 1179 deletions

View File

@ -3400,698 +3400,4 @@ class __$SnFeedEntryCopyWithImpl<$Res> implements _$SnFeedEntryCopyWith<$Res> {
}
}
/// @nodoc
mixin _$SnFediversePost {
int get id;
DateTime get createdAt;
DateTime get updatedAt;
DateTime? get deletedAt;
String get identifier;
String get origin;
String get content;
String get language;
List<String> get images;
SnFediverseUser get user;
int get userId;
/// Create a copy of SnFediversePost
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$SnFediversePostCopyWith<SnFediversePost> get copyWith =>
_$SnFediversePostCopyWithImpl<SnFediversePost>(
this as SnFediversePost, _$identity);
/// Serializes this SnFediversePost to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is SnFediversePost &&
(identical(other.id, id) || other.id == id) &&
(identical(other.createdAt, createdAt) ||
other.createdAt == createdAt) &&
(identical(other.updatedAt, updatedAt) ||
other.updatedAt == updatedAt) &&
(identical(other.deletedAt, deletedAt) ||
other.deletedAt == deletedAt) &&
(identical(other.identifier, identifier) ||
other.identifier == identifier) &&
(identical(other.origin, origin) || other.origin == origin) &&
(identical(other.content, content) || other.content == content) &&
(identical(other.language, language) ||
other.language == language) &&
const DeepCollectionEquality().equals(other.images, images) &&
(identical(other.user, user) || other.user == user) &&
(identical(other.userId, userId) || other.userId == userId));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
id,
createdAt,
updatedAt,
deletedAt,
identifier,
origin,
content,
language,
const DeepCollectionEquality().hash(images),
user,
userId);
@override
String toString() {
return 'SnFediversePost(id: $id, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, identifier: $identifier, origin: $origin, content: $content, language: $language, images: $images, user: $user, userId: $userId)';
}
}
/// @nodoc
abstract mixin class $SnFediversePostCopyWith<$Res> {
factory $SnFediversePostCopyWith(
SnFediversePost value, $Res Function(SnFediversePost) _then) =
_$SnFediversePostCopyWithImpl;
@useResult
$Res call(
{int id,
DateTime createdAt,
DateTime updatedAt,
DateTime? deletedAt,
String identifier,
String origin,
String content,
String language,
List<String> images,
SnFediverseUser user,
int userId});
$SnFediverseUserCopyWith<$Res> get user;
}
/// @nodoc
class _$SnFediversePostCopyWithImpl<$Res>
implements $SnFediversePostCopyWith<$Res> {
_$SnFediversePostCopyWithImpl(this._self, this._then);
final SnFediversePost _self;
final $Res Function(SnFediversePost) _then;
/// Create a copy of SnFediversePost
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? createdAt = null,
Object? updatedAt = null,
Object? deletedAt = freezed,
Object? identifier = null,
Object? origin = null,
Object? content = null,
Object? language = null,
Object? images = null,
Object? user = null,
Object? userId = null,
}) {
return _then(_self.copyWith(
id: null == id
? _self.id
: id // ignore: cast_nullable_to_non_nullable
as int,
createdAt: null == createdAt
? _self.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt: null == updatedAt
? _self.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
deletedAt: freezed == deletedAt
? _self.deletedAt
: deletedAt // ignore: cast_nullable_to_non_nullable
as DateTime?,
identifier: null == identifier
? _self.identifier
: identifier // ignore: cast_nullable_to_non_nullable
as String,
origin: null == origin
? _self.origin
: origin // ignore: cast_nullable_to_non_nullable
as String,
content: null == content
? _self.content
: content // ignore: cast_nullable_to_non_nullable
as String,
language: null == language
? _self.language
: language // ignore: cast_nullable_to_non_nullable
as String,
images: null == images
? _self.images
: images // ignore: cast_nullable_to_non_nullable
as List<String>,
user: null == user
? _self.user
: user // ignore: cast_nullable_to_non_nullable
as SnFediverseUser,
userId: null == userId
? _self.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
));
}
/// Create a copy of SnFediversePost
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SnFediverseUserCopyWith<$Res> get user {
return $SnFediverseUserCopyWith<$Res>(_self.user, (value) {
return _then(_self.copyWith(user: value));
});
}
}
/// @nodoc
@JsonSerializable()
class _SnFediversePost implements SnFediversePost {
const _SnFediversePost(
{required this.id,
required this.createdAt,
required this.updatedAt,
required this.deletedAt,
required this.identifier,
required this.origin,
required this.content,
required this.language,
required final List<String> images,
required this.user,
required this.userId})
: _images = images;
factory _SnFediversePost.fromJson(Map<String, dynamic> json) =>
_$SnFediversePostFromJson(json);
@override
final int id;
@override
final DateTime createdAt;
@override
final DateTime updatedAt;
@override
final DateTime? deletedAt;
@override
final String identifier;
@override
final String origin;
@override
final String content;
@override
final String language;
final List<String> _images;
@override
List<String> get images {
if (_images is EqualUnmodifiableListView) return _images;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_images);
}
@override
final SnFediverseUser user;
@override
final int userId;
/// Create a copy of SnFediversePost
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$SnFediversePostCopyWith<_SnFediversePost> get copyWith =>
__$SnFediversePostCopyWithImpl<_SnFediversePost>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$SnFediversePostToJson(
this,
);
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _SnFediversePost &&
(identical(other.id, id) || other.id == id) &&
(identical(other.createdAt, createdAt) ||
other.createdAt == createdAt) &&
(identical(other.updatedAt, updatedAt) ||
other.updatedAt == updatedAt) &&
(identical(other.deletedAt, deletedAt) ||
other.deletedAt == deletedAt) &&
(identical(other.identifier, identifier) ||
other.identifier == identifier) &&
(identical(other.origin, origin) || other.origin == origin) &&
(identical(other.content, content) || other.content == content) &&
(identical(other.language, language) ||
other.language == language) &&
const DeepCollectionEquality().equals(other._images, _images) &&
(identical(other.user, user) || other.user == user) &&
(identical(other.userId, userId) || other.userId == userId));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
id,
createdAt,
updatedAt,
deletedAt,
identifier,
origin,
content,
language,
const DeepCollectionEquality().hash(_images),
user,
userId);
@override
String toString() {
return 'SnFediversePost(id: $id, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, identifier: $identifier, origin: $origin, content: $content, language: $language, images: $images, user: $user, userId: $userId)';
}
}
/// @nodoc
abstract mixin class _$SnFediversePostCopyWith<$Res>
implements $SnFediversePostCopyWith<$Res> {
factory _$SnFediversePostCopyWith(
_SnFediversePost value, $Res Function(_SnFediversePost) _then) =
__$SnFediversePostCopyWithImpl;
@override
@useResult
$Res call(
{int id,
DateTime createdAt,
DateTime updatedAt,
DateTime? deletedAt,
String identifier,
String origin,
String content,
String language,
List<String> images,
SnFediverseUser user,
int userId});
@override
$SnFediverseUserCopyWith<$Res> get user;
}
/// @nodoc
class __$SnFediversePostCopyWithImpl<$Res>
implements _$SnFediversePostCopyWith<$Res> {
__$SnFediversePostCopyWithImpl(this._self, this._then);
final _SnFediversePost _self;
final $Res Function(_SnFediversePost) _then;
/// Create a copy of SnFediversePost
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$Res call({
Object? id = null,
Object? createdAt = null,
Object? updatedAt = null,
Object? deletedAt = freezed,
Object? identifier = null,
Object? origin = null,
Object? content = null,
Object? language = null,
Object? images = null,
Object? user = null,
Object? userId = null,
}) {
return _then(_SnFediversePost(
id: null == id
? _self.id
: id // ignore: cast_nullable_to_non_nullable
as int,
createdAt: null == createdAt
? _self.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt: null == updatedAt
? _self.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
deletedAt: freezed == deletedAt
? _self.deletedAt
: deletedAt // ignore: cast_nullable_to_non_nullable
as DateTime?,
identifier: null == identifier
? _self.identifier
: identifier // ignore: cast_nullable_to_non_nullable
as String,
origin: null == origin
? _self.origin
: origin // ignore: cast_nullable_to_non_nullable
as String,
content: null == content
? _self.content
: content // ignore: cast_nullable_to_non_nullable
as String,
language: null == language
? _self.language
: language // ignore: cast_nullable_to_non_nullable
as String,
images: null == images
? _self._images
: images // ignore: cast_nullable_to_non_nullable
as List<String>,
user: null == user
? _self.user
: user // ignore: cast_nullable_to_non_nullable
as SnFediverseUser,
userId: null == userId
? _self.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
));
}
/// Create a copy of SnFediversePost
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SnFediverseUserCopyWith<$Res> get user {
return $SnFediverseUserCopyWith<$Res>(_self.user, (value) {
return _then(_self.copyWith(user: value));
});
}
}
/// @nodoc
mixin _$SnFediverseUser {
int get id;
DateTime get createdAt;
DateTime get updatedAt;
DateTime? get deletedAt;
String get identifier;
String get origin;
String get avatar;
String get name;
String get nick;
/// Create a copy of SnFediverseUser
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$SnFediverseUserCopyWith<SnFediverseUser> get copyWith =>
_$SnFediverseUserCopyWithImpl<SnFediverseUser>(
this as SnFediverseUser, _$identity);
/// Serializes this SnFediverseUser to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is SnFediverseUser &&
(identical(other.id, id) || other.id == id) &&
(identical(other.createdAt, createdAt) ||
other.createdAt == createdAt) &&
(identical(other.updatedAt, updatedAt) ||
other.updatedAt == updatedAt) &&
(identical(other.deletedAt, deletedAt) ||
other.deletedAt == deletedAt) &&
(identical(other.identifier, identifier) ||
other.identifier == identifier) &&
(identical(other.origin, origin) || other.origin == origin) &&
(identical(other.avatar, avatar) || other.avatar == avatar) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.nick, nick) || other.nick == nick));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, createdAt, updatedAt,
deletedAt, identifier, origin, avatar, name, nick);
@override
String toString() {
return 'SnFediverseUser(id: $id, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, identifier: $identifier, origin: $origin, avatar: $avatar, name: $name, nick: $nick)';
}
}
/// @nodoc
abstract mixin class $SnFediverseUserCopyWith<$Res> {
factory $SnFediverseUserCopyWith(
SnFediverseUser value, $Res Function(SnFediverseUser) _then) =
_$SnFediverseUserCopyWithImpl;
@useResult
$Res call(
{int id,
DateTime createdAt,
DateTime updatedAt,
DateTime? deletedAt,
String identifier,
String origin,
String avatar,
String name,
String nick});
}
/// @nodoc
class _$SnFediverseUserCopyWithImpl<$Res>
implements $SnFediverseUserCopyWith<$Res> {
_$SnFediverseUserCopyWithImpl(this._self, this._then);
final SnFediverseUser _self;
final $Res Function(SnFediverseUser) _then;
/// Create a copy of SnFediverseUser
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? createdAt = null,
Object? updatedAt = null,
Object? deletedAt = freezed,
Object? identifier = null,
Object? origin = null,
Object? avatar = null,
Object? name = null,
Object? nick = null,
}) {
return _then(_self.copyWith(
id: null == id
? _self.id
: id // ignore: cast_nullable_to_non_nullable
as int,
createdAt: null == createdAt
? _self.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt: null == updatedAt
? _self.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
deletedAt: freezed == deletedAt
? _self.deletedAt
: deletedAt // ignore: cast_nullable_to_non_nullable
as DateTime?,
identifier: null == identifier
? _self.identifier
: identifier // ignore: cast_nullable_to_non_nullable
as String,
origin: null == origin
? _self.origin
: origin // ignore: cast_nullable_to_non_nullable
as String,
avatar: null == avatar
? _self.avatar
: avatar // ignore: cast_nullable_to_non_nullable
as String,
name: null == name
? _self.name
: name // ignore: cast_nullable_to_non_nullable
as String,
nick: null == nick
? _self.nick
: nick // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
@JsonSerializable()
class _SnFediverseUser implements SnFediverseUser {
const _SnFediverseUser(
{required this.id,
required this.createdAt,
required this.updatedAt,
required this.deletedAt,
required this.identifier,
required this.origin,
required this.avatar,
required this.name,
required this.nick});
factory _SnFediverseUser.fromJson(Map<String, dynamic> json) =>
_$SnFediverseUserFromJson(json);
@override
final int id;
@override
final DateTime createdAt;
@override
final DateTime updatedAt;
@override
final DateTime? deletedAt;
@override
final String identifier;
@override
final String origin;
@override
final String avatar;
@override
final String name;
@override
final String nick;
/// Create a copy of SnFediverseUser
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$SnFediverseUserCopyWith<_SnFediverseUser> get copyWith =>
__$SnFediverseUserCopyWithImpl<_SnFediverseUser>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$SnFediverseUserToJson(
this,
);
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _SnFediverseUser &&
(identical(other.id, id) || other.id == id) &&
(identical(other.createdAt, createdAt) ||
other.createdAt == createdAt) &&
(identical(other.updatedAt, updatedAt) ||
other.updatedAt == updatedAt) &&
(identical(other.deletedAt, deletedAt) ||
other.deletedAt == deletedAt) &&
(identical(other.identifier, identifier) ||
other.identifier == identifier) &&
(identical(other.origin, origin) || other.origin == origin) &&
(identical(other.avatar, avatar) || other.avatar == avatar) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.nick, nick) || other.nick == nick));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, createdAt, updatedAt,
deletedAt, identifier, origin, avatar, name, nick);
@override
String toString() {
return 'SnFediverseUser(id: $id, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, identifier: $identifier, origin: $origin, avatar: $avatar, name: $name, nick: $nick)';
}
}
/// @nodoc
abstract mixin class _$SnFediverseUserCopyWith<$Res>
implements $SnFediverseUserCopyWith<$Res> {
factory _$SnFediverseUserCopyWith(
_SnFediverseUser value, $Res Function(_SnFediverseUser) _then) =
__$SnFediverseUserCopyWithImpl;
@override
@useResult
$Res call(
{int id,
DateTime createdAt,
DateTime updatedAt,
DateTime? deletedAt,
String identifier,
String origin,
String avatar,
String name,
String nick});
}
/// @nodoc
class __$SnFediverseUserCopyWithImpl<$Res>
implements _$SnFediverseUserCopyWith<$Res> {
__$SnFediverseUserCopyWithImpl(this._self, this._then);
final _SnFediverseUser _self;
final $Res Function(_SnFediverseUser) _then;
/// Create a copy of SnFediverseUser
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$Res call({
Object? id = null,
Object? createdAt = null,
Object? updatedAt = null,
Object? deletedAt = freezed,
Object? identifier = null,
Object? origin = null,
Object? avatar = null,
Object? name = null,
Object? nick = null,
}) {
return _then(_SnFediverseUser(
id: null == id
? _self.id
: id // ignore: cast_nullable_to_non_nullable
as int,
createdAt: null == createdAt
? _self.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt: null == updatedAt
? _self.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
deletedAt: freezed == deletedAt
? _self.deletedAt
: deletedAt // ignore: cast_nullable_to_non_nullable
as DateTime?,
identifier: null == identifier
? _self.identifier
: identifier // ignore: cast_nullable_to_non_nullable
as String,
origin: null == origin
? _self.origin
: origin // ignore: cast_nullable_to_non_nullable
as String,
avatar: null == avatar
? _self.avatar
: avatar // ignore: cast_nullable_to_non_nullable
as String,
name: null == name
? _self.name
: name // ignore: cast_nullable_to_non_nullable
as String,
nick: null == nick
? _self.nick
: nick // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
// dart format on