trAsync function

Future<String> trAsync(
  1. BuildContext context,
  2. StringLocale string, {
  3. Map<String, Object?> args = const {},
})

Implementation

Future<String> trAsync(BuildContext context, sl.StringLocale string,
    {Map<String, Object?> args = const {}}) {
  final scope = StringLocaleScope._inherited(context);
  return scope.bundle.has(string.id)
      ? scope.bundle.resolveAsync(scope.locale, string.id, args)
      : Future.value(string.resolve(locale: scope.locale, args: args));
}