saveWebArchive method
Saves the current WebView as a web archive.
Returns the file path under which the web archive file was saved, or null
if saving the file failed.
filePath
represents the file path where the archive should be placed. This value cannot be null
.
autoname
if false
, takes filePath
to be a file.
If true
, filePath
is assumed to be a directory in which a filename will be chosen according to the URL of the current page.
NOTE for iOS: Available on iOS 14.0+. If autoname
is false
, the filePath
must ends with the WebArchiveFormat.WEBARCHIVE file extension.
NOTE for MacOS: Available on MacOS 11.0+. If autoname
is false
, the filePath
must ends with the WebArchiveFormat.WEBARCHIVE file extension.
NOTE for Android: if autoname
is false
, the filePath
must ends with the WebArchiveFormat.MHT file extension.
Officially Supported Platforms/Implementations:
- Android native WebView (Official API - WebView.saveWebArchive)
- iOS
- MacOS
Implementation
Future<String?> saveWebArchive(
{required String filePath, bool autoname = false}) {
throw UnimplementedError(
'saveWebArchive is not implemented on the current platform');
}