removeDataModifiedSince method

Future<void> removeDataModifiedSince({
  1. required Set<IOSWKWebsiteDataType> dataTypes,
  2. required DateTime date,
})

Removes all website data of the given types that has been modified since the given date.

dataTypes represents the website data types that should be removed.

date represents a date. All website data modified after this date will be removed.

Implementation

Future<void> removeDataModifiedSince(
    {required Set<IOSWKWebsiteDataType> dataTypes,
    required DateTime date}) async {
  Set<WebsiteDataType> dataTypesList = Set();
  for (var dataType in dataTypes) {
    dataTypesList
        .add(WebsiteDataType.fromNativeValue(dataType.toNativeValue())!);
  }

  await WebStorageManager.instance()
      .removeDataModifiedSince(dataTypes: dataTypesList, date: date);
}