TFetchTranslations typedef

TFetchTranslations = Future<Map<String, String>> Function(Locale locale)

Resolves a flat key → string translation map for a given Locale.

The implementation is provided by the host app — typically a wrapper around a backend endpoint (e.g. GET /v1/translations?locale=...) or an offline-first cache such as reliable's ReliableRepository. The controller does not know or care where translations come from; it only expects a flat string map keyed by the same key form used by .tr().

Implementation

typedef TFetchTranslations = Future<Map<String, String>> Function(
  Locale locale,
);