I have the following code where I want to make sure my status will be localized in app, so I wanted to parse current locale and get value in needed language, but what it basically do, is simply remembering first language (locale) value parsed in it and staying with it till I restart my app
enum BillStatus {
sent,
processed,
...
}
extension BillStatusExtension on BillStatus {
static Map<BillStatus, String> names = {
BillStatus.sent: S.current.sent,
BillStatus.processed: S.current.processed,
...
};
String? get name => names[this];
}
S.current
means AppLocalizationDelegate
provided with intl
package