Skip to content

Commit 0522158

Browse files
chrisbobbegnprice
authored andcommitted
emoji [nfc]: Make popularEmojiCandidates a method, not getter
For parallelism with allEmojiCandidates, which is similar.
1 parent 23902ad commit 0522158

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

lib/model/emoji.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ mixin EmojiStore {
115115
///
116116
/// See description in the web code:
117117
/// https://github.com/zulip/zulip/blob/83a121c7e/web/shared/src/typeahead.ts#L3-L21
118-
Iterable<EmojiCandidate> get popularEmojiCandidates {
118+
Iterable<EmojiCandidate> popularEmojiCandidates() {
119119
return EmojiStoreImpl._popularCandidates;
120120
}
121121

@@ -315,7 +315,7 @@ class EmojiStoreImpl extends PerAccountStoreBase with EmojiStore {
315315

316316
// Include the "popular" emoji, in their canonical order
317317
// relative to each other.
318-
results.addAll(popularEmojiCandidates);
318+
results.addAll(popularEmojiCandidates());
319319

320320
final namesOverridden = {
321321
for (final emoji in activeRealmEmoji) emoji.name,

lib/widgets/action_sheet.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ class ReactionButtons extends StatelessWidget {
699699
@override
700700
Widget build(BuildContext context) {
701701
final store = PerAccountStoreWidget.of(pageContext);
702-
final popularEmojiCandidates = store.popularEmojiCandidates;
702+
final popularEmojiCandidates = store.popularEmojiCandidates();
703703
assert(popularEmojiCandidates.every(
704704
(emoji) => emoji.emojiType == ReactionType.unicodeEmoji));
705705

test/model/emoji_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void main() {
7878
});
7979
});
8080

81-
final popularCandidates = eg.store().popularEmojiCandidates;
81+
final popularCandidates = eg.store().popularEmojiCandidates();
8282

8383
Condition<Object?> isUnicodeCandidate(String? emojiCode, List<String>? names) {
8484
return (it_) {

test/widgets/action_sheet_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ void main() {
829829

830830
group('message action sheet', () {
831831
group('ReactionButtons', () {
832-
final popularCandidates = eg.store().popularEmojiCandidates;
832+
final popularCandidates = eg.store().popularEmojiCandidates();
833833

834834
for (final emoji in popularCandidates) {
835835
final emojiDisplay = emoji.emojiDisplay as UnicodeEmojiDisplay;

test/widgets/emoji_reaction_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ void main() {
299299
// - Non-animated image emoji is selected when intended
300300

301301
group('EmojiPicker', () {
302-
final popularCandidates = eg.store().popularEmojiCandidates;
302+
final popularCandidates = eg.store().popularEmojiCandidates();
303303

304304
Future<void> setupEmojiPicker(WidgetTester tester, {
305305
required StreamMessage message,

0 commit comments

Comments
 (0)