Skip to content

Commit 0ee6336

Browse files
committed
api [nfc]: Add ReactionType.fromApiValue
1 parent 59dfd0a commit 0ee6336

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/api/model/reaction.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,9 @@ enum ReactionType {
175175
zulipExtraEmoji;
176176

177177
String toJson() => _$ReactionTypeEnumMap[this]!;
178+
179+
static ReactionType fromApiValue(String value) => _byApiValue[value]!;
180+
181+
static final _byApiValue = _$ReactionTypeEnumMap
182+
.map((key, value) => MapEntry(value, key));
178183
}

0 commit comments

Comments
 (0)