@@ -241,24 +241,25 @@ void showChannelActionSheet(BuildContext context, {
241
241
final pageContext = PageRoot .contextOf (context);
242
242
final store = PerAccountStoreWidget .of (pageContext);
243
243
244
- final optionButtons = < ActionSheetMenuItemButton > [
245
- TopicListButton (pageContext: pageContext, channelId: channelId),
246
- ];
244
+ final optionButtons = < ActionSheetMenuItemButton > [];
247
245
248
246
final unreadCount = store.unreads.countInChannelNarrow (channelId);
249
247
if (unreadCount > 0 ) {
250
248
optionButtons.add (
251
249
MarkChannelAsReadButton (pageContext: pageContext, channelId: channelId));
252
250
}
253
251
252
+ optionButtons.add (
253
+ TopicListButton (pageContext: pageContext, channelId: channelId));
254
+
254
255
optionButtons.add (
255
256
CopyChannelLinkButton (channelId: channelId, pageContext: pageContext));
256
257
257
258
_showActionSheet (pageContext, optionButtons: optionButtons);
258
259
}
259
260
260
- class TopicListButton extends ActionSheetMenuItemButton {
261
- const TopicListButton ({
261
+ class MarkChannelAsReadButton extends ActionSheetMenuItemButton {
262
+ const MarkChannelAsReadButton ({
262
263
super .key,
263
264
required this .channelId,
264
265
required super .pageContext,
@@ -267,22 +268,22 @@ class TopicListButton extends ActionSheetMenuItemButton {
267
268
final int channelId;
268
269
269
270
@override
270
- IconData get icon => ZulipIcons .topics ;
271
+ IconData get icon => ZulipIcons .message_checked ;
271
272
272
273
@override
273
274
String label (ZulipLocalizations zulipLocalizations) {
274
- return zulipLocalizations.actionSheetOptionListOfTopics ;
275
+ return zulipLocalizations.actionSheetOptionMarkChannelAsRead ;
275
276
}
276
277
277
278
@override
278
- void onPressed () {
279
- Navigator . push (pageContext,
280
- TopicListPage . buildRoute (context : pageContext, streamId : channelId) );
279
+ void onPressed () async {
280
+ final narrow = ChannelNarrow (channelId);
281
+ await ZulipAction . markNarrowAsRead ( pageContext, narrow );
281
282
}
282
283
}
283
284
284
- class MarkChannelAsReadButton extends ActionSheetMenuItemButton {
285
- const MarkChannelAsReadButton ({
285
+ class TopicListButton extends ActionSheetMenuItemButton {
286
+ const TopicListButton ({
286
287
super .key,
287
288
required this .channelId,
288
289
required super .pageContext,
@@ -291,17 +292,17 @@ class MarkChannelAsReadButton extends ActionSheetMenuItemButton {
291
292
final int channelId;
292
293
293
294
@override
294
- IconData get icon => ZulipIcons .message_checked ;
295
+ IconData get icon => ZulipIcons .topics ;
295
296
296
297
@override
297
298
String label (ZulipLocalizations zulipLocalizations) {
298
- return zulipLocalizations.actionSheetOptionMarkChannelAsRead ;
299
+ return zulipLocalizations.actionSheetOptionListOfTopics ;
299
300
}
300
301
301
302
@override
302
- void onPressed () async {
303
- final narrow = ChannelNarrow (channelId);
304
- await ZulipAction . markNarrowAsRead ( pageContext, narrow );
303
+ void onPressed () {
304
+ Navigator . push (pageContext,
305
+ TopicListPage . buildRoute (context : pageContext, streamId : channelId) );
305
306
}
306
307
}
307
308
0 commit comments