getGiftEmotionUrlByUrl static method

String? getGiftEmotionUrlByUrl(
  1. String? emotionUrl
)

Implementation

static String? getGiftEmotionUrlByUrl(String? emotionUrl) {
  if (emotionUrl == null || emotionUrl.isEmpty) return null;
  var matches = giftEmotionUrlRegExp.firstMatch(emotionUrl);
  if (matches == null) return null;
  var name = matches.group(0);
  if (name == null || name.isEmpty) return null;
  var emotion = getEmotionByName("[$name]");
  if (emotion is NetworkEmotion) {
    return emotion.url;
  }
  return null;
}