text method Null safety

String text(
  1. String key,
  2. {List<String>? args}
)

Text value of provided key with optional args which replaces each {index}

Implementation

static String text(final String key, {List<String>? args}) {
  TGLocalization? currentLocalization =
      localizations[currentLocale.toString()];
  if (currentLocalization == null) return key;
  String value = currentLocalization.text(key);
  if (args == null || args.length == 0) return value;
  return _replaceArgs(value, args);
}