InMemoryLocaleStorage class
In-memory implementation of LocaleStorage suitable for testing and SSR.
Stores the active locale in an in-memory string field without accessing browser storage APIs.
final storage = InMemoryLocaleStorage('en-US');
final i18n = BloomI18n(storage: storage);
See also:
- LocaleStorage, the abstract persistence contract.
- Implemented types
Constructors
- InMemoryLocaleStorage([String? _saved])
-
Creates an in-memory storage optionally initialized with
initial.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
load(
) → Future< String?> -
Loads the stored locale string.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
save(
String locale) → Future< void> -
Saves
localeto memory.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited