applyDisplaySkinTone method
Emoji
applyDisplaySkinTone(
- Emoji emoji,
- SkinToneConfig skinToneConfig,
- String? rememberedSkinTone
Returns the emoji that should be displayed (and selected) in the grid, recents and search results.
When skinToneConfig remembers a tone and rememberedSkinTone is set,
the toned glyph is returned; otherwise the original emoji is returned
unchanged. The result keeps Emoji.hasSkinTone intact so the indicator
and long-press picker keep working on the cell.
Implementation
Emoji applyDisplaySkinTone(
Emoji emoji,
SkinToneConfig skinToneConfig,
String? rememberedSkinTone,
) {
if (!skinToneConfig.enabled ||
!skinToneConfig.rememberSkinTone ||
rememberedSkinTone == null ||
!emoji.hasSkinTone) {
return emoji;
}
return applySkinTone(emoji, rememberedSkinTone);
}