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. NOTE: available only on iOS and MacOS.

NOTE for Android: when loading an URL Request using "POST" method, headers are ignored.

NOTE for Web: if method is "GET" and headers are empty, it will change the src of the iframe. For all other cases it will try to create an XMLHttpRequest and load the result inside the iframe.

Officially Supported Platforms/Implementations:

Implementation

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