get method

String get(
  1. String key, [
  2. Map<String, String> vars = const {}
])

The text for key, with {name} placeholders replaced by vars.

Implementation

String get(String key, [Map<String, String> vars = const {}]) {
  var s = values[key];
  if (s == null || s.trim().isEmpty) {
    if (_warned.add(key)) debugPrint('ORYKSA TV: the server sent no text for "$key"; using the English fallback.');
    s = fallback[key] ?? key;
  }
  vars.forEach((k, v) => s = s!.replaceAll('{$k}', v));
  return s!;
}