@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
2
2
3
3
import '../api/model/model.dart' ;
4
4
import '../generated/l10n/zulip_localizations.dart' ;
5
+ import '../model/channel.dart' ;
5
6
import '../model/narrow.dart' ;
6
7
import '../model/unreads.dart' ;
7
8
import 'action_sheet.dart' ;
@@ -66,27 +67,12 @@ class _SubscriptionListPageBodyState extends State<SubscriptionListPageBody> wit
66
67
});
67
68
}
68
69
69
- // TODO(linter): The linter incorrectly flags the following regexp string
70
- // as invalid. See: https://github.com/dart-lang/sdk/issues/61246
71
- // ignore: valid_regexps
72
- static final _startsWithEmojiRegex = RegExp (r'^\p{Emoji}' , unicode: true );
73
-
74
70
void _sortSubs (List <Subscription > list) {
75
71
list.sort ((a, b) {
76
72
if (a.isMuted && ! b.isMuted) return 1 ;
77
73
if (! a.isMuted && b.isMuted) return - 1 ;
78
74
79
- // A user gave feedback wanting zulip-flutter to match web in putting
80
- // emoji-prefixed channels first; see #1202.
81
- // For matching web's ordering completely, see:
82
- // https://github.com/zulip/zulip-flutter/issues/1165
83
- final aStartsWithEmoji = _startsWithEmojiRegex.hasMatch (a.name);
84
- final bStartsWithEmoji = _startsWithEmojiRegex.hasMatch (b.name);
85
- if (aStartsWithEmoji && ! bStartsWithEmoji) return - 1 ;
86
- if (! aStartsWithEmoji && bStartsWithEmoji) return 1 ;
87
-
88
- // TODO(i18n): add locale-aware sorting
89
- return a.name.toLowerCase ().compareTo (b.name.toLowerCase ());
75
+ return ChannelStore .compareChannelsByName (a, b);
90
76
});
91
77
}
92
78
0 commit comments