This commit is contained in:
Phaung Phaung
2021-09-10 12:02:08 +06:30
parent a144c945b6
commit c06ae00b68
35 changed files with 190 additions and 223 deletions

View File

@@ -6,14 +6,14 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show rootBundle;
class AppTranslations {
Locale locale;
static Map<dynamic, dynamic> _localisedValues;
late Locale locale;
static late Map<dynamic, dynamic> _localisedValues;
AppTranslations(Locale locale) {
this.locale = locale;
}
static AppTranslations of(BuildContext context) {
static AppTranslations? of(BuildContext context) {
return Localizations.of<AppTranslations>(context, AppTranslations);
}
@@ -27,7 +27,7 @@ class AppTranslations {
get currentLanguage => locale.languageCode;
String text(String key, {List<String> translationVariables}) {
String text(String key, {List<String>? translationVariables}) {
String value = _localisedValues[key];
if (value == null) {
return "$key not found";