WebStorageManager class

Class that implements a singleton object (shared instance) which manages the web storage used by WebView instances. On Android, it is implemented using WebStorage. On iOS and MacOS, it is implemented using WKWebsiteDataStore.default().

NOTE for iOS: available from iOS 9.0+.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS

Constructors

WebStorageManager()
Class that implements a singleton object (shared instance) which manages the web storage used by WebView instances. On Android, it is implemented using WebStorage. On iOS and MacOS, it is implemented using WKWebsiteDataStore.default().
WebStorageManager.fromPlatform(PlatformWebStorageManager platform)
Constructs a WebStorageManager from a specific platform implementation.
WebStorageManager.fromPlatformCreationParams(PlatformWebStorageManagerCreationParams params)
Constructs a WebStorageManager from creation params for a specific platform.

Properties

android AndroidWebStorageManager
Use WebStorageManager instead.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
ios IOSWebStorageManager
Use WebStorageManager instead.
getter/setter pair
platform PlatformWebStorageManager
Implementation of PlatformCookieManager for the current platform.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

deleteAllData() Future<void>
Clears all storage currently being used by the JavaScript storage APIs. This includes the Application Cache, Web SQL Database and the HTML5 Web Storage APIs.
deleteOrigin({required String origin}) Future<void>
Clears the storage currently being used by both the Application Cache and Web SQL Database APIs by the given origin. The origin is specified using its string representation.
fetchDataRecords({required Set<WebsiteDataType> dataTypes}) Future<List<WebsiteDataRecord>>
Fetches data records containing the given website data types.
getOrigins() Future<List<WebStorageOrigin>>
Gets the origins currently using either the Application Cache or Web SQL Database APIs.
getQuotaForOrigin({required String origin}) Future<int>
Gets the storage quota for the Web SQL Database API for the given origin. The quota is given in bytes and the origin is specified using its string representation. Note that a quota is not enforced on a per-origin basis for the Application Cache API.
getUsageForOrigin({required String origin}) Future<int>
Gets the amount of storage currently being used by both the Application Cache and Web SQL Database APIs by the given origin. The amount is given in bytes and the origin is specified using its string representation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeDataFor({required Set<WebsiteDataType> dataTypes, required List<WebsiteDataRecord> dataRecords}) Future<void>
Removes website data of the given types for the given data records.
removeDataModifiedSince({required Set<WebsiteDataType> dataTypes, required DateTime date}) Future<void>
Removes all website data of the given types that has been modified since the given date.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

instance() WebStorageManager
Gets the WebStorageManager shared instance.