add structure
This commit is contained in:
27
lib/widget/localization/transalation.dart
Normal file
27
lib/widget/localization/transalation.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'dart:ui';
|
||||
|
||||
typedef void LocaleChangeCallback(Locale locale);
|
||||
|
||||
class Translation {
|
||||
static final Translation _translation = Translation._internal();
|
||||
|
||||
factory Translation() {
|
||||
return _translation;
|
||||
}
|
||||
|
||||
Translation._internal();
|
||||
|
||||
final List<String> supportedLanguages = [
|
||||
"English",
|
||||
"မြန်မာ ",
|
||||
];
|
||||
|
||||
final List<String> supportedLanguagesCodes = ["en", "mu"];
|
||||
|
||||
//returns the list of supported Locales
|
||||
Iterable<Locale> supportedLocales() =>
|
||||
supportedLanguagesCodes.map<Locale>((language) => Locale(language, ""));
|
||||
|
||||
//function to be invoked when changing the language
|
||||
LocaleChangeCallback onLocaleChanged;
|
||||
}
|
||||
Reference in New Issue
Block a user