extendDictionary method

void extendDictionary({
  1. required Map<String, String>? dict,
  2. String? lang,
})

Add translations to the existing Map.

Unlike setMessagesDict, this will not overwrite the existing map, just adds to it (or replace in case the key is duplicated).

Implementation

void extendDictionary({required Map<String, String>? dict, String? lang}) {
  lang ??= currentLanguage;
  if (dict != null) {
    _messages[lang] ??= <String, String>{};
    _messages[lang]?.addAll(dict);
  }
}