toLabel method

  1. @override
String toLabel([
  1. String languageCode = 'en'
])
override

based on languageCode and LocalizationStrings returns the label

Implementation

@override
String toLabel([String languageCode = 'en']) {
  final localization = when(
    angry: () => const LocalizationStrings.angry(),
    angryNatural: () => const LocalizationStrings.angryNatural(),
    default0: () => const LocalizationStrings.default0(),
    defaultNatural: () => const LocalizationStrings.defaultNatural(),
    flatNatural: () => const LocalizationStrings.flatNatural(),
    frownNatural: () => const LocalizationStrings.frownNatural(),
    raisedExcited: () => const LocalizationStrings.raisedExcited(),
    raisedExcitedNatural: () =>
        const LocalizationStrings.raisedExcitedNatural(),
    sadConcerned: () => const LocalizationStrings.sadConcerned(),
    sadConcernedNatural: () =>
        const LocalizationStrings.sadConcernedNatural(),
    unibrowNatural: () => const LocalizationStrings.unibrowNatural(),
    upDown: () => const LocalizationStrings.upDown(),
    upDownNatural: () => const LocalizationStrings.upDownNatural(),
  );

  return LocalizationStrings.applyLanguageCode(localization, languageCode);
}