FlutterMacOSWebView constructor

FlutterMacOSWebView({
  1. void onOpen()?,
  2. void onClose()?,
  3. void onPageStarted(
    1. String? url
    )?,
  4. void onPageFinished(
    1. String? url
    )?,
  5. void onWebResourceError(
    1. WebResourceError error
    )?,
})

Creates a FlutterMacOSWebView with the specified callbacks:

onOpen - the WebView has been opened

onClose - the WebView has been closed

onPageStarted - the WebView has started loading url you've passed initially and for all subsequent url changes (user clicks a link, etc)

onPageFinished - the WebView has finished loading url

onWebResourceError - the WebView failed loading page or some Javascript exception occured. See WebResourceErrorType enum

Implementation

FlutterMacOSWebView({
  this.onOpen,
  this.onClose,
  this.onPageStarted,
  this.onPageFinished,
  this.onWebResourceError,
}) : _channel = MethodChannel(_kChannel) {
  _channel.setMethodCallHandler(_onMethodCall);
}