tweak examples
This commit is contained in:
@@ -51,13 +51,24 @@ class ChannelListPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _channelPreviewBuilder(BuildContext context, Channel channel) {
|
||||
final lastMessage = channel.state.messages.reversed
|
||||
.firstWhere((message) => message.type != "deleted");
|
||||
|
||||
final subtitle = (lastMessage == null ? "nothing yet" : lastMessage.text);
|
||||
final opacity = channel.state.unreadCount > .0 ? 1.0 : 0.5;
|
||||
|
||||
return ListTile(
|
||||
leading: ChannelImage(
|
||||
channel: channel,
|
||||
),
|
||||
title: ChannelName(
|
||||
channel: channel,
|
||||
textStyle:
|
||||
StreamChatTheme.of(context).channelPreviewTheme.title.copyWith(
|
||||
color: Colors.black.withOpacity(opacity),
|
||||
),
|
||||
),
|
||||
subtitle: Text(subtitle),
|
||||
trailing: channel.state.unreadCount > 0
|
||||
? CircleAvatar(
|
||||
radius: 10,
|
||||
|
||||
Reference in New Issue
Block a user