t method

String t(
  1. String key
)

Get a translated value for a specific key.

Sample code

GoogleI18nLocalizations i18n = GoogleI18nLocalizations.of(context);
i18n.t('title');

Implementation

String t(String key) {
  String fallbackTranslation = '$key translation missing.';
  try {
    return this._localizedValues[locale.languageCode]![key] ??
        fallbackTranslation;
  } on NoSuchMethodError {
    return fallbackTranslation;
  }
}