copyWithString method

LocalizedString copyWithString(
  1. String language,
  2. String string
)

Returns a new LocalizedString after adding (or replacing) the translation with the given language.

Implementation

LocalizedString copyWithString(String language, String string) => copy(
    translations: Map.from(translations)
      ..putIfAbsent(language, () => Translation(string)));