PlatformStorage class abstract mixin

Class that provides methods to manage the JavaScript Storage object. It is used by PlatformLocalStorage and PlatformSessionStorage.

Implemented types
Implementers
Annotations
  • @SupportedPlatforms.new(platforms: [AndroidPlatform(), IOSPlatform(), MacOSPlatform(), WebPlatform(), WindowsPlatform(), LinuxPlatform()])

Constructors

PlatformStorage()

Properties

controller PlatformInAppWebViewController?
Controller used to interact with storage.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
webStorageType WebStorageType
The web storage type: window.sessionStorage or window.localStorage.
no setter

Methods

clear() Future<void>
Clears all keys stored in a given Storage object.
dispose() → void
override
getItem({required String key}) Future
When passed a key name, will return that key's value, or null if the key does not exist, in the given Storage object.
getItems() Future<List<WebStorageItem>>
Returns the list of all items from the given Storage object.
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.
length() Future<int?>
Returns an integer representing the number of data items stored in the Storage object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeItem({required String key}) Future<void>
When passed a key name, will remove that key from the given Storage object if it exists.
setItem({required String key, required dynamic value}) Future<void>
When passed a key name and value, will add that key to the storage, or update that key's value if it already exists.
toString() String
A string representation of this object.
inherited

Operators

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