PlatformLocalStorage class abstract
Class that provides methods to manage the JavaScript window.localStorage object.
It used by PlatformWebStorage.
- Inheritance
-
- Object
- PlatformInterface
- PlatformLocalStorage
- Mixed-in types
- Annotations
-
- @SupportedPlatforms.new(platforms: [AndroidPlatform(), IOSPlatform(), MacOSPlatform(), WebPlatform(), WindowsPlatform(), LinuxPlatform()])
Constructors
- PlatformLocalStorage(PlatformLocalStorageCreationParams params)
-
Creates a new PlatformLocalStorage
factory
- PlatformLocalStorage.implementation(PlatformLocalStorageCreationParams params)
- Used by the platform implementation to create a new PlatformLocalStorage.
- PlatformLocalStorage.static()
-
Creates a new empty PlatformLocalStorage to access static methods.
factory
Properties
- controller → PlatformInAppWebViewController?
-
Controller used to interact with storage.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- params → PlatformLocalStorageCreationParams
-
The parameters used to initialize the PlatformLocalStorage.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- webStorageType → WebStorageType
-
The web storage type:
window.sessionStorageorwindow.localStorage.no setteroverride
Methods
-
clear(
) → Future< void> -
Clears all keys stored in a given Storage object.
override
-
dispose(
) → void -
override
-
getItem(
{required String key}) → Future -
When passed a
keyname, will return that key's value, ornullif the key does not exist, in the given Storage object.override -
getItems(
) → Future< List< WebStorageItem> > -
Returns the list of all items from the given Storage object.
override
-
isClassSupported(
{TargetPlatform? platform}) → bool -
isMethodSupported(
PlatformLocalStorageMethod method, {TargetPlatform? platform}) → bool -
Check if the given
methodis supported by the defaultTargetPlatform or a specificplatform. -
isPropertySupported(
PlatformStorageCreationParamsProperty property, {TargetPlatform? platform}) → bool -
Check if the given
propertyis supported by the defaultTargetPlatform or a specificplatform. -
key(
{required int index}) → Future< String> -
When passed a number
index, returns the name of the nth key in a given Storage object. The order of keys is user-agent defined, so you should not rely on it.override -
length(
) → Future< int?> -
Returns an integer representing the number of data items stored in the Storage object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeItem(
{required String key}) → Future< void> -
When passed a
keyname, will remove that key from the given Storage object if it exists.override -
setItem(
{required String key, required dynamic value}) → Future< void> -
When passed a
keyname andvalue, will add that key to the storage, or update that key's value if it already exists.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited