Merge branch 'master' into feature/new-ui

This commit is contained in:
Salvatore Giordano
2020-10-23 16:29:04 +02:00
9 changed files with 67 additions and 42 deletions
+30 -20
View File
@@ -12,26 +12,36 @@ class UnreadIndicator extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Material(
borderRadius: BorderRadius.circular(8),
color: StreamChatTheme.of(context).channelPreviewTheme.unreadCounterColor,
child: Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 2,
bottom: 1,
),
child: Center(
child: Text(
'${channel.state.unreadCount}',
style: TextStyle(
fontSize: 11,
color: Colors.white,
return StreamBuilder<int>(
stream: channel.state.unreadCountStream,
initialData: channel.state.unreadCount,
builder: (context, snapshot) {
if (!snapshot.hasData || snapshot.data == 0) {
return SizedBox();
}
return Material(
borderRadius: BorderRadius.circular(8),
color: StreamChatTheme.of(context)
.channelPreviewTheme
.unreadCounterColor,
child: Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 2,
bottom: 1,
),
child: Center(
child: Text(
'${snapshot.data}',
style: TextStyle(
fontSize: 11,
color: Colors.white,
),
),
),
),
),
),
),
);
);
});
}
}