get static method

String get(
  1. String key, {
  2. String? defaultValue,
})

Get translated text.

Get the translation by specifying the key.

By specifying defaultValue, you can determine the value if key is not found.

Implementation

static String get(String key, {String? defaultValue}) {
  if (!(_document?.containsKey(key) ?? false)) {
    return defaultValue ?? key;
  }
  return _document?[key] ?? defaultValue ?? key;
}