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(),
    kurt: () => const LocalizationStrings.kurt(),
    prescription01: () => const LocalizationStrings.prescription01(),
    prescription02: () => const LocalizationStrings.prescription02(),
    round: () => const LocalizationStrings.roundGlasses(),
    sunglasses: () => const LocalizationStrings.sunglasses(),
    wayfarers: () => const LocalizationStrings.wayfarers(),
  );

  return LocalizationStrings.applyLanguageCode(localization, languageCode);
}