remove opacity difference for unread channels
This commit is contained in:
@@ -130,21 +130,20 @@ class ChannelPreview extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSubtitle(BuildContext context) {
|
Widget _buildSubtitle(BuildContext context) {
|
||||||
final opacity = channel.state.unreadCount > 0 ? 1.0 : 0.5;
|
|
||||||
return TypingIndicator(
|
return TypingIndicator(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
alternativeWidget: _buildLastMessage(context, opacity),
|
alternativeWidget: _buildLastMessage(context),
|
||||||
style: StreamChatTheme.of(context).channelPreviewTheme.subtitle.copyWith(
|
style: StreamChatTheme.of(context).channelPreviewTheme.subtitle.copyWith(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.channelPreviewTheme
|
.channelPreviewTheme
|
||||||
.subtitle
|
.subtitle
|
||||||
.color
|
.color
|
||||||
.withOpacity(opacity),
|
.withOpacity(0.5),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildLastMessage(BuildContext context, double opacity) {
|
Widget _buildLastMessage(BuildContext context) {
|
||||||
return StreamBuilder<List<Message>>(
|
return StreamBuilder<List<Message>>(
|
||||||
stream: channel.state.messagesStream,
|
stream: channel.state.messagesStream,
|
||||||
initialData: channel.state.messages,
|
initialData: channel.state.messages,
|
||||||
@@ -189,7 +188,7 @@ class ChannelPreview extends StatelessWidget {
|
|||||||
.channelPreviewTheme
|
.channelPreviewTheme
|
||||||
.subtitle
|
.subtitle
|
||||||
.color
|
.color
|
||||||
.withOpacity(opacity),
|
.withOpacity(0.5),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user