@@ -188,8 +188,13 @@ class _SubscriptionList extends StatelessWidget {
188
188
itemBuilder: (BuildContext context, int index) {
189
189
final subscription = subscriptions[index];
190
190
final unreadCount = unreadsModel! .countInStream (subscription.streamId);
191
- // TODO(#712): if stream muted, show a dot for unreads
192
- return SubscriptionItem (subscription: subscription, unreadCount: unreadCount);
191
+ final hasUnmutedUnreads = unreadCount > 0 ;
192
+ // There is no need to check for muted unreads if there unmuted ones
193
+ final hasMutedUnreads = ! hasUnmutedUnreads && unreadsModel! .hasMutedInStream (subscription.streamId);
194
+ return SubscriptionItem (subscription: subscription,
195
+ unreadCount: unreadCount,
196
+ hasMutedUnreads: hasMutedUnreads,
197
+ hasUnmutedUnreads: hasUnmutedUnreads);
193
198
});
194
199
}
195
200
}
@@ -200,15 +205,18 @@ class SubscriptionItem extends StatelessWidget {
200
205
super .key,
201
206
required this .subscription,
202
207
required this .unreadCount,
208
+ required this .hasMutedUnreads,
209
+ required this .hasUnmutedUnreads,
203
210
});
204
211
205
212
final Subscription subscription;
206
213
final int unreadCount;
214
+ final bool hasMutedUnreads;
215
+ final bool hasUnmutedUnreads;
207
216
208
217
@override
209
218
Widget build (BuildContext context) {
210
219
final swatch = colorSwatchFor (context, subscription);
211
- final hasUnreads = (unreadCount > 0 );
212
220
final opacity = subscription.isMuted ? 0.55 : 1.0 ;
213
221
return Material (
214
222
// TODO(#95) need dark-theme color
@@ -243,11 +251,11 @@ class SubscriptionItem extends StatelessWidget {
243
251
// TODO(#95) need dark-theme color
244
252
color: Color (0xFF262626 ),
245
253
).merge (weightVariableTextStyle (context,
246
- wght: hasUnreads ? 600 : null )),
254
+ wght: hasUnmutedUnreads ? 600 : null )),
247
255
maxLines: 1 ,
248
256
overflow: TextOverflow .ellipsis,
249
257
subscription.name)))),
250
- if (unreadCount > 0 ) ...[
258
+ if (hasUnmutedUnreads ) ...[
251
259
const SizedBox (width: 12 ),
252
260
// TODO(#747) show @-mention indicator when it applies
253
261
Opacity (
@@ -256,6 +264,9 @@ class SubscriptionItem extends StatelessWidget {
256
264
count: unreadCount,
257
265
backgroundColor: swatch,
258
266
bold: true )),
267
+ ] else if (hasMutedUnreads) ...[
268
+ const SizedBox (width: 12 ),
269
+ const MutedUnreadBadge (),
259
270
],
260
271
const SizedBox (width: 16 ),
261
272
])));
0 commit comments