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 {
  List<String> dataTypesList = [];
  for (var dataType in dataTypes) {
    dataTypesList.add(dataType.toValue());
  }

  var timestamp = date.millisecondsSinceEpoch;

  Map<String, dynamic> args = <String, dynamic>{};
  args.putIfAbsent("dataTypes", () => dataTypesList);
  args.putIfAbsent("timestamp", () => timestamp);
  await _staticChannel.invokeMethod('removeDataModifiedSince', args);
}