getEmotionByName static method

Emotion? getEmotionByName(
  1. String name
)

Implementation

static Emotion? getEmotionByName(String name) {
  var emotionTab = EmotionTab();
  Emotion find1 = emotionTab.defaultTabs.firstWhere(
      (element) => element.name == name,
      orElse: () => ResEmotion("", "", ""));
  if (find1.unique.isNotEmpty) {
    return find1;
  }
  Emotion find2 = emotionTab.gupaiTabs.firstWhere(
      (element) => element.name == name,
      orElse: () => NetworkEmotion("", "", ""));
  if (find2.unique.isNotEmpty) {
    return find2;
  }
  Emotion find3 = emotionTab.newYearTabs.firstWhere(
      (element) => element.name == name,
      orElse: () => NetworkEmotion("", "", ""));
  if (find3.unique.isNotEmpty) {
    return find3;
  }
  return null;
}