StorageSync class

Inheritance

Constructors

StorageSync.fromJS(StorageArea wrapped)

Properties

hashCode → int
The hash code for this object.
no setterinherited
maxItems ↔ int
The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set runtime.lastError when using a callback, or when a Promise is rejected.
getter/setter pair
maxSustainedWriteOperationsPerMinute ↔ int
getter/setter pair
maxWriteOperationsPerHour ↔ int
The maximum number of set, remove, or clear operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit.
getter/setter pair
maxWriteOperationsPerMinute ↔ int
The maximum number of set, remove, or clear operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time.
getter/setter pair
onChanged → EventStream<Map>
Fired when one or more items change.
no setterinherited
quotaBytes ↔ int
The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError when using a callback, or when a Promise is rejected.
getter/setter pair
quotaBytesPerItem ↔ int
The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set runtime.lastError when using a callback, or when a Promise is rejected.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
toJS → StorageArea
no setterinherited

Methods

clear() → Future<void>
Removes all items from storage. returns Promise that resolves on success, or rejects on failure.
inherited
get(Object? keys) → Future<Map>
Gets one or more items from storage. keys A single key to get, list of keys to get, or a dictionary specifying default values (see description of the object). An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. returns Promise that resolves with an object containing a key-value map for the requested items, or rejects on failure.
inherited
getBytesInUse(Object? keys) → Future<double>
Gets the amount of space (in bytes) being used by one or more items. keys A single key or list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage. returns Promise that resolves with the amount of space being used by storage, or rejects on failure.
inherited
getKeys() → Future<List<String>>
Gets all keys from storage. returns Promise that resolves with storage keys, or rejects on failure.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(Object keys) → Future<void>
Removes one or more items from storage. keys A single key or a list of keys for items to remove. returns Promise that resolves on success, or rejects on failure.
inherited
set(Map items) → Future<void>
Sets multiple items. items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.
inherited
setAccessLevel(SetAccessLevelAccessOptions accessOptions) → Future<void>
Sets the desired access level for the storage area. By default, session storage is restricted to trusted contexts (extension pages and service workers), while managed, local, and sync storage allow access from both trusted and untrusted contexts. returns Promise that resolves on success, or rejects on failure.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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