addTranslation method

void addTranslation(
  1. BuildContext context,
  2. SupportedTranslation translation
)

Adds a translation if it is not already included, triggering a UI rebuild.

Implementation

void addTranslation(BuildContext context, SupportedTranslation translation) {
  if (!_includedTranslations.contains(translation.name)) {
    loadTranslation(translation);
    (context as Element).markNeedsBuild();
  }
}