update
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user