|
|
|
|
@ -93,20 +93,7 @@ class ChatListItem extends StatelessWidget {
|
|
|
|
|
: room.getState(EventTypes.RoomMember, lastEvent.senderId) == null;
|
|
|
|
|
final space = this.space;
|
|
|
|
|
|
|
|
|
|
return Dismissible(
|
|
|
|
|
key: ValueKey(room.id),
|
|
|
|
|
confirmDismiss: (_) => archiveAction(context),
|
|
|
|
|
onDismissed: (_) {
|
|
|
|
|
// Empty dismissed callback to trigger the dismiss animation
|
|
|
|
|
},
|
|
|
|
|
background: Material(
|
|
|
|
|
color: theme.colorScheme.errorContainer,
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.archive_outlined,
|
|
|
|
|
color: theme.colorScheme.onErrorContainer,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Padding(
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 8,
|
|
|
|
|
vertical: 1,
|
|
|
|
|
@ -266,8 +253,7 @@ class ChatListItem extends StatelessWidget {
|
|
|
|
|
const SizedBox(
|
|
|
|
|
width: 16,
|
|
|
|
|
height: 16,
|
|
|
|
|
child:
|
|
|
|
|
CircularProgressIndicator.adaptive(strokeWidth: 2),
|
|
|
|
|
child: CircularProgressIndicator.adaptive(strokeWidth: 2),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 4),
|
|
|
|
|
],
|
|
|
|
|
@ -291,8 +277,7 @@ class ChatListItem extends StatelessWidget {
|
|
|
|
|
room.spaceChildren.length,
|
|
|
|
|
(room.summary.mJoinedMemberCount ?? 1),
|
|
|
|
|
),
|
|
|
|
|
style:
|
|
|
|
|
TextStyle(color: theme.colorScheme.outline),
|
|
|
|
|
style: TextStyle(color: theme.colorScheme.outline),
|
|
|
|
|
)
|
|
|
|
|
: typingText.isNotEmpty
|
|
|
|
|
? Text(
|
|
|
|
|
@ -314,8 +299,7 @@ class ChatListItem extends StatelessWidget {
|
|
|
|
|
hideEdit: true,
|
|
|
|
|
plaintextBody: true,
|
|
|
|
|
removeMarkdown: true,
|
|
|
|
|
withSenderNamePrefix:
|
|
|
|
|
(!isDirectChat ||
|
|
|
|
|
withSenderNamePrefix: (!isDirectChat ||
|
|
|
|
|
directChatMatrixId !=
|
|
|
|
|
room.lastEvent?.senderId),
|
|
|
|
|
)
|
|
|
|
|
@ -341,22 +325,19 @@ class ChatListItem extends StatelessWidget {
|
|
|
|
|
?.content
|
|
|
|
|
.tryGet<String>('reason') ??
|
|
|
|
|
(isDirectChat
|
|
|
|
|
? L10n.of(context)
|
|
|
|
|
.newChatRequest
|
|
|
|
|
? L10n.of(context).newChatRequest
|
|
|
|
|
: L10n.of(context)
|
|
|
|
|
.inviteGroupChat)
|
|
|
|
|
: snapshot.data ??
|
|
|
|
|
L10n.of(context).emptyChat,
|
|
|
|
|
softWrap: false,
|
|
|
|
|
maxLines:
|
|
|
|
|
room.notificationCount >= 1 ? 2 : 1,
|
|
|
|
|
maxLines: room.notificationCount >= 1 ? 2 : 1,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: unread || room.hasNewMessages
|
|
|
|
|
? theme.colorScheme.onSurface
|
|
|
|
|
: theme.colorScheme.outline,
|
|
|
|
|
decoration:
|
|
|
|
|
room.lastEvent?.redacted == true
|
|
|
|
|
decoration: room.lastEvent?.redacted == true
|
|
|
|
|
? TextDecoration.lineThrough
|
|
|
|
|
: null,
|
|
|
|
|
),
|
|
|
|
|
@ -370,8 +351,7 @@ class ChatListItem extends StatelessWidget {
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 7),
|
|
|
|
|
height: unreadBubbleSize,
|
|
|
|
|
width:
|
|
|
|
|
!hasNotifications && !unread && !room.hasNewMessages
|
|
|
|
|
width: !hasNotifications && !unread && !room.hasNewMessages
|
|
|
|
|
? 0
|
|
|
|
|
: (unreadBubbleSize - 9) *
|
|
|
|
|
room.notificationCount.toString().length +
|
|
|
|
|
@ -415,7 +395,6 @@ class ChatListItem extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|