Skip to content

Commit 3ac750f

Browse files
emoji [nfc]: Make emoji data class' constructor const
1 parent f7421bf commit 3ac750f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/model/emoji.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ sealed class EmojiDisplay {
1414
/// The emoji's name, as in [Reaction.emojiName].
1515
final String emojiName;
1616

17-
EmojiDisplay({required this.emojiName});
17+
const EmojiDisplay({required this.emojiName});
1818

1919
EmojiDisplay resolve(UserSettings? userSettings) { // TODO(server-5)
2020
if (this is TextEmojiDisplay) return this;
@@ -30,7 +30,7 @@ class UnicodeEmojiDisplay extends EmojiDisplay {
3030
/// The actual Unicode text representing this emoji; for example, "🙂".
3131
final String emojiUnicode;
3232

33-
UnicodeEmojiDisplay({required super.emojiName, required this.emojiUnicode});
33+
const UnicodeEmojiDisplay({required super.emojiName, required this.emojiUnicode});
3434
}
3535

3636
/// An emoji to display as an image.
@@ -42,7 +42,7 @@ class ImageEmojiDisplay extends EmojiDisplay {
4242
/// compare [RealmEmojiItem.stillUrl].
4343
final Uri? resolvedStillUrl;
4444

45-
ImageEmojiDisplay({
45+
const ImageEmojiDisplay({
4646
required super.emojiName,
4747
required this.resolvedUrl,
4848
required this.resolvedStillUrl,
@@ -54,7 +54,7 @@ class ImageEmojiDisplay extends EmojiDisplay {
5454
/// We do this based on a user preference,
5555
/// and as a fallback when the Unicode or image approaches fail.
5656
class TextEmojiDisplay extends EmojiDisplay {
57-
TextEmojiDisplay({required super.emojiName});
57+
const TextEmojiDisplay({required super.emojiName});
5858
}
5959

6060
/// An emoji that might be offered in an emoji picker UI.
@@ -79,7 +79,7 @@ final class EmojiCandidate {
7979

8080
final EmojiDisplay emojiDisplay;
8181

82-
EmojiCandidate({
82+
const EmojiCandidate({
8383
required this.emojiType,
8484
required this.emojiCode,
8585
required this.emojiName,

0 commit comments

Comments
 (0)