LocalizationHelper class

A helper class for resolving localized strings and dynamic tags.

Constructors

LocalizationHelper(List<PaywallLocalization> localizations, String initialLocale)
Initializes the LocalizationHelper with a list of localizations and an initial locale.

Properties

hashCode → int
The hash code for this object.
no setterinherited
isRTL → bool
Checks if the current locale is RTL
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

getLocalizationValue(String stringId) → dynamic
Gets the raw localization value for rich text processing
getString(String stringId, {OfferingPackages? offeringPackage, OfferingPackagesProduct? product, String? currentLocale}) → String
Retrieves a localized string based on its ID and optionally injects dynamic product/package data.
hasStringId(String stringId, {String? currentLocale}) → bool
Returns true if the given stringId exists for the effective locale
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setCurrentLocale(String locale) → void
Sets the current locale for string resolution.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

buildLocalizedTextSpan(dynamic value, TextStyle baseStyle, {OfferingPackages? offeringPackage, OfferingPackagesProduct? product, String? currentLocale, bool isRTL = false}) → TextSpan
Converts a localization value (String or List) to a TextSpan with support for attributes like bold, italic, underline, strike.