platform property

WebViewPlatform platform

The WebView platform that's used by this WebView.

The default value is AndroidWebView on Android and CupertinoWebView on iOS.

Implementation

static WebViewPlatform get platform {
  if (_platform == null) {
    switch (defaultTargetPlatform) {
      case TargetPlatform.android:
        _platform = AndroidWebView();
        break;
      case TargetPlatform.iOS:
        _platform = CupertinoWebView();
        break;
      default:
        throw UnsupportedError("Trying to use the default webview implementation for $defaultTargetPlatform but there isn't a default one");
    }
  }
  return _platform!;
}
void platform=(WebViewPlatform? platform)

Sets a custom WebViewPlatform.

This property can be set to use a custom platform implementation for WebViews.

Setting platform doesn't affect WebViews that were already created.

The default value is AndroidWebView on Android and CupertinoWebView on iOS.

Implementation

static set platform(WebViewPlatform? platform) {
  _platform = platform;
}