From 3c779b6e343a3315fac1c32e8e678cbdbb75d2c8 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 16 Jun 2020 16:10:50 +0200 Subject: [PATCH] update channel preview --- lib/src/channel_name.dart | 1 + lib/src/channel_preview.dart | 25 ++++++++++++++++++------- lib/src/stream_chat_theme.dart | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/src/channel_name.dart b/lib/src/channel_name.dart index ef7599b7..96a6a14a 100644 --- a/lib/src/channel_name.dart +++ b/lib/src/channel_name.dart @@ -42,6 +42,7 @@ class ChannelName extends StatelessWidget { return Text( title, style: textStyle, + overflow: TextOverflow.ellipsis, ); }, ); diff --git a/lib/src/channel_preview.dart b/lib/src/channel_preview.dart index 1e86f4fb..d9b69705 100644 --- a/lib/src/channel_preview.dart +++ b/lib/src/channel_preview.dart @@ -56,20 +56,31 @@ class ChannelPreview extends StatelessWidget { leading: ChannelImage( onTap: onImageTap, ), - title: ChannelName( - textStyle: StreamChatTheme.of(context).channelPreviewTheme.title, - ), - subtitle: _buildSubtitle(context), - trailing: Row( - mainAxisSize: MainAxisSize.min, + title: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - _buildDate(context), + Flexible( + child: ChannelName( + textStyle: StreamChatTheme.of(context).channelPreviewTheme.title, + ), + ), if (channel.state.unreadCount > 0) UnreadIndicator( channel: channel, ), ], ), + subtitle: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible(child: _buildSubtitle(context)), + _buildDate(context), + ], + ), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [], + ), ); } diff --git a/lib/src/stream_chat_theme.dart b/lib/src/stream_chat_theme.dart index e75d30c3..c1d44b9b 100644 --- a/lib/src/stream_chat_theme.dart +++ b/lib/src/stream_chat_theme.dart @@ -230,7 +230,7 @@ class StreamChatThemeData { color: isDark ? Colors.white : Colors.black, ), subtitle: TextStyle( - fontSize: 13, + fontSize: 12.5, color: isDark ? Colors.white : Colors.black, ), lastMessageAt: TextStyle(