loadUrl method

Future<void> loadUrl({
  1. required URLRequest urlRequest,
  2. @Deprecated('Use allowingReadAccessTo instead') Uri? iosAllowingReadAccessTo,
  3. WebUri? allowingReadAccessTo,
})

Loads the given urlRequest.

  • allowingReadAccessTo, used in combination with urlRequest (using the file:// scheme), it represents the URL from which to read the web content. This URL must be a file-based URL (using the file:// scheme). Specify the same value as the URL parameter to prevent WebView from reading any other content. Specify a directory to give WebView permission to read additional files in the specified directory.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • urlRequest: all platforms
  • allowingReadAccessTo:
    • iOS WKWebView
    • macOS WKWebView

Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.

Implementation

Future<void> loadUrl({
  required URLRequest urlRequest,
  @Deprecated('Use allowingReadAccessTo instead')
  Uri? iosAllowingReadAccessTo,
  WebUri? allowingReadAccessTo,
}) => platform.loadUrl(
  urlRequest: urlRequest,
  iosAllowingReadAccessTo: iosAllowingReadAccessTo,
  allowingReadAccessTo: allowingReadAccessTo,
);