MultilingualHelper class

Helper for multilingual inputs (e.g. product name).

There are 2 versions of the input:

  1. the old one - only one text per product
  2. the multilingual one Typically, the old version will be used with "old" data, that have not downloaded yet the more "recent" multilingual fields (e.g. ProductField.NAME_ALL_LANGUAGES).
Inheritance
Available extensions

Constructors

MultilingualHelper({required TextEditingController controller})

Properties

controller → TextEditingController
final
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
changeLanguage(OpenFoodFactsLanguage? newLanguage) → bool
dispose() → void
Discards any resources used by the object.
inherited
getChangedMonolingualText() → String?
Returns the new text, if any change happened.
getChangedMultilingualText() → Map<OpenFoodFactsLanguage, String>?
Returns all the new texts, if any change happened.
getCurrentLanguage() → OpenFoodFactsLanguage
getInitialMultiLingualTexts() → Map<OpenFoodFactsLanguage, String>
hasChanged() → bool
init({required Map<OpenFoodFactsLanguage, String>? multilingualTexts, required String? monolingualText, List<ProductImage>? selectedImages, ImageField? imageField, OpenFoodFactsLanguage? productLanguage}) → void
Init of the translations.
isMonolingual() → bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
replaceListener(VoidCallback listener) → void

Available on ChangeNotifier, provided by the ChangeNotifierExtensions extension

toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

getCleanText(String? name) → String