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(
    blank: (_) => const LocalizationStrings.blank(),
    beardMedium: (_) => const LocalizationStrings.beardMedium(),
    beardLight: (_) => const LocalizationStrings.beardLight(),
    beardMajestic: (_) => const LocalizationStrings.beardMajestic(),
    moustacheFancy: (_) => const LocalizationStrings.moustacheFancy(),
    moustacheMagnum: (_) => const LocalizationStrings.moustacheMagnum(),
  );

  return LocalizationStrings.applyLanguageCode(localization, languageCode);
}