Compare commits
14 Commits
5d4b896f70
...
3.2.0+126
Author | SHA1 | Date | |
---|---|---|---|
|
10e0d2fe5f | ||
|
99e10cb612 | ||
|
1db6941431 | ||
|
8370da4fe3 | ||
|
2bdf7029e9 | ||
|
86682a3a9a | ||
|
c3925e81b5 | ||
|
6f1f488490 | ||
|
31b2de2e46 | ||
|
412dcfa62a | ||
|
ffdc7e81ae | ||
|
1d3357803d | ||
|
6c48aa2356 | ||
|
466e354679 |
@@ -841,5 +841,14 @@
|
|||||||
"messageJumpNotLoaded": "The referenced message was not loaded, unable to jump to it.",
|
"messageJumpNotLoaded": "The referenced message was not loaded, unable to jump to it.",
|
||||||
"postUnlinkRealm": "No linked realm",
|
"postUnlinkRealm": "No linked realm",
|
||||||
"postSlug": "Slug",
|
"postSlug": "Slug",
|
||||||
"postSlugHint": "The slug can be used to access your post via URL in the webpage, it should be publisher-wide unique."
|
"postSlugHint": "The slug can be used to access your post via URL in the webpage, it should be publisher-wide unique.",
|
||||||
|
"attachmentOnDevice": "On-device",
|
||||||
|
"attachmentOnCloud": "On-cloud",
|
||||||
|
"attachments": "Attachments",
|
||||||
|
"publisherCollabInvitation": "Collabration invitations",
|
||||||
|
"publisherCollabInvitationCount": {
|
||||||
|
"zero": "No invitation",
|
||||||
|
"one": "{} available invitation",
|
||||||
|
"other": "{} available invitations"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -816,5 +816,13 @@
|
|||||||
"messageJumpNotLoaded": "引用的消息没有被加载,无法跳转。",
|
"messageJumpNotLoaded": "引用的消息没有被加载,无法跳转。",
|
||||||
"postUnlinkRealm": "不关联领域",
|
"postUnlinkRealm": "不关联领域",
|
||||||
"postSlug": "别名",
|
"postSlug": "别名",
|
||||||
"postSlugHint": "这个别名可以用于在网页通过 URL 浏览到你的帖子,它应该在同一发布者中是唯一。"
|
"postSlugHint": "这个别名可以用于在网页通过 URL 浏览到你的帖子,它应该在同一发布者中是唯一。",
|
||||||
|
"attachmentOnDevice": "离线",
|
||||||
|
"attachmentOnCloud": "在线",
|
||||||
|
"publisherCollabInvitation": "协作邀请",
|
||||||
|
"publisherCollabInvitationCount": {
|
||||||
|
"zero": "无邀请",
|
||||||
|
"one": "{} 个可用邀请",
|
||||||
|
"other": "{} 个可用邀请"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
BIN
assets/images/media-offline.png
Normal file
BIN
assets/images/media-offline.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 307 KiB |
@@ -91,6 +91,7 @@ sealed class SnChatMember with _$SnChatMember {
|
|||||||
required DateTime? breakUntil,
|
required DateTime? breakUntil,
|
||||||
required DateTime? timeoutUntil,
|
required DateTime? timeoutUntil,
|
||||||
required bool isBot,
|
required bool isBot,
|
||||||
|
required SnAccountStatus? status,
|
||||||
// Frontend data
|
// Frontend data
|
||||||
DateTime? lastTyped,
|
DateTime? lastTyped,
|
||||||
}) = _SnChatMember;
|
}) = _SnChatMember;
|
||||||
|
@@ -1037,7 +1037,7 @@ $SnChatMemberCopyWith<$Res> get sender {
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$SnChatMember {
|
mixin _$SnChatMember {
|
||||||
|
|
||||||
DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; String get id; String get chatRoomId; SnChatRoom? get chatRoom; String get accountId; SnAccount get account; String? get nick; int get role; int get notify; DateTime? get joinedAt; DateTime? get breakUntil; DateTime? get timeoutUntil; bool get isBot;// Frontend data
|
DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; String get id; String get chatRoomId; SnChatRoom? get chatRoom; String get accountId; SnAccount get account; String? get nick; int get role; int get notify; DateTime? get joinedAt; DateTime? get breakUntil; DateTime? get timeoutUntil; bool get isBot; SnAccountStatus? get status;// Frontend data
|
||||||
DateTime? get lastTyped;
|
DateTime? get lastTyped;
|
||||||
/// Create a copy of SnChatMember
|
/// Create a copy of SnChatMember
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@@ -1051,16 +1051,16 @@ $SnChatMemberCopyWith<SnChatMember> get copyWith => _$SnChatMemberCopyWithImpl<S
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnChatMember&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&(identical(other.id, id) || other.id == id)&&(identical(other.chatRoomId, chatRoomId) || other.chatRoomId == chatRoomId)&&(identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.nick, nick) || other.nick == nick)&&(identical(other.role, role) || other.role == role)&&(identical(other.notify, notify) || other.notify == notify)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt)&&(identical(other.breakUntil, breakUntil) || other.breakUntil == breakUntil)&&(identical(other.timeoutUntil, timeoutUntil) || other.timeoutUntil == timeoutUntil)&&(identical(other.isBot, isBot) || other.isBot == isBot)&&(identical(other.lastTyped, lastTyped) || other.lastTyped == lastTyped));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnChatMember&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&(identical(other.id, id) || other.id == id)&&(identical(other.chatRoomId, chatRoomId) || other.chatRoomId == chatRoomId)&&(identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.nick, nick) || other.nick == nick)&&(identical(other.role, role) || other.role == role)&&(identical(other.notify, notify) || other.notify == notify)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt)&&(identical(other.breakUntil, breakUntil) || other.breakUntil == breakUntil)&&(identical(other.timeoutUntil, timeoutUntil) || other.timeoutUntil == timeoutUntil)&&(identical(other.isBot, isBot) || other.isBot == isBot)&&(identical(other.status, status) || other.status == status)&&(identical(other.lastTyped, lastTyped) || other.lastTyped == lastTyped));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,createdAt,updatedAt,deletedAt,id,chatRoomId,chatRoom,accountId,account,nick,role,notify,joinedAt,breakUntil,timeoutUntil,isBot,lastTyped);
|
int get hashCode => Object.hash(runtimeType,createdAt,updatedAt,deletedAt,id,chatRoomId,chatRoom,accountId,account,nick,role,notify,joinedAt,breakUntil,timeoutUntil,isBot,status,lastTyped);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnChatMember(createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, id: $id, chatRoomId: $chatRoomId, chatRoom: $chatRoom, accountId: $accountId, account: $account, nick: $nick, role: $role, notify: $notify, joinedAt: $joinedAt, breakUntil: $breakUntil, timeoutUntil: $timeoutUntil, isBot: $isBot, lastTyped: $lastTyped)';
|
return 'SnChatMember(createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, id: $id, chatRoomId: $chatRoomId, chatRoom: $chatRoom, accountId: $accountId, account: $account, nick: $nick, role: $role, notify: $notify, joinedAt: $joinedAt, breakUntil: $breakUntil, timeoutUntil: $timeoutUntil, isBot: $isBot, status: $status, lastTyped: $lastTyped)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1071,11 +1071,11 @@ abstract mixin class $SnChatMemberCopyWith<$Res> {
|
|||||||
factory $SnChatMemberCopyWith(SnChatMember value, $Res Function(SnChatMember) _then) = _$SnChatMemberCopyWithImpl;
|
factory $SnChatMemberCopyWith(SnChatMember value, $Res Function(SnChatMember) _then) = _$SnChatMemberCopyWithImpl;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, DateTime? lastTyped
|
DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, SnAccountStatus? status, DateTime? lastTyped
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$SnChatRoomCopyWith<$Res>? get chatRoom;$SnAccountCopyWith<$Res> get account;
|
$SnChatRoomCopyWith<$Res>? get chatRoom;$SnAccountCopyWith<$Res> get account;$SnAccountStatusCopyWith<$Res>? get status;
|
||||||
|
|
||||||
}
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -1088,7 +1088,7 @@ class _$SnChatMemberCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnChatMember
|
/// Create a copy of SnChatMember
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@pragma('vm:prefer-inline') @override $Res call({Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? id = null,Object? chatRoomId = null,Object? chatRoom = freezed,Object? accountId = null,Object? account = null,Object? nick = freezed,Object? role = null,Object? notify = null,Object? joinedAt = freezed,Object? breakUntil = freezed,Object? timeoutUntil = freezed,Object? isBot = null,Object? lastTyped = freezed,}) {
|
@pragma('vm:prefer-inline') @override $Res call({Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? id = null,Object? chatRoomId = null,Object? chatRoom = freezed,Object? accountId = null,Object? account = null,Object? nick = freezed,Object? role = null,Object? notify = null,Object? joinedAt = freezed,Object? breakUntil = freezed,Object? timeoutUntil = freezed,Object? isBot = null,Object? status = freezed,Object? lastTyped = freezed,}) {
|
||||||
return _then(_self.copyWith(
|
return _then(_self.copyWith(
|
||||||
createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
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,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -1105,7 +1105,8 @@ as int,joinedAt: freezed == joinedAt ? _self.joinedAt : joinedAt // ignore: cast
|
|||||||
as DateTime?,breakUntil: freezed == breakUntil ? _self.breakUntil : breakUntil // ignore: cast_nullable_to_non_nullable
|
as DateTime?,breakUntil: freezed == breakUntil ? _self.breakUntil : breakUntil // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,timeoutUntil: freezed == timeoutUntil ? _self.timeoutUntil : timeoutUntil // ignore: cast_nullable_to_non_nullable
|
as DateTime?,timeoutUntil: freezed == timeoutUntil ? _self.timeoutUntil : timeoutUntil // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,isBot: null == isBot ? _self.isBot : isBot // ignore: cast_nullable_to_non_nullable
|
as DateTime?,isBot: null == isBot ? _self.isBot : isBot // ignore: cast_nullable_to_non_nullable
|
||||||
as bool,lastTyped: freezed == lastTyped ? _self.lastTyped : lastTyped // ignore: cast_nullable_to_non_nullable
|
as bool,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||||||
|
as SnAccountStatus?,lastTyped: freezed == lastTyped ? _self.lastTyped : lastTyped // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,
|
as DateTime?,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -1130,6 +1131,18 @@ $SnAccountCopyWith<$Res> get account {
|
|||||||
return $SnAccountCopyWith<$Res>(_self.account, (value) {
|
return $SnAccountCopyWith<$Res>(_self.account, (value) {
|
||||||
return _then(_self.copyWith(account: value));
|
return _then(_self.copyWith(account: value));
|
||||||
});
|
});
|
||||||
|
}/// Create a copy of SnChatMember
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$SnAccountStatusCopyWith<$Res>? get status {
|
||||||
|
if (_self.status == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $SnAccountStatusCopyWith<$Res>(_self.status!, (value) {
|
||||||
|
return _then(_self.copyWith(status: value));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1209,10 +1222,10 @@ return $default(_that);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, DateTime? lastTyped)? $default,{required TResult orElse(),}) {final _that = this;
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, SnAccountStatus? status, DateTime? lastTyped)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnChatMember() when $default != null:
|
case _SnChatMember() when $default != null:
|
||||||
return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.chatRoomId,_that.chatRoom,_that.accountId,_that.account,_that.nick,_that.role,_that.notify,_that.joinedAt,_that.breakUntil,_that.timeoutUntil,_that.isBot,_that.lastTyped);case _:
|
return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.chatRoomId,_that.chatRoom,_that.accountId,_that.account,_that.nick,_that.role,_that.notify,_that.joinedAt,_that.breakUntil,_that.timeoutUntil,_that.isBot,_that.status,_that.lastTyped);case _:
|
||||||
return orElse();
|
return orElse();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1230,10 +1243,10 @@ return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.c
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, DateTime? lastTyped) $default,) {final _that = this;
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, SnAccountStatus? status, DateTime? lastTyped) $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnChatMember():
|
case _SnChatMember():
|
||||||
return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.chatRoomId,_that.chatRoom,_that.accountId,_that.account,_that.nick,_that.role,_that.notify,_that.joinedAt,_that.breakUntil,_that.timeoutUntil,_that.isBot,_that.lastTyped);}
|
return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.chatRoomId,_that.chatRoom,_that.accountId,_that.account,_that.nick,_that.role,_that.notify,_that.joinedAt,_that.breakUntil,_that.timeoutUntil,_that.isBot,_that.status,_that.lastTyped);}
|
||||||
}
|
}
|
||||||
/// A variant of `when` that fallback to returning `null`
|
/// A variant of `when` that fallback to returning `null`
|
||||||
///
|
///
|
||||||
@@ -1247,10 +1260,10 @@ return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.c
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, DateTime? lastTyped)? $default,) {final _that = this;
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, SnAccountStatus? status, DateTime? lastTyped)? $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnChatMember() when $default != null:
|
case _SnChatMember() when $default != null:
|
||||||
return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.chatRoomId,_that.chatRoom,_that.accountId,_that.account,_that.nick,_that.role,_that.notify,_that.joinedAt,_that.breakUntil,_that.timeoutUntil,_that.isBot,_that.lastTyped);case _:
|
return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.chatRoomId,_that.chatRoom,_that.accountId,_that.account,_that.nick,_that.role,_that.notify,_that.joinedAt,_that.breakUntil,_that.timeoutUntil,_that.isBot,_that.status,_that.lastTyped);case _:
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1262,7 +1275,7 @@ return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.c
|
|||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
|
|
||||||
class _SnChatMember implements SnChatMember {
|
class _SnChatMember implements SnChatMember {
|
||||||
const _SnChatMember({required this.createdAt, required this.updatedAt, required this.deletedAt, required this.id, required this.chatRoomId, required this.chatRoom, required this.accountId, required this.account, required this.nick, required this.role, required this.notify, required this.joinedAt, required this.breakUntil, required this.timeoutUntil, required this.isBot, this.lastTyped});
|
const _SnChatMember({required this.createdAt, required this.updatedAt, required this.deletedAt, required this.id, required this.chatRoomId, required this.chatRoom, required this.accountId, required this.account, required this.nick, required this.role, required this.notify, required this.joinedAt, required this.breakUntil, required this.timeoutUntil, required this.isBot, required this.status, this.lastTyped});
|
||||||
factory _SnChatMember.fromJson(Map<String, dynamic> json) => _$SnChatMemberFromJson(json);
|
factory _SnChatMember.fromJson(Map<String, dynamic> json) => _$SnChatMemberFromJson(json);
|
||||||
|
|
||||||
@override final DateTime createdAt;
|
@override final DateTime createdAt;
|
||||||
@@ -1280,6 +1293,7 @@ class _SnChatMember implements SnChatMember {
|
|||||||
@override final DateTime? breakUntil;
|
@override final DateTime? breakUntil;
|
||||||
@override final DateTime? timeoutUntil;
|
@override final DateTime? timeoutUntil;
|
||||||
@override final bool isBot;
|
@override final bool isBot;
|
||||||
|
@override final SnAccountStatus? status;
|
||||||
// Frontend data
|
// Frontend data
|
||||||
@override final DateTime? lastTyped;
|
@override final DateTime? lastTyped;
|
||||||
|
|
||||||
@@ -1296,16 +1310,16 @@ Map<String, dynamic> toJson() {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnChatMember&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&(identical(other.id, id) || other.id == id)&&(identical(other.chatRoomId, chatRoomId) || other.chatRoomId == chatRoomId)&&(identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.nick, nick) || other.nick == nick)&&(identical(other.role, role) || other.role == role)&&(identical(other.notify, notify) || other.notify == notify)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt)&&(identical(other.breakUntil, breakUntil) || other.breakUntil == breakUntil)&&(identical(other.timeoutUntil, timeoutUntil) || other.timeoutUntil == timeoutUntil)&&(identical(other.isBot, isBot) || other.isBot == isBot)&&(identical(other.lastTyped, lastTyped) || other.lastTyped == lastTyped));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnChatMember&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&(identical(other.id, id) || other.id == id)&&(identical(other.chatRoomId, chatRoomId) || other.chatRoomId == chatRoomId)&&(identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.nick, nick) || other.nick == nick)&&(identical(other.role, role) || other.role == role)&&(identical(other.notify, notify) || other.notify == notify)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt)&&(identical(other.breakUntil, breakUntil) || other.breakUntil == breakUntil)&&(identical(other.timeoutUntil, timeoutUntil) || other.timeoutUntil == timeoutUntil)&&(identical(other.isBot, isBot) || other.isBot == isBot)&&(identical(other.status, status) || other.status == status)&&(identical(other.lastTyped, lastTyped) || other.lastTyped == lastTyped));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,createdAt,updatedAt,deletedAt,id,chatRoomId,chatRoom,accountId,account,nick,role,notify,joinedAt,breakUntil,timeoutUntil,isBot,lastTyped);
|
int get hashCode => Object.hash(runtimeType,createdAt,updatedAt,deletedAt,id,chatRoomId,chatRoom,accountId,account,nick,role,notify,joinedAt,breakUntil,timeoutUntil,isBot,status,lastTyped);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnChatMember(createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, id: $id, chatRoomId: $chatRoomId, chatRoom: $chatRoom, accountId: $accountId, account: $account, nick: $nick, role: $role, notify: $notify, joinedAt: $joinedAt, breakUntil: $breakUntil, timeoutUntil: $timeoutUntil, isBot: $isBot, lastTyped: $lastTyped)';
|
return 'SnChatMember(createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, id: $id, chatRoomId: $chatRoomId, chatRoom: $chatRoom, accountId: $accountId, account: $account, nick: $nick, role: $role, notify: $notify, joinedAt: $joinedAt, breakUntil: $breakUntil, timeoutUntil: $timeoutUntil, isBot: $isBot, status: $status, lastTyped: $lastTyped)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1316,11 +1330,11 @@ abstract mixin class _$SnChatMemberCopyWith<$Res> implements $SnChatMemberCopyWi
|
|||||||
factory _$SnChatMemberCopyWith(_SnChatMember value, $Res Function(_SnChatMember) _then) = __$SnChatMemberCopyWithImpl;
|
factory _$SnChatMemberCopyWith(_SnChatMember value, $Res Function(_SnChatMember) _then) = __$SnChatMemberCopyWithImpl;
|
||||||
@override @useResult
|
@override @useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, DateTime? lastTyped
|
DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, SnAccountStatus? status, DateTime? lastTyped
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@override $SnChatRoomCopyWith<$Res>? get chatRoom;@override $SnAccountCopyWith<$Res> get account;
|
@override $SnChatRoomCopyWith<$Res>? get chatRoom;@override $SnAccountCopyWith<$Res> get account;@override $SnAccountStatusCopyWith<$Res>? get status;
|
||||||
|
|
||||||
}
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -1333,7 +1347,7 @@ class __$SnChatMemberCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnChatMember
|
/// Create a copy of SnChatMember
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override @pragma('vm:prefer-inline') $Res call({Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? id = null,Object? chatRoomId = null,Object? chatRoom = freezed,Object? accountId = null,Object? account = null,Object? nick = freezed,Object? role = null,Object? notify = null,Object? joinedAt = freezed,Object? breakUntil = freezed,Object? timeoutUntil = freezed,Object? isBot = null,Object? lastTyped = freezed,}) {
|
@override @pragma('vm:prefer-inline') $Res call({Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? id = null,Object? chatRoomId = null,Object? chatRoom = freezed,Object? accountId = null,Object? account = null,Object? nick = freezed,Object? role = null,Object? notify = null,Object? joinedAt = freezed,Object? breakUntil = freezed,Object? timeoutUntil = freezed,Object? isBot = null,Object? status = freezed,Object? lastTyped = freezed,}) {
|
||||||
return _then(_SnChatMember(
|
return _then(_SnChatMember(
|
||||||
createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
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,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -1350,7 +1364,8 @@ as int,joinedAt: freezed == joinedAt ? _self.joinedAt : joinedAt // ignore: cast
|
|||||||
as DateTime?,breakUntil: freezed == breakUntil ? _self.breakUntil : breakUntil // ignore: cast_nullable_to_non_nullable
|
as DateTime?,breakUntil: freezed == breakUntil ? _self.breakUntil : breakUntil // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,timeoutUntil: freezed == timeoutUntil ? _self.timeoutUntil : timeoutUntil // ignore: cast_nullable_to_non_nullable
|
as DateTime?,timeoutUntil: freezed == timeoutUntil ? _self.timeoutUntil : timeoutUntil // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,isBot: null == isBot ? _self.isBot : isBot // ignore: cast_nullable_to_non_nullable
|
as DateTime?,isBot: null == isBot ? _self.isBot : isBot // ignore: cast_nullable_to_non_nullable
|
||||||
as bool,lastTyped: freezed == lastTyped ? _self.lastTyped : lastTyped // ignore: cast_nullable_to_non_nullable
|
as bool,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||||||
|
as SnAccountStatus?,lastTyped: freezed == lastTyped ? _self.lastTyped : lastTyped // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,
|
as DateTime?,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -1376,6 +1391,18 @@ $SnAccountCopyWith<$Res> get account {
|
|||||||
return $SnAccountCopyWith<$Res>(_self.account, (value) {
|
return $SnAccountCopyWith<$Res>(_self.account, (value) {
|
||||||
return _then(_self.copyWith(account: value));
|
return _then(_self.copyWith(account: value));
|
||||||
});
|
});
|
||||||
|
}/// Create a copy of SnChatMember
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$SnAccountStatusCopyWith<$Res>? get status {
|
||||||
|
if (_self.status == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $SnAccountStatusCopyWith<$Res>(_self.status!, (value) {
|
||||||
|
return _then(_self.copyWith(status: value));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -177,6 +177,12 @@ _SnChatMember _$SnChatMemberFromJson(Map<String, dynamic> json) =>
|
|||||||
? null
|
? null
|
||||||
: DateTime.parse(json['timeout_until'] as String),
|
: DateTime.parse(json['timeout_until'] as String),
|
||||||
isBot: json['is_bot'] as bool,
|
isBot: json['is_bot'] as bool,
|
||||||
|
status:
|
||||||
|
json['status'] == null
|
||||||
|
? null
|
||||||
|
: SnAccountStatus.fromJson(
|
||||||
|
json['status'] as Map<String, dynamic>,
|
||||||
|
),
|
||||||
lastTyped:
|
lastTyped:
|
||||||
json['last_typed'] == null
|
json['last_typed'] == null
|
||||||
? null
|
? null
|
||||||
@@ -200,6 +206,7 @@ Map<String, dynamic> _$SnChatMemberToJson(_SnChatMember instance) =>
|
|||||||
'break_until': instance.breakUntil?.toIso8601String(),
|
'break_until': instance.breakUntil?.toIso8601String(),
|
||||||
'timeout_until': instance.timeoutUntil?.toIso8601String(),
|
'timeout_until': instance.timeoutUntil?.toIso8601String(),
|
||||||
'is_bot': instance.isBot,
|
'is_bot': instance.isBot,
|
||||||
|
'status': instance.status?.toJson(),
|
||||||
'last_typed': instance.lastTyped?.toIso8601String(),
|
'last_typed': instance.lastTyped?.toIso8601String(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -40,6 +40,7 @@ sealed class SnRealmMember with _$SnRealmMember {
|
|||||||
required DateTime createdAt,
|
required DateTime createdAt,
|
||||||
required DateTime updatedAt,
|
required DateTime updatedAt,
|
||||||
required DateTime? deletedAt,
|
required DateTime? deletedAt,
|
||||||
|
required SnAccountStatus? status,
|
||||||
}) = _SnRealmMember;
|
}) = _SnRealmMember;
|
||||||
|
|
||||||
factory SnRealmMember.fromJson(Map<String, dynamic> json) =>
|
factory SnRealmMember.fromJson(Map<String, dynamic> json) =>
|
||||||
|
@@ -359,7 +359,7 @@ $SnCloudFileCopyWith<$Res>? get background {
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$SnRealmMember {
|
mixin _$SnRealmMember {
|
||||||
|
|
||||||
String get realmId; SnRealm? get realm; String get accountId; SnAccount? get account; int get role; DateTime? get joinedAt; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt;
|
String get realmId; SnRealm? get realm; String get accountId; SnAccount? get account; int get role; DateTime? get joinedAt; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; SnAccountStatus? get status;
|
||||||
/// Create a copy of SnRealmMember
|
/// Create a copy of SnRealmMember
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@@ -372,16 +372,16 @@ $SnRealmMemberCopyWith<SnRealmMember> get copyWith => _$SnRealmMemberCopyWithImp
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnRealmMember&&(identical(other.realmId, realmId) || other.realmId == realmId)&&(identical(other.realm, realm) || other.realm == realm)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.role, role) || other.role == role)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnRealmMember&&(identical(other.realmId, realmId) || other.realmId == realmId)&&(identical(other.realm, realm) || other.realm == realm)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.role, role) || other.role == role)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&(identical(other.status, status) || other.status == status));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,realmId,realm,accountId,account,role,joinedAt,createdAt,updatedAt,deletedAt);
|
int get hashCode => Object.hash(runtimeType,realmId,realm,accountId,account,role,joinedAt,createdAt,updatedAt,deletedAt,status);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnRealmMember(realmId: $realmId, realm: $realm, accountId: $accountId, account: $account, role: $role, joinedAt: $joinedAt, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
return 'SnRealmMember(realmId: $realmId, realm: $realm, accountId: $accountId, account: $account, role: $role, joinedAt: $joinedAt, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, status: $status)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -392,11 +392,11 @@ abstract mixin class $SnRealmMemberCopyWith<$Res> {
|
|||||||
factory $SnRealmMemberCopyWith(SnRealmMember value, $Res Function(SnRealmMember) _then) = _$SnRealmMemberCopyWithImpl;
|
factory $SnRealmMemberCopyWith(SnRealmMember value, $Res Function(SnRealmMember) _then) = _$SnRealmMemberCopyWithImpl;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String realmId, SnRealm? realm, String accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
String realmId, SnRealm? realm, String accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, SnAccountStatus? status
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$SnRealmCopyWith<$Res>? get realm;$SnAccountCopyWith<$Res>? get account;
|
$SnRealmCopyWith<$Res>? get realm;$SnAccountCopyWith<$Res>? get account;$SnAccountStatusCopyWith<$Res>? get status;
|
||||||
|
|
||||||
}
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -409,7 +409,7 @@ class _$SnRealmMemberCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnRealmMember
|
/// Create a copy of SnRealmMember
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@pragma('vm:prefer-inline') @override $Res call({Object? realmId = null,Object? realm = freezed,Object? accountId = null,Object? account = freezed,Object? role = null,Object? joinedAt = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
@pragma('vm:prefer-inline') @override $Res call({Object? realmId = null,Object? realm = freezed,Object? accountId = null,Object? account = freezed,Object? role = null,Object? joinedAt = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? status = freezed,}) {
|
||||||
return _then(_self.copyWith(
|
return _then(_self.copyWith(
|
||||||
realmId: null == realmId ? _self.realmId : realmId // ignore: cast_nullable_to_non_nullable
|
realmId: null == realmId ? _self.realmId : realmId // ignore: cast_nullable_to_non_nullable
|
||||||
as String,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable
|
as String,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -420,7 +420,8 @@ as int,joinedAt: freezed == joinedAt ? _self.joinedAt : joinedAt // ignore: cast
|
|||||||
as DateTime?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
as DateTime?,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,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,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,
|
as DateTime?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||||||
|
as SnAccountStatus?,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
/// Create a copy of SnRealmMember
|
/// Create a copy of SnRealmMember
|
||||||
@@ -447,6 +448,18 @@ $SnAccountCopyWith<$Res>? get account {
|
|||||||
return $SnAccountCopyWith<$Res>(_self.account!, (value) {
|
return $SnAccountCopyWith<$Res>(_self.account!, (value) {
|
||||||
return _then(_self.copyWith(account: value));
|
return _then(_self.copyWith(account: value));
|
||||||
});
|
});
|
||||||
|
}/// Create a copy of SnRealmMember
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$SnAccountStatusCopyWith<$Res>? get status {
|
||||||
|
if (_self.status == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $SnAccountStatusCopyWith<$Res>(_self.status!, (value) {
|
||||||
|
return _then(_self.copyWith(status: value));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,10 +539,10 @@ return $default(_that);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String realmId, SnRealm? realm, String accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String realmId, SnRealm? realm, String accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, SnAccountStatus? status)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnRealmMember() when $default != null:
|
case _SnRealmMember() when $default != null:
|
||||||
return $default(_that.realmId,_that.realm,_that.accountId,_that.account,_that.role,_that.joinedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
return $default(_that.realmId,_that.realm,_that.accountId,_that.account,_that.role,_that.joinedAt,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.status);case _:
|
||||||
return orElse();
|
return orElse();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -547,10 +560,10 @@ return $default(_that.realmId,_that.realm,_that.accountId,_that.account,_that.ro
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String realmId, SnRealm? realm, String accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt) $default,) {final _that = this;
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String realmId, SnRealm? realm, String accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, SnAccountStatus? status) $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnRealmMember():
|
case _SnRealmMember():
|
||||||
return $default(_that.realmId,_that.realm,_that.accountId,_that.account,_that.role,_that.joinedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);}
|
return $default(_that.realmId,_that.realm,_that.accountId,_that.account,_that.role,_that.joinedAt,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.status);}
|
||||||
}
|
}
|
||||||
/// A variant of `when` that fallback to returning `null`
|
/// A variant of `when` that fallback to returning `null`
|
||||||
///
|
///
|
||||||
@@ -564,10 +577,10 @@ return $default(_that.realmId,_that.realm,_that.accountId,_that.account,_that.ro
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String realmId, SnRealm? realm, String accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,) {final _that = this;
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String realmId, SnRealm? realm, String accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, SnAccountStatus? status)? $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnRealmMember() when $default != null:
|
case _SnRealmMember() when $default != null:
|
||||||
return $default(_that.realmId,_that.realm,_that.accountId,_that.account,_that.role,_that.joinedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
return $default(_that.realmId,_that.realm,_that.accountId,_that.account,_that.role,_that.joinedAt,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.status);case _:
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -579,7 +592,7 @@ return $default(_that.realmId,_that.realm,_that.accountId,_that.account,_that.ro
|
|||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
|
|
||||||
class _SnRealmMember implements SnRealmMember {
|
class _SnRealmMember implements SnRealmMember {
|
||||||
const _SnRealmMember({required this.realmId, required this.realm, required this.accountId, required this.account, required this.role, required this.joinedAt, required this.createdAt, required this.updatedAt, required this.deletedAt});
|
const _SnRealmMember({required this.realmId, required this.realm, required this.accountId, required this.account, required this.role, required this.joinedAt, required this.createdAt, required this.updatedAt, required this.deletedAt, required this.status});
|
||||||
factory _SnRealmMember.fromJson(Map<String, dynamic> json) => _$SnRealmMemberFromJson(json);
|
factory _SnRealmMember.fromJson(Map<String, dynamic> json) => _$SnRealmMemberFromJson(json);
|
||||||
|
|
||||||
@override final String realmId;
|
@override final String realmId;
|
||||||
@@ -591,6 +604,7 @@ class _SnRealmMember implements SnRealmMember {
|
|||||||
@override final DateTime createdAt;
|
@override final DateTime createdAt;
|
||||||
@override final DateTime updatedAt;
|
@override final DateTime updatedAt;
|
||||||
@override final DateTime? deletedAt;
|
@override final DateTime? deletedAt;
|
||||||
|
@override final SnAccountStatus? status;
|
||||||
|
|
||||||
/// Create a copy of SnRealmMember
|
/// Create a copy of SnRealmMember
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@@ -605,16 +619,16 @@ Map<String, dynamic> toJson() {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnRealmMember&&(identical(other.realmId, realmId) || other.realmId == realmId)&&(identical(other.realm, realm) || other.realm == realm)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.role, role) || other.role == role)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnRealmMember&&(identical(other.realmId, realmId) || other.realmId == realmId)&&(identical(other.realm, realm) || other.realm == realm)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.role, role) || other.role == role)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&(identical(other.status, status) || other.status == status));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,realmId,realm,accountId,account,role,joinedAt,createdAt,updatedAt,deletedAt);
|
int get hashCode => Object.hash(runtimeType,realmId,realm,accountId,account,role,joinedAt,createdAt,updatedAt,deletedAt,status);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnRealmMember(realmId: $realmId, realm: $realm, accountId: $accountId, account: $account, role: $role, joinedAt: $joinedAt, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
return 'SnRealmMember(realmId: $realmId, realm: $realm, accountId: $accountId, account: $account, role: $role, joinedAt: $joinedAt, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, status: $status)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -625,11 +639,11 @@ abstract mixin class _$SnRealmMemberCopyWith<$Res> implements $SnRealmMemberCopy
|
|||||||
factory _$SnRealmMemberCopyWith(_SnRealmMember value, $Res Function(_SnRealmMember) _then) = __$SnRealmMemberCopyWithImpl;
|
factory _$SnRealmMemberCopyWith(_SnRealmMember value, $Res Function(_SnRealmMember) _then) = __$SnRealmMemberCopyWithImpl;
|
||||||
@override @useResult
|
@override @useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String realmId, SnRealm? realm, String accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
String realmId, SnRealm? realm, String accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, SnAccountStatus? status
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@override $SnRealmCopyWith<$Res>? get realm;@override $SnAccountCopyWith<$Res>? get account;
|
@override $SnRealmCopyWith<$Res>? get realm;@override $SnAccountCopyWith<$Res>? get account;@override $SnAccountStatusCopyWith<$Res>? get status;
|
||||||
|
|
||||||
}
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -642,7 +656,7 @@ class __$SnRealmMemberCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnRealmMember
|
/// Create a copy of SnRealmMember
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override @pragma('vm:prefer-inline') $Res call({Object? realmId = null,Object? realm = freezed,Object? accountId = null,Object? account = freezed,Object? role = null,Object? joinedAt = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
@override @pragma('vm:prefer-inline') $Res call({Object? realmId = null,Object? realm = freezed,Object? accountId = null,Object? account = freezed,Object? role = null,Object? joinedAt = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? status = freezed,}) {
|
||||||
return _then(_SnRealmMember(
|
return _then(_SnRealmMember(
|
||||||
realmId: null == realmId ? _self.realmId : realmId // ignore: cast_nullable_to_non_nullable
|
realmId: null == realmId ? _self.realmId : realmId // ignore: cast_nullable_to_non_nullable
|
||||||
as String,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable
|
as String,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -653,7 +667,8 @@ as int,joinedAt: freezed == joinedAt ? _self.joinedAt : joinedAt // ignore: cast
|
|||||||
as DateTime?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
as DateTime?,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,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,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,
|
as DateTime?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||||||
|
as SnAccountStatus?,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -681,6 +696,18 @@ $SnAccountCopyWith<$Res>? get account {
|
|||||||
return $SnAccountCopyWith<$Res>(_self.account!, (value) {
|
return $SnAccountCopyWith<$Res>(_self.account!, (value) {
|
||||||
return _then(_self.copyWith(account: value));
|
return _then(_self.copyWith(account: value));
|
||||||
});
|
});
|
||||||
|
}/// Create a copy of SnRealmMember
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$SnAccountStatusCopyWith<$Res>? get status {
|
||||||
|
if (_self.status == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $SnAccountStatusCopyWith<$Res>(_self.status!, (value) {
|
||||||
|
return _then(_self.copyWith(status: value));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -75,6 +75,12 @@ _SnRealmMember _$SnRealmMemberFromJson(Map<String, dynamic> json) =>
|
|||||||
json['deleted_at'] == null
|
json['deleted_at'] == null
|
||||||
? null
|
? null
|
||||||
: DateTime.parse(json['deleted_at'] as String),
|
: DateTime.parse(json['deleted_at'] as String),
|
||||||
|
status:
|
||||||
|
json['status'] == null
|
||||||
|
? null
|
||||||
|
: SnAccountStatus.fromJson(
|
||||||
|
json['status'] as Map<String, dynamic>,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$SnRealmMemberToJson(_SnRealmMember instance) =>
|
Map<String, dynamic> _$SnRealmMemberToJson(_SnRealmMember instance) =>
|
||||||
@@ -88,4 +94,5 @@ Map<String, dynamic> _$SnRealmMemberToJson(_SnRealmMember instance) =>
|
|||||||
'created_at': instance.createdAt.toIso8601String(),
|
'created_at': instance.createdAt.toIso8601String(),
|
||||||
'updated_at': instance.updatedAt.toIso8601String(),
|
'updated_at': instance.updatedAt.toIso8601String(),
|
||||||
'deleted_at': instance.deletedAt?.toIso8601String(),
|
'deleted_at': instance.deletedAt?.toIso8601String(),
|
||||||
|
'status': instance.status?.toJson(),
|
||||||
};
|
};
|
||||||
|
@@ -80,10 +80,12 @@ class ChatRoomListTile extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
|
spacing: 4,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Badge(
|
||||||
'${data.lastMessage.sender.account.name}: ',
|
label: Text(data.lastMessage.sender.account.nick),
|
||||||
style: Theme.of(context).textTheme.bodySmall,
|
textColor: Theme.of(context).colorScheme.onPrimary,
|
||||||
|
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@@ -453,14 +453,23 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
await _database.deleteMessage(localMessage.id);
|
await _database.deleteMessage(localMessage.id);
|
||||||
await _database.saveMessage(_database.messageToCompanion(updatedMessage));
|
await _database.saveMessage(_database.messageToCompanion(updatedMessage));
|
||||||
|
|
||||||
|
final currentMessages = state.value ?? [];
|
||||||
|
if (editingTo != null) {
|
||||||
|
final newMessages = currentMessages
|
||||||
|
.where((m) => m.id != localMessage.id) // remove pending message
|
||||||
|
.map((m) => m.id == editingTo.id ? updatedMessage : m) // update original message
|
||||||
|
.toList();
|
||||||
|
state = AsyncValue.data(newMessages);
|
||||||
|
} else {
|
||||||
final newMessages =
|
final newMessages =
|
||||||
(state.value ?? []).map((m) {
|
currentMessages.map((m) {
|
||||||
if (m.id == localMessage.id) {
|
if (m.id == localMessage.id) {
|
||||||
return updatedMessage;
|
return updatedMessage;
|
||||||
}
|
}
|
||||||
return m;
|
return m;
|
||||||
}).toList();
|
}).toList();
|
||||||
state = AsyncValue.data(newMessages);
|
state = AsyncValue.data(newMessages);
|
||||||
|
}
|
||||||
developer.log(
|
developer.log(
|
||||||
'Message with nonce $nonce sent successfully',
|
'Message with nonce $nonce sent successfully',
|
||||||
name: 'MessagesNotifier',
|
name: 'MessagesNotifier',
|
||||||
@@ -627,14 +636,37 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
name: 'MessagesNotifier',
|
name: 'MessagesNotifier',
|
||||||
);
|
);
|
||||||
_pendingMessages.remove(messageId);
|
_pendingMessages.remove(messageId);
|
||||||
await _database.deleteMessage(messageId);
|
|
||||||
|
|
||||||
final currentMessages = state.value ?? [];
|
final currentMessages = state.value ?? [];
|
||||||
final filteredMessages =
|
final messageIndex = currentMessages.indexWhere((m) => m.id == messageId);
|
||||||
currentMessages.where((m) => m.id != messageId).toList();
|
|
||||||
|
|
||||||
if (filteredMessages.length != currentMessages.length) {
|
LocalChatMessage? messageToUpdate;
|
||||||
state = AsyncValue.data(filteredMessages);
|
if (messageIndex != -1) {
|
||||||
|
messageToUpdate = currentMessages[messageIndex];
|
||||||
|
} else {
|
||||||
|
messageToUpdate = await fetchMessageById(messageId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (messageToUpdate == null) return;
|
||||||
|
|
||||||
|
final remote = messageToUpdate.toRemoteMessage();
|
||||||
|
final updatedRemote = remote.copyWith(
|
||||||
|
content: 'This message was deleted',
|
||||||
|
type: 'deleted',
|
||||||
|
attachments: [],
|
||||||
|
);
|
||||||
|
|
||||||
|
final deletedMessage = LocalChatMessage.fromRemoteMessage(
|
||||||
|
updatedRemote,
|
||||||
|
messageToUpdate.status,
|
||||||
|
);
|
||||||
|
|
||||||
|
await _database.saveMessage(_database.messageToCompanion(deletedMessage));
|
||||||
|
|
||||||
|
if (messageIndex != -1) {
|
||||||
|
final newList = [...currentMessages];
|
||||||
|
newList[messageIndex] = deletedMessage;
|
||||||
|
state = AsyncValue.data(newList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1087,7 +1119,6 @@ class ChatRoomScreen extends HookConsumerWidget {
|
|||||||
skipError: true,
|
skipError: true,
|
||||||
data:
|
data:
|
||||||
(identity) => MessageItem(
|
(identity) => MessageItem(
|
||||||
key: ValueKey(message.id),
|
|
||||||
message: message,
|
message: message,
|
||||||
isCurrentUser: identity?.id == message.senderId,
|
isCurrentUser: identity?.id == message.senderId,
|
||||||
onAction: (action) {
|
onAction: (action) {
|
||||||
|
@@ -6,7 +6,7 @@ part of 'room.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$messagesNotifierHash() => r'3740c02ab1e4dba9c8e619b63c40e2236a89b342';
|
String _$messagesNotifierHash() => r'32afe6ea24086d869cc47bd3389c8fd734409ca0';
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
/// Copied from Dart SDK
|
||||||
class _SystemHash {
|
class _SystemHash {
|
||||||
|
@@ -10,6 +10,7 @@ import 'package:island/models/chat.dart';
|
|||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
import 'package:island/screens/chat/chat.dart';
|
import 'package:island/screens/chat/chat.dart';
|
||||||
import 'package:island/widgets/account/account_picker.dart';
|
import 'package:island/widgets/account/account_picker.dart';
|
||||||
|
import 'package:island/widgets/account/status.dart';
|
||||||
import 'package:island/widgets/alert.dart';
|
import 'package:island/widgets/alert.dart';
|
||||||
import 'package:island/widgets/app_scaffold.dart';
|
import 'package:island/widgets/app_scaffold.dart';
|
||||||
import 'package:island/widgets/content/cloud_files.dart';
|
import 'package:island/widgets/content/cloud_files.dart';
|
||||||
@@ -544,7 +545,7 @@ class ChatMemberListNotifier extends _$ChatMemberListNotifier
|
|||||||
final apiClient = ref.watch(apiClientProvider);
|
final apiClient = ref.watch(apiClientProvider);
|
||||||
final response = await apiClient.get(
|
final response = await apiClient.get(
|
||||||
'/sphere/chat/$roomId/members',
|
'/sphere/chat/$roomId/members',
|
||||||
queryParameters: {'offset': offset, 'take': take},
|
queryParameters: {'offset': offset, 'take': take, 'withStatus': true},
|
||||||
);
|
);
|
||||||
|
|
||||||
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
||||||
@@ -672,6 +673,8 @@ class _ChatMemberListSheet extends HookConsumerWidget {
|
|||||||
spacing: 6,
|
spacing: 6,
|
||||||
children: [
|
children: [
|
||||||
Flexible(child: Text(member.account.nick)),
|
Flexible(child: Text(member.account.nick)),
|
||||||
|
if (member.status != null)
|
||||||
|
AccountStatusLabel(status: member.status!),
|
||||||
if (member.joinedAt == null)
|
if (member.joinedAt == null)
|
||||||
const Icon(Symbols.pending_actions, size: 20),
|
const Icon(Symbols.pending_actions, size: 20),
|
||||||
],
|
],
|
||||||
|
@@ -212,30 +212,6 @@ class CreatorHubScreen extends HookConsumerWidget {
|
|||||||
leading: !isWide ? const PageBackButton() : null,
|
leading: !isWide ? const PageBackButton() : null,
|
||||||
title: Text('creatorHub').tr(),
|
title: Text('creatorHub').tr(),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
|
||||||
icon: Badge(
|
|
||||||
label: Text(
|
|
||||||
publisherInvites.when(
|
|
||||||
data: (invites) => invites.length.toString(),
|
|
||||||
error: (_, _) => '0',
|
|
||||||
loading: () => '0',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
isLabelVisible: publisherInvites.when(
|
|
||||||
data: (invites) => invites.isNotEmpty,
|
|
||||||
error: (_, _) => false,
|
|
||||||
loading: () => false,
|
|
||||||
),
|
|
||||||
child: const Icon(Symbols.email),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
showModalBottomSheet(
|
|
||||||
context: context,
|
|
||||||
isScrollControlled: true,
|
|
||||||
builder: (_) => const _PublisherInviteSheet(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
DropdownButtonHideUnderline(
|
DropdownButtonHideUnderline(
|
||||||
child: DropdownButton2<SnPublisher>(
|
child: DropdownButton2<SnPublisher>(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
@@ -323,6 +299,23 @@ class CreatorHubScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
) ??
|
) ??
|
||||||
[]),
|
[]),
|
||||||
|
ListTile(
|
||||||
|
leading: const CircleAvatar(
|
||||||
|
child: Icon(Symbols.mail),
|
||||||
|
),
|
||||||
|
title: Text('publisherCollabInvitation').tr(),
|
||||||
|
subtitle: Text(
|
||||||
|
'publisherCollabInvitationCount',
|
||||||
|
).plural(publisherInvites.value?.length ?? 0),
|
||||||
|
trailing: const Icon(Symbols.chevron_right),
|
||||||
|
onTap: () {
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
builder: (_) => const _PublisherInviteSheet(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const CircleAvatar(
|
leading: const CircleAvatar(
|
||||||
child: Icon(Symbols.add),
|
child: Icon(Symbols.add),
|
||||||
|
@@ -89,6 +89,9 @@ class ArticleComposeScreen extends HookConsumerWidget {
|
|||||||
}, [state]);
|
}, [state]);
|
||||||
|
|
||||||
final showPreview = useState(false);
|
final showPreview = useState(false);
|
||||||
|
final isAttachmentsExpanded = useState(
|
||||||
|
true,
|
||||||
|
); // New state for attachments section
|
||||||
|
|
||||||
// Initialize publisher once when data is available
|
// Initialize publisher once when data is available
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
@@ -297,16 +300,35 @@ class ArticleComposeScreen extends HookConsumerWidget {
|
|||||||
valueListenable: state.attachments,
|
valueListenable: state.attachments,
|
||||||
builder: (context, attachments, _) {
|
builder: (context, attachments, _) {
|
||||||
if (attachments.isEmpty) return const SizedBox.shrink();
|
if (attachments.isEmpty) return const SizedBox.shrink();
|
||||||
return Column(
|
return Theme(
|
||||||
|
data: Theme.of(
|
||||||
|
context,
|
||||||
|
).copyWith(dividerColor: Colors.transparent),
|
||||||
|
child: ExpansionTile(
|
||||||
|
initiallyExpanded: isAttachmentsExpanded.value,
|
||||||
|
onExpansionChanged: (expanded) {
|
||||||
|
isAttachmentsExpanded.value = expanded;
|
||||||
|
},
|
||||||
|
collapsedBackgroundColor:
|
||||||
|
Theme.of(context).colorScheme.surfaceContainer,
|
||||||
|
title: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Gap(16),
|
Text('attachments').tr(),
|
||||||
Text(
|
Text(
|
||||||
'articleAttachmentHint'.tr(),
|
'articleAttachmentHint'.tr(),
|
||||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
style: Theme.of(
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
context,
|
||||||
|
).textTheme.bodySmall?.copyWith(
|
||||||
|
color:
|
||||||
|
Theme.of(
|
||||||
|
context,
|
||||||
|
).colorScheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
).padding(bottom: 8),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
children: [
|
||||||
ValueListenableBuilder<Map<int, double>>(
|
ValueListenableBuilder<Map<int, double>>(
|
||||||
valueListenable: state.attachmentProgress,
|
valueListenable: state.attachmentProgress,
|
||||||
builder: (context, progressMap, _) {
|
builder: (context, progressMap, _) {
|
||||||
@@ -314,11 +336,16 @@ class ArticleComposeScreen extends HookConsumerWidget {
|
|||||||
runSpacing: 8,
|
runSpacing: 8,
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
children: [
|
children: [
|
||||||
for (var idx = 0; idx < attachments.length; idx++)
|
for (
|
||||||
|
var idx = 0;
|
||||||
|
idx < attachments.length;
|
||||||
|
idx++
|
||||||
|
)
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 280,
|
width: 180,
|
||||||
height: 280,
|
height: 180,
|
||||||
child: AttachmentPreview(
|
child: AttachmentPreview(
|
||||||
|
isCompact: true,
|
||||||
item: attachments[idx],
|
item: attachments[idx],
|
||||||
progress: progressMap[idx],
|
progress: progressMap[idx],
|
||||||
onRequestUpload:
|
onRequestUpload:
|
||||||
@@ -340,15 +367,6 @@ class ArticleComposeScreen extends HookConsumerWidget {
|
|||||||
state,
|
state,
|
||||||
idx,
|
idx,
|
||||||
),
|
),
|
||||||
onMove: (delta) {
|
|
||||||
state
|
|
||||||
.attachments
|
|
||||||
.value = ComposeLogic.moveAttachment(
|
|
||||||
state.attachments.value,
|
|
||||||
idx,
|
|
||||||
delta,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
onInsert:
|
onInsert:
|
||||||
() => ComposeLogic.insertAttachment(
|
() => ComposeLogic.insertAttachment(
|
||||||
ref,
|
ref,
|
||||||
@@ -361,7 +379,9 @@ class ArticleComposeScreen extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
Gap(16),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@@ -4,6 +4,9 @@ import 'package:island/screens/chat/chat.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:island/models/chat.dart';
|
import 'package:island/models/chat.dart';
|
||||||
import 'package:island/services/color.dart';
|
import 'package:island/services/color.dart';
|
||||||
|
import 'package:island/services/responsive.dart';
|
||||||
|
import 'package:island/widgets/account/status.dart';
|
||||||
|
import 'package:island/widgets/post/post_list.dart';
|
||||||
import 'package:palette_generator/palette_generator.dart';
|
import 'package:palette_generator/palette_generator.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
@@ -78,39 +81,131 @@ class RealmDetailScreen extends HookConsumerWidget {
|
|||||||
offset: Offset(1.0, 1.0),
|
offset: Offset(1.0, 1.0),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
final realmIdentity = ref.watch(realmIdentityProvider(slug));
|
||||||
|
final realmChatRooms = ref.watch(realmChatRoomsProvider(slug));
|
||||||
|
|
||||||
|
Widget realmDescriptionWidget(SnRealm realm) => Card(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
|
child: Theme(
|
||||||
|
data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
|
||||||
|
child: ExpansionTile(
|
||||||
|
shape: const RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||||
|
),
|
||||||
|
collapsedShape: const RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||||
|
),
|
||||||
|
title: const Text('description').tr(),
|
||||||
|
initiallyExpanded:
|
||||||
|
realmIdentity.hasValue && realmIdentity.value == null,
|
||||||
|
tilePadding: EdgeInsets.only(left: 24, right: 20),
|
||||||
|
expandedCrossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
realm.description,
|
||||||
|
style: const TextStyle(fontSize: 16),
|
||||||
|
).padding(horizontal: 20, bottom: 16, top: 8),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
Widget realmActionWidget(SnRealm realm) => Card(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
|
child: FilledButton.tonalIcon(
|
||||||
|
onPressed: () async {
|
||||||
|
try {
|
||||||
|
final apiClient = ref.read(apiClientProvider);
|
||||||
|
await apiClient.post('/sphere/realms/$slug/members/me');
|
||||||
|
ref.invalidate(realmIdentityProvider(slug));
|
||||||
|
ref.invalidate(realmsJoinedProvider);
|
||||||
|
showSnackBar('realmJoinSuccess'.tr());
|
||||||
|
} catch (err) {
|
||||||
|
showErrorAlert(err);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
icon: const Icon(Symbols.add),
|
||||||
|
label: const Text('realmJoin').tr(),
|
||||||
|
).padding(all: 16),
|
||||||
|
);
|
||||||
|
|
||||||
|
Widget realmChatRoomListWidget(SnRealm realm) => Card(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'chatTabGroup',
|
||||||
|
).tr().bold().padding(horizontal: 24, top: 12, bottom: 4),
|
||||||
|
realmChatRooms.when(
|
||||||
|
loading: () => Center(child: CircularProgressIndicator()),
|
||||||
|
error: (error, _) => Center(child: Text('Error: $error')),
|
||||||
|
data: (rooms) {
|
||||||
|
if (rooms.isEmpty) {
|
||||||
|
return const SliverToBoxAdapter(child: SizedBox.shrink());
|
||||||
|
}
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
for (final room in rooms)
|
||||||
|
ChatRoomListTile(
|
||||||
|
room: room,
|
||||||
|
onTap: () {
|
||||||
|
context.pushNamed(
|
||||||
|
'chatRoom',
|
||||||
|
pathParameters: {'id': room.id},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
return AppScaffold(
|
return AppScaffold(
|
||||||
isNoBackground: false,
|
isNoBackground: false,
|
||||||
body: realmState.when(
|
appBar:
|
||||||
loading: () => const Center(child: CircularProgressIndicator()),
|
isWideScreen(context)
|
||||||
error: (error, _) => Center(child: Text('Error: $error')),
|
? realmState.when(
|
||||||
data:
|
data:
|
||||||
(realm) => CustomScrollView(
|
(realm) => AppBar(
|
||||||
slivers: [
|
|
||||||
SliverAppBar(
|
|
||||||
expandedHeight: 180,
|
|
||||||
pinned: true,
|
|
||||||
foregroundColor: appbarColor.value,
|
foregroundColor: appbarColor.value,
|
||||||
leading: PageBackButton(
|
leading: PageBackButton(
|
||||||
color: appbarColor.value,
|
color: appbarColor.value,
|
||||||
shadows: [iconShadow],
|
shadows: [iconShadow],
|
||||||
),
|
),
|
||||||
flexibleSpace: FlexibleSpaceBar(
|
flexibleSpace: Stack(
|
||||||
background:
|
children: [
|
||||||
|
Positioned.fill(
|
||||||
|
child:
|
||||||
realm!.background?.id != null
|
realm!.background?.id != null
|
||||||
? CloudImageWidget(fileId: realm.background!.id)
|
? CloudImageWidget(
|
||||||
|
fileId: realm.background!.id,
|
||||||
|
)
|
||||||
: Container(
|
: Container(
|
||||||
color:
|
color:
|
||||||
Theme.of(context).appBarTheme.backgroundColor,
|
Theme.of(
|
||||||
|
context,
|
||||||
|
).appBarTheme.backgroundColor,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
FlexibleSpaceBar(
|
||||||
title: Text(
|
title: Text(
|
||||||
realm.name,
|
realm.name,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color:
|
color:
|
||||||
appbarColor.value ??
|
appbarColor.value ??
|
||||||
Theme.of(context).appBarTheme.foregroundColor,
|
Theme.of(
|
||||||
|
context,
|
||||||
|
).appBarTheme.foregroundColor,
|
||||||
shadows: [iconShadow],
|
shadows: [iconShadow],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
background: Container(),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
@@ -125,106 +220,144 @@ class RealmDetailScreen extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
_RealmActionMenu(realmSlug: slug, iconShadow: iconShadow),
|
_RealmActionMenu(
|
||||||
|
realmSlug: slug,
|
||||||
|
iconShadow: iconShadow,
|
||||||
|
),
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SliverToBoxAdapter(
|
error: (_, _) => AppBar(leading: PageBackButton()),
|
||||||
child: ref
|
loading: () => AppBar(leading: PageBackButton()),
|
||||||
.watch(realmIdentityProvider(slug))
|
)
|
||||||
.when(
|
: null,
|
||||||
|
body: realmState.when(
|
||||||
|
loading: () => const Center(child: CircularProgressIndicator()),
|
||||||
|
error: (error, _) => Center(child: Text('Error: $error')),
|
||||||
|
data:
|
||||||
|
(realm) =>
|
||||||
|
isWideScreen(context)
|
||||||
|
? Row(
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
flex: 3,
|
||||||
|
child: CustomScrollView(
|
||||||
|
slivers: [SliverPostList(realm: slug)],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
flex: 2,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
realmIdentity.when(
|
||||||
loading: () => const SizedBox.shrink(),
|
loading: () => const SizedBox.shrink(),
|
||||||
error: (_, _) => const SizedBox.shrink(),
|
error: (_, _) => const SizedBox.shrink(),
|
||||||
data:
|
data:
|
||||||
(identity) => Column(
|
(identity) => Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment:
|
||||||
children: [
|
|
||||||
ExpansionTile(
|
|
||||||
title: const Text('description').tr(),
|
|
||||||
initiallyExpanded: identity == null,
|
|
||||||
tilePadding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 20,
|
|
||||||
),
|
|
||||||
expandedCrossAxisAlignment:
|
|
||||||
CrossAxisAlignment.stretch,
|
CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
realmDescriptionWidget(realm!),
|
||||||
realm.description,
|
if (identity == null &&
|
||||||
style: const TextStyle(fontSize: 16),
|
realm.isCommunity)
|
||||||
).padding(
|
realmActionWidget(realm)
|
||||||
horizontal: 20,
|
else
|
||||||
bottom: 16,
|
const SizedBox.shrink(),
|
||||||
top: 8,
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
realmChatRoomListWidget(realm!),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).padding(horizontal: 8, top: 8)
|
||||||
|
: CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
SliverAppBar(
|
||||||
|
expandedHeight: 180,
|
||||||
|
pinned: true,
|
||||||
|
foregroundColor: appbarColor.value,
|
||||||
|
leading: PageBackButton(
|
||||||
|
color: appbarColor.value,
|
||||||
|
shadows: [iconShadow],
|
||||||
|
),
|
||||||
|
flexibleSpace: Stack(
|
||||||
|
children: [
|
||||||
|
Positioned.fill(
|
||||||
|
child:
|
||||||
|
realm!.background?.id != null
|
||||||
|
? CloudImageWidget(
|
||||||
|
fileId: realm.background!.id,
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
color:
|
||||||
|
Theme.of(
|
||||||
|
context,
|
||||||
|
).appBarTheme.backgroundColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
FlexibleSpaceBar(
|
||||||
|
title: Text(
|
||||||
|
realm.name,
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
appbarColor.value ??
|
||||||
|
Theme.of(
|
||||||
|
context,
|
||||||
|
).appBarTheme.foregroundColor,
|
||||||
|
shadows: [iconShadow],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
background:
|
||||||
|
Container(), // Empty container since background is handled by Stack
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (identity == null && realm.isCommunity)
|
actions: [
|
||||||
FilledButton.tonalIcon(
|
IconButton(
|
||||||
onPressed: () async {
|
icon: Icon(Icons.people, shadows: [iconShadow]),
|
||||||
try {
|
onPressed: () {
|
||||||
final apiClient = ref.read(
|
showModalBottomSheet(
|
||||||
apiClientProvider,
|
isScrollControlled: true,
|
||||||
|
context: context,
|
||||||
|
builder:
|
||||||
|
(context) => _RealmMemberListSheet(
|
||||||
|
realmSlug: slug,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
await apiClient.post(
|
|
||||||
'/sphere/realms/$slug/members/me',
|
|
||||||
);
|
|
||||||
ref.invalidate(
|
|
||||||
realmIdentityProvider(slug),
|
|
||||||
);
|
|
||||||
ref.invalidate(realmsJoinedProvider);
|
|
||||||
showSnackBar('realmJoinSuccess'.tr());
|
|
||||||
} catch (err) {
|
|
||||||
showErrorAlert(err);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
icon: const Icon(Symbols.add),
|
),
|
||||||
label: const Text('realmJoin').tr(),
|
_RealmActionMenu(
|
||||||
).padding(horizontal: 16, vertical: 16)
|
realmSlug: slug,
|
||||||
|
iconShadow: iconShadow,
|
||||||
|
),
|
||||||
|
const Gap(8),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SliverGap(4),
|
||||||
|
SliverToBoxAdapter(
|
||||||
|
child: realmIdentity.when(
|
||||||
|
loading: () => const SizedBox.shrink(),
|
||||||
|
error: (_, _) => const SizedBox.shrink(),
|
||||||
|
data:
|
||||||
|
(identity) => Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
realmDescriptionWidget(realm),
|
||||||
|
if (identity == null && realm.isCommunity)
|
||||||
|
realmActionWidget(realm)
|
||||||
else
|
else
|
||||||
const SizedBox.shrink(),
|
const SizedBox.shrink(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SliverToBoxAdapter(child: Divider(height: 1)),
|
SliverToBoxAdapter(
|
||||||
Consumer(
|
child: realmChatRoomListWidget(realm),
|
||||||
builder: (context, ref, _) {
|
|
||||||
final chatRooms = ref.watch(realmChatRoomsProvider(slug));
|
|
||||||
return chatRooms.when(
|
|
||||||
loading:
|
|
||||||
() => const SliverToBoxAdapter(
|
|
||||||
child: Center(child: CircularProgressIndicator()),
|
|
||||||
),
|
|
||||||
error:
|
|
||||||
(error, _) => SliverToBoxAdapter(
|
|
||||||
child: Center(child: Text('Error: $error')),
|
|
||||||
),
|
|
||||||
data: (rooms) {
|
|
||||||
if (rooms.isEmpty) {
|
|
||||||
return const SliverToBoxAdapter(
|
|
||||||
child: SizedBox.shrink(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return SliverList(
|
|
||||||
delegate: SliverChildBuilderDelegate((
|
|
||||||
context,
|
|
||||||
index,
|
|
||||||
) {
|
|
||||||
return ChatRoomListTile(
|
|
||||||
room: rooms[index],
|
|
||||||
onTap: () {
|
|
||||||
context.pushNamed(
|
|
||||||
'chatRoom',
|
|
||||||
pathParameters: {'id': rooms[index].id},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}, childCount: rooms.length),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
|
SliverPostList(realm: slug),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -398,7 +531,11 @@ class RealmMemberListNotifier extends _$RealmMemberListNotifier
|
|||||||
|
|
||||||
final response = await apiClient.get(
|
final response = await apiClient.get(
|
||||||
'/sphere/realms/$realmSlug/members',
|
'/sphere/realms/$realmSlug/members',
|
||||||
queryParameters: {'offset': offset, 'take': _pageSize},
|
queryParameters: {
|
||||||
|
'offset': offset,
|
||||||
|
'take': _pageSize,
|
||||||
|
'withStatus': true,
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
||||||
@@ -441,7 +578,7 @@ class RealmMemberNotifier extends StateNotifier<RealmMemberState> {
|
|||||||
try {
|
try {
|
||||||
final response = await _apiClient.get(
|
final response = await _apiClient.get(
|
||||||
'/sphere/realms/$realmSlug/members',
|
'/sphere/realms/$realmSlug/members',
|
||||||
queryParameters: {'offset': offset, 'take': take},
|
queryParameters: {'offset': offset, 'take': take, 'withStatus': true},
|
||||||
);
|
);
|
||||||
|
|
||||||
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
||||||
@@ -508,13 +645,8 @@ class _RealmMemberListSheet extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
Widget buildMemberListHeader() {
|
||||||
constraints: BoxConstraints(
|
return Padding(
|
||||||
maxHeight: MediaQuery.of(context).size.height * 0.8,
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(top: 16, left: 20, right: 16, bottom: 12),
|
padding: EdgeInsets.only(top: 16, left: 20, right: 16, bottom: 12),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -547,9 +679,11 @@ class _RealmMemberListSheet extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
const Divider(height: 1),
|
}
|
||||||
Expanded(
|
|
||||||
|
Widget buildMemberListContent() {
|
||||||
|
return Expanded(
|
||||||
child: PagingHelperView(
|
child: PagingHelperView(
|
||||||
provider: memberListProvider,
|
provider: memberListProvider,
|
||||||
futureRefreshable: memberListProvider.future,
|
futureRefreshable: memberListProvider.future,
|
||||||
@@ -572,6 +706,8 @@ class _RealmMemberListSheet extends HookConsumerWidget {
|
|||||||
spacing: 6,
|
spacing: 6,
|
||||||
children: [
|
children: [
|
||||||
Flexible(child: Text(member.account!.nick)),
|
Flexible(child: Text(member.account!.nick)),
|
||||||
|
if (member.status != null)
|
||||||
|
AccountStatusLabel(status: member.status!),
|
||||||
if (member.joinedAt == null)
|
if (member.joinedAt == null)
|
||||||
const Icon(Symbols.pending_actions, size: 20),
|
const Icon(Symbols.pending_actions, size: 20),
|
||||||
],
|
],
|
||||||
@@ -624,9 +760,7 @@ class _RealmMemberListSheet extends HookConsumerWidget {
|
|||||||
).then((confirm) async {
|
).then((confirm) async {
|
||||||
if (confirm != true) return;
|
if (confirm != true) return;
|
||||||
try {
|
try {
|
||||||
final apiClient = ref.watch(
|
final apiClient = ref.watch(apiClientProvider);
|
||||||
apiClientProvider,
|
|
||||||
);
|
|
||||||
await apiClient.delete(
|
await apiClient.delete(
|
||||||
'/sphere/realms/$realmSlug/members/${member.accountId}',
|
'/sphere/realms/$realmSlug/members/${member.accountId}',
|
||||||
);
|
);
|
||||||
@@ -647,7 +781,18 @@ class _RealmMemberListSheet extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
maxHeight: MediaQuery.of(context).size.height * 0.8,
|
||||||
),
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
buildMemberListHeader(),
|
||||||
|
const Divider(height: 1),
|
||||||
|
buildMemberListContent(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@@ -22,6 +22,7 @@ import 'package:island/screens/tabs.dart';
|
|||||||
import 'package:material_symbols_icons/symbols.dart';
|
import 'package:material_symbols_icons/symbols.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
import 'package:island/widgets/realm/realm_list_tile.dart';
|
||||||
|
|
||||||
part 'realms.g.dart';
|
part 'realms.g.dart';
|
||||||
|
|
||||||
@@ -95,32 +96,19 @@ class RealmListScreen extends HookConsumerWidget {
|
|||||||
(value) => Column(
|
(value) => Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView.builder(
|
child: ListView.separated(
|
||||||
padding: getTabbedPadding(context),
|
padding: EdgeInsets.only(
|
||||||
|
top: 8,
|
||||||
|
bottom: getTabbedPadding(context).bottom + 8,
|
||||||
|
),
|
||||||
itemCount: value.length,
|
itemCount: value.length,
|
||||||
itemBuilder: (context, item) {
|
itemBuilder: (context, item) {
|
||||||
return ListTile(
|
return ConstrainedBox(
|
||||||
isThreeLine: true,
|
constraints: const BoxConstraints(maxWidth: 540),
|
||||||
leading: ProfilePictureWidget(
|
child: RealmListTile(realm: value[item]),
|
||||||
fileId: value[item].picture?.id,
|
).center();
|
||||||
fallbackIcon: Symbols.group,
|
|
||||||
),
|
|
||||||
title: Text(value[item].name),
|
|
||||||
subtitle: Text(value[item].description),
|
|
||||||
onTap: () {
|
|
||||||
context.pushNamed(
|
|
||||||
'realmDetail',
|
|
||||||
pathParameters: {'slug': value[item].slug},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
contentPadding: const EdgeInsets.only(
|
|
||||||
left: 16,
|
|
||||||
right: 14,
|
|
||||||
top: 8,
|
|
||||||
bottom: 8,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
separatorBuilder: (_, _) => const Gap(8),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@@ -158,3 +158,42 @@ class AccountStatusWidget extends HookConsumerWidget {
|
|||||||
).opacity((status.value?.isCustomized ?? false) ? 1 : 0.85);
|
).opacity((status.value?.isCustomized ?? false) ? 1 : 0.85);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class AccountStatusLabel extends StatelessWidget {
|
||||||
|
final SnAccountStatus status;
|
||||||
|
final TextStyle? style;
|
||||||
|
final int maxLines;
|
||||||
|
final TextOverflow overflow;
|
||||||
|
|
||||||
|
const AccountStatusLabel({
|
||||||
|
super.key,
|
||||||
|
required this.status,
|
||||||
|
this.style,
|
||||||
|
this.maxLines = 1,
|
||||||
|
this.overflow = TextOverflow.ellipsis,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Symbols.circle,
|
||||||
|
fill: 1,
|
||||||
|
color: status.isOnline ? Colors.green : Colors.grey,
|
||||||
|
size: 14,
|
||||||
|
).padding(right: 4),
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
status.label,
|
||||||
|
style: style,
|
||||||
|
maxLines: maxLines,
|
||||||
|
overflow: overflow,
|
||||||
|
).fontSize(13),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -546,6 +546,26 @@ class _MessageItemContent extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
|
case 'deleted':
|
||||||
|
return Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Symbols.delete,
|
||||||
|
size: 14,
|
||||||
|
color: Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.6),
|
||||||
|
),
|
||||||
|
const Gap(4),
|
||||||
|
Text(
|
||||||
|
item.content!,
|
||||||
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||||
|
color: Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.6),
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
case 'call.start':
|
case 'call.start':
|
||||||
case 'call.ended':
|
case 'call.ended':
|
||||||
return _MessageContentCall(
|
return _MessageContentCall(
|
||||||
|
@@ -88,6 +88,7 @@ class AttachmentPreview extends HookConsumerWidget {
|
|||||||
final Function? onInsert;
|
final Function? onInsert;
|
||||||
final Function(UniversalFile)? onUpdate;
|
final Function(UniversalFile)? onUpdate;
|
||||||
final Function? onRequestUpload;
|
final Function? onRequestUpload;
|
||||||
|
final bool isCompact;
|
||||||
|
|
||||||
const AttachmentPreview({
|
const AttachmentPreview({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -98,6 +99,7 @@ class AttachmentPreview extends HookConsumerWidget {
|
|||||||
this.onDelete,
|
this.onDelete,
|
||||||
this.onUpdate,
|
this.onUpdate,
|
||||||
this.onInsert,
|
this.onInsert,
|
||||||
|
this.isCompact = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
// GlobalKey for selector
|
// GlobalKey for selector
|
||||||
@@ -361,7 +363,7 @@ class AttachmentPreview extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
).center(),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@@ -458,9 +460,10 @@ class AttachmentPreview extends HookConsumerWidget {
|
|||||||
size: 16,
|
size: 16,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
const Gap(8),
|
if (!isCompact) const Gap(8),
|
||||||
|
if (!isCompact)
|
||||||
Text(
|
Text(
|
||||||
'On-cloud',
|
'attachmentOnCloud'.tr(),
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -473,9 +476,10 @@ class AttachmentPreview extends HookConsumerWidget {
|
|||||||
size: 16,
|
size: 16,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
const Gap(8),
|
if (!isCompact) const Gap(8),
|
||||||
|
if (!isCompact)
|
||||||
Text(
|
Text(
|
||||||
'On-device',
|
'attachmentOnDevice'.tr(),
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@@ -51,9 +51,13 @@ class UniversalImage extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
errorWidget: (context, url, error) {
|
errorWidget: (context, url, error) {
|
||||||
return const Center(
|
return Image.asset(
|
||||||
child: Icon(Icons.broken_image, color: Colors.white, size: 16),
|
'assets/images/media-offline.png',
|
||||||
|
fit: BoxFit.cover,
|
||||||
);
|
);
|
||||||
|
// return const Center(
|
||||||
|
// child: Icon(Icons.broken_image, color: Colors.white, size: 16),
|
||||||
|
// );
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@@ -73,6 +73,7 @@ class _UniversalVideoState extends ConsumerState<UniversalVideo> {
|
|||||||
return Video(
|
return Video(
|
||||||
controller: _videoController!,
|
controller: _videoController!,
|
||||||
aspectRatio: widget.aspectRatio != 1 ? widget.aspectRatio : null,
|
aspectRatio: widget.aspectRatio != 1 ? widget.aspectRatio : null,
|
||||||
|
fit: BoxFit.contain,
|
||||||
controls:
|
controls:
|
||||||
!kIsWeb && (Platform.isAndroid || Platform.isIOS)
|
!kIsWeb && (Platform.isAndroid || Platform.isIOS)
|
||||||
? MaterialVideoControls
|
? MaterialVideoControls
|
||||||
|
@@ -231,7 +231,7 @@ class ComposeSettingsSheet extends HookConsumerWidget {
|
|||||||
children: [
|
children: [
|
||||||
// Slug field
|
// Slug field
|
||||||
TextField(
|
TextField(
|
||||||
controller: state.contentController,
|
controller: state.slugController,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: 'postSlug'.tr(),
|
labelText: 'postSlug'.tr(),
|
||||||
hintText: 'postSlugHint'.tr(),
|
hintText: 'postSlugHint'.tr(),
|
||||||
|
@@ -15,8 +15,9 @@ class PostListNotifier extends _$PostListNotifier
|
|||||||
static const int _pageSize = 20;
|
static const int _pageSize = 20;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<CursorPagingData<SnPost>> build(
|
Future<CursorPagingData<SnPost>> build({
|
||||||
String? pubName, {
|
String? pubName,
|
||||||
|
String? realm,
|
||||||
int? type,
|
int? type,
|
||||||
List<String>? categories,
|
List<String>? categories,
|
||||||
List<String>? tags,
|
List<String>? tags,
|
||||||
@@ -33,6 +34,7 @@ class PostListNotifier extends _$PostListNotifier
|
|||||||
'offset': offset,
|
'offset': offset,
|
||||||
'take': _pageSize,
|
'take': _pageSize,
|
||||||
if (pubName != null) 'pub': pubName,
|
if (pubName != null) 'pub': pubName,
|
||||||
|
if (realm != null) 'realm': realm,
|
||||||
if (type != null) 'type': type,
|
if (type != null) 'type': type,
|
||||||
if (tags != null) 'tags': tags,
|
if (tags != null) 'tags': tags,
|
||||||
if (categories != null) 'categories': categories,
|
if (categories != null) 'categories': categories,
|
||||||
@@ -68,6 +70,7 @@ enum PostItemType {
|
|||||||
|
|
||||||
class SliverPostList extends HookConsumerWidget {
|
class SliverPostList extends HookConsumerWidget {
|
||||||
final String? pubName;
|
final String? pubName;
|
||||||
|
final String? realm;
|
||||||
final int? type;
|
final int? type;
|
||||||
final List<String>? categories;
|
final List<String>? categories;
|
||||||
final List<String>? tags;
|
final List<String>? tags;
|
||||||
@@ -81,6 +84,7 @@ class SliverPostList extends HookConsumerWidget {
|
|||||||
const SliverPostList({
|
const SliverPostList({
|
||||||
super.key,
|
super.key,
|
||||||
this.pubName,
|
this.pubName,
|
||||||
|
this.realm,
|
||||||
this.type,
|
this.type,
|
||||||
this.categories,
|
this.categories,
|
||||||
this.tags,
|
this.tags,
|
||||||
@@ -96,21 +100,24 @@ class SliverPostList extends HookConsumerWidget {
|
|||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
return PagingHelperSliverView(
|
return PagingHelperSliverView(
|
||||||
provider: postListNotifierProvider(
|
provider: postListNotifierProvider(
|
||||||
pubName,
|
pubName: pubName,
|
||||||
|
realm: realm,
|
||||||
type: type,
|
type: type,
|
||||||
categories: categories,
|
categories: categories,
|
||||||
tags: tags,
|
tags: tags,
|
||||||
),
|
),
|
||||||
futureRefreshable:
|
futureRefreshable:
|
||||||
postListNotifierProvider(
|
postListNotifierProvider(
|
||||||
pubName,
|
pubName: pubName,
|
||||||
|
realm: realm,
|
||||||
type: type,
|
type: type,
|
||||||
categories: categories,
|
categories: categories,
|
||||||
tags: tags,
|
tags: tags,
|
||||||
).future,
|
).future,
|
||||||
notifierRefreshable:
|
notifierRefreshable:
|
||||||
postListNotifierProvider(
|
postListNotifierProvider(
|
||||||
pubName,
|
pubName: pubName,
|
||||||
|
realm: realm,
|
||||||
type: type,
|
type: type,
|
||||||
categories: categories,
|
categories: categories,
|
||||||
tags: tags,
|
tags: tags,
|
||||||
|
@@ -6,7 +6,7 @@ part of 'post_list.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$postListNotifierHash() => r'2ca4f3cfbbcd04f3cc32e7f7bd511a5811042829';
|
String _$postListNotifierHash() => r'9784b282b3ee14b7109e263c5841a082cf0be78e';
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
/// Copied from Dart SDK
|
||||||
class _SystemHash {
|
class _SystemHash {
|
||||||
@@ -32,12 +32,14 @@ class _SystemHash {
|
|||||||
abstract class _$PostListNotifier
|
abstract class _$PostListNotifier
|
||||||
extends BuildlessAutoDisposeAsyncNotifier<CursorPagingData<SnPost>> {
|
extends BuildlessAutoDisposeAsyncNotifier<CursorPagingData<SnPost>> {
|
||||||
late final String? pubName;
|
late final String? pubName;
|
||||||
|
late final String? realm;
|
||||||
late final int? type;
|
late final int? type;
|
||||||
late final List<String>? categories;
|
late final List<String>? categories;
|
||||||
late final List<String>? tags;
|
late final List<String>? tags;
|
||||||
|
|
||||||
FutureOr<CursorPagingData<SnPost>> build(
|
FutureOr<CursorPagingData<SnPost>> build({
|
||||||
String? pubName, {
|
String? pubName,
|
||||||
|
String? realm,
|
||||||
int? type,
|
int? type,
|
||||||
List<String>? categories,
|
List<String>? categories,
|
||||||
List<String>? tags,
|
List<String>? tags,
|
||||||
@@ -55,14 +57,16 @@ class PostListNotifierFamily
|
|||||||
const PostListNotifierFamily();
|
const PostListNotifierFamily();
|
||||||
|
|
||||||
/// See also [PostListNotifier].
|
/// See also [PostListNotifier].
|
||||||
PostListNotifierProvider call(
|
PostListNotifierProvider call({
|
||||||
String? pubName, {
|
String? pubName,
|
||||||
|
String? realm,
|
||||||
int? type,
|
int? type,
|
||||||
List<String>? categories,
|
List<String>? categories,
|
||||||
List<String>? tags,
|
List<String>? tags,
|
||||||
}) {
|
}) {
|
||||||
return PostListNotifierProvider(
|
return PostListNotifierProvider(
|
||||||
pubName,
|
pubName: pubName,
|
||||||
|
realm: realm,
|
||||||
type: type,
|
type: type,
|
||||||
categories: categories,
|
categories: categories,
|
||||||
tags: tags,
|
tags: tags,
|
||||||
@@ -74,7 +78,8 @@ class PostListNotifierFamily
|
|||||||
covariant PostListNotifierProvider provider,
|
covariant PostListNotifierProvider provider,
|
||||||
) {
|
) {
|
||||||
return call(
|
return call(
|
||||||
provider.pubName,
|
pubName: provider.pubName,
|
||||||
|
realm: provider.realm,
|
||||||
type: provider.type,
|
type: provider.type,
|
||||||
categories: provider.categories,
|
categories: provider.categories,
|
||||||
tags: provider.tags,
|
tags: provider.tags,
|
||||||
@@ -104,8 +109,9 @@ class PostListNotifierProvider
|
|||||||
CursorPagingData<SnPost>
|
CursorPagingData<SnPost>
|
||||||
> {
|
> {
|
||||||
/// See also [PostListNotifier].
|
/// See also [PostListNotifier].
|
||||||
PostListNotifierProvider(
|
PostListNotifierProvider({
|
||||||
String? pubName, {
|
String? pubName,
|
||||||
|
String? realm,
|
||||||
int? type,
|
int? type,
|
||||||
List<String>? categories,
|
List<String>? categories,
|
||||||
List<String>? tags,
|
List<String>? tags,
|
||||||
@@ -113,6 +119,7 @@ class PostListNotifierProvider
|
|||||||
() =>
|
() =>
|
||||||
PostListNotifier()
|
PostListNotifier()
|
||||||
..pubName = pubName
|
..pubName = pubName
|
||||||
|
..realm = realm
|
||||||
..type = type
|
..type = type
|
||||||
..categories = categories
|
..categories = categories
|
||||||
..tags = tags,
|
..tags = tags,
|
||||||
@@ -126,6 +133,7 @@ class PostListNotifierProvider
|
|||||||
allTransitiveDependencies:
|
allTransitiveDependencies:
|
||||||
PostListNotifierFamily._allTransitiveDependencies,
|
PostListNotifierFamily._allTransitiveDependencies,
|
||||||
pubName: pubName,
|
pubName: pubName,
|
||||||
|
realm: realm,
|
||||||
type: type,
|
type: type,
|
||||||
categories: categories,
|
categories: categories,
|
||||||
tags: tags,
|
tags: tags,
|
||||||
@@ -139,12 +147,14 @@ class PostListNotifierProvider
|
|||||||
required super.debugGetCreateSourceHash,
|
required super.debugGetCreateSourceHash,
|
||||||
required super.from,
|
required super.from,
|
||||||
required this.pubName,
|
required this.pubName,
|
||||||
|
required this.realm,
|
||||||
required this.type,
|
required this.type,
|
||||||
required this.categories,
|
required this.categories,
|
||||||
required this.tags,
|
required this.tags,
|
||||||
}) : super.internal();
|
}) : super.internal();
|
||||||
|
|
||||||
final String? pubName;
|
final String? pubName;
|
||||||
|
final String? realm;
|
||||||
final int? type;
|
final int? type;
|
||||||
final List<String>? categories;
|
final List<String>? categories;
|
||||||
final List<String>? tags;
|
final List<String>? tags;
|
||||||
@@ -154,7 +164,8 @@ class PostListNotifierProvider
|
|||||||
covariant PostListNotifier notifier,
|
covariant PostListNotifier notifier,
|
||||||
) {
|
) {
|
||||||
return notifier.build(
|
return notifier.build(
|
||||||
pubName,
|
pubName: pubName,
|
||||||
|
realm: realm,
|
||||||
type: type,
|
type: type,
|
||||||
categories: categories,
|
categories: categories,
|
||||||
tags: tags,
|
tags: tags,
|
||||||
@@ -169,6 +180,7 @@ class PostListNotifierProvider
|
|||||||
() =>
|
() =>
|
||||||
create()
|
create()
|
||||||
..pubName = pubName
|
..pubName = pubName
|
||||||
|
..realm = realm
|
||||||
..type = type
|
..type = type
|
||||||
..categories = categories
|
..categories = categories
|
||||||
..tags = tags,
|
..tags = tags,
|
||||||
@@ -178,6 +190,7 @@ class PostListNotifierProvider
|
|||||||
allTransitiveDependencies: null,
|
allTransitiveDependencies: null,
|
||||||
debugGetCreateSourceHash: null,
|
debugGetCreateSourceHash: null,
|
||||||
pubName: pubName,
|
pubName: pubName,
|
||||||
|
realm: realm,
|
||||||
type: type,
|
type: type,
|
||||||
categories: categories,
|
categories: categories,
|
||||||
tags: tags,
|
tags: tags,
|
||||||
@@ -198,6 +211,7 @@ class PostListNotifierProvider
|
|||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is PostListNotifierProvider &&
|
return other is PostListNotifierProvider &&
|
||||||
other.pubName == pubName &&
|
other.pubName == pubName &&
|
||||||
|
other.realm == realm &&
|
||||||
other.type == type &&
|
other.type == type &&
|
||||||
other.categories == categories &&
|
other.categories == categories &&
|
||||||
other.tags == tags;
|
other.tags == tags;
|
||||||
@@ -207,6 +221,7 @@ class PostListNotifierProvider
|
|||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||||
hash = _SystemHash.combine(hash, pubName.hashCode);
|
hash = _SystemHash.combine(hash, pubName.hashCode);
|
||||||
|
hash = _SystemHash.combine(hash, realm.hashCode);
|
||||||
hash = _SystemHash.combine(hash, type.hashCode);
|
hash = _SystemHash.combine(hash, type.hashCode);
|
||||||
hash = _SystemHash.combine(hash, categories.hashCode);
|
hash = _SystemHash.combine(hash, categories.hashCode);
|
||||||
hash = _SystemHash.combine(hash, tags.hashCode);
|
hash = _SystemHash.combine(hash, tags.hashCode);
|
||||||
@@ -222,6 +237,9 @@ mixin PostListNotifierRef
|
|||||||
/// The parameter `pubName` of this provider.
|
/// The parameter `pubName` of this provider.
|
||||||
String? get pubName;
|
String? get pubName;
|
||||||
|
|
||||||
|
/// The parameter `realm` of this provider.
|
||||||
|
String? get realm;
|
||||||
|
|
||||||
/// The parameter `type` of this provider.
|
/// The parameter `type` of this provider.
|
||||||
int? get type;
|
int? get type;
|
||||||
|
|
||||||
@@ -244,6 +262,8 @@ class _PostListNotifierProviderElement
|
|||||||
@override
|
@override
|
||||||
String? get pubName => (origin as PostListNotifierProvider).pubName;
|
String? get pubName => (origin as PostListNotifierProvider).pubName;
|
||||||
@override
|
@override
|
||||||
|
String? get realm => (origin as PostListNotifierProvider).realm;
|
||||||
|
@override
|
||||||
int? get type => (origin as PostListNotifierProvider).type;
|
int? get type => (origin as PostListNotifierProvider).type;
|
||||||
@override
|
@override
|
||||||
List<String>? get categories =>
|
List<String>? get categories =>
|
||||||
|
@@ -582,12 +582,19 @@ class PostHeader extends StatelessWidget {
|
|||||||
else
|
else
|
||||||
...([
|
...([
|
||||||
const Icon(Symbols.arrow_right, size: 14),
|
const Icon(Symbols.arrow_right, size: 14),
|
||||||
InkWell(
|
Flexible(
|
||||||
|
child: InkWell(
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
spacing: 5,
|
spacing: 5,
|
||||||
children: [
|
children: [
|
||||||
Text(item.realm!.name),
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
item.realm!.name,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
ProfilePictureWidget(
|
ProfilePictureWidget(
|
||||||
file: item.realm!.picture,
|
file: item.realm!.picture,
|
||||||
fallbackIcon: Symbols.group,
|
fallbackIcon: Symbols.group,
|
||||||
@@ -602,6 +609,7 @@ class PostHeader extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
),
|
||||||
]),
|
]),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@@ -6,6 +6,7 @@ import 'package:island/pods/network.dart';
|
|||||||
import 'package:island/widgets/realm/realm_card.dart';
|
import 'package:island/widgets/realm/realm_card.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:riverpod_paging_utils/riverpod_paging_utils.dart';
|
import 'package:riverpod_paging_utils/riverpod_paging_utils.dart';
|
||||||
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
|
||||||
part 'realm_list.g.dart';
|
part 'realm_list.g.dart';
|
||||||
|
|
||||||
@@ -78,7 +79,11 @@ class SliverRealmList extends HookConsumerWidget {
|
|||||||
horizontal: 16,
|
horizontal: 16,
|
||||||
vertical: 8,
|
vertical: 8,
|
||||||
),
|
),
|
||||||
|
child:
|
||||||
|
ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(maxWidth: 540),
|
||||||
child: RealmCard(realm: realm),
|
child: RealmCard(realm: realm),
|
||||||
|
).center(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
separatorBuilder: (_, _) => const Gap(8),
|
separatorBuilder: (_, _) => const Gap(8),
|
||||||
|
76
lib/widgets/realm/realm_list_tile.dart
Normal file
76
lib/widgets/realm/realm_list_tile.dart
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:gap/gap.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:island/models/realm.dart';
|
||||||
|
import 'package:island/widgets/content/cloud_files.dart';
|
||||||
|
import 'package:material_symbols_icons/symbols.dart';
|
||||||
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
|
||||||
|
class RealmListTile extends StatelessWidget {
|
||||||
|
const RealmListTile({super.key, required this.realm});
|
||||||
|
|
||||||
|
final SnRealm realm;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Card(
|
||||||
|
margin: EdgeInsets.zero,
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
AspectRatio(
|
||||||
|
aspectRatio: 16 / 7,
|
||||||
|
child: Stack(
|
||||||
|
clipBehavior: Clip.none,
|
||||||
|
fit: StackFit.expand,
|
||||||
|
children: [
|
||||||
|
ClipRRect(
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
|
child: Container(
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||||
|
child:
|
||||||
|
realm.background == null
|
||||||
|
? const SizedBox.shrink()
|
||||||
|
: CloudImageWidget(file: realm.background),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: -30,
|
||||||
|
left: 18,
|
||||||
|
child: ProfilePictureWidget(
|
||||||
|
fileId: realm.picture?.id,
|
||||||
|
fallbackIcon: Symbols.group,
|
||||||
|
radius: 24,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Gap(20 + 12),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
realm.name,
|
||||||
|
).textStyle(Theme.of(context).textTheme.titleMedium!),
|
||||||
|
Text(
|
||||||
|
realm.description,
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
).textStyle(Theme.of(context).textTheme.bodySmall!),
|
||||||
|
],
|
||||||
|
).padding(horizontal: 24, bottom: 14),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
context.pushNamed(
|
||||||
|
'realmDetail',
|
||||||
|
pathParameters: {'slug': realm.slug},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 3.2.0+125
|
version: 3.2.0+126
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.7.2
|
sdk: ^3.7.2
|
||||||
|
Reference in New Issue
Block a user