requestDatabase method

Future<DatabaseWithObjectStores> requestDatabase(
  1. String databaseName, {
  2. String? securityOrigin,
  3. String? storageKey,
  4. StorageBucket? storageBucket,
})

Requests database with given name in given frame. securityOrigin At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin. storageKey Storage key. storageBucket Storage bucket. If not specified, it uses the default bucket. databaseName Database name. Returns: Database with an array of object stores.

Implementation

Future<DatabaseWithObjectStores> requestDatabase(String databaseName,
    {String? securityOrigin,
    String? storageKey,
    storage.StorageBucket? storageBucket}) async {
  var result = await _client.send('IndexedDB.requestDatabase', {
    'databaseName': databaseName,
    if (securityOrigin != null) 'securityOrigin': securityOrigin,
    if (storageKey != null) 'storageKey': storageKey,
    if (storageBucket != null) 'storageBucket': storageBucket,
  });
  return DatabaseWithObjectStores.fromJson(
      result['databaseWithObjectStores'] as Map<String, dynamic>);
}