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(
    tanned: (_) => const LocalizationStrings.tanned(),
    yellow: (_) => const LocalizationStrings.yellow(),
    pale: (_) => const LocalizationStrings.pale(),
    light: (_) => const LocalizationStrings.light(),
    brown: (_) => const LocalizationStrings.brown(),
    darkBrown: (_) => const LocalizationStrings.darkBrown(),
    black: (_) => const LocalizationStrings.black(),
    custom: (_) => const LocalizationStrings.custom(),
  );

  return LocalizationStrings.applyLanguageCode(localization, languageCode);
}