onLoadResourceWithCustomScheme property
- @SupportedPlatforms.new(platforms: [AndroidPlatform(), IOSPlatform(apiName: 'WKURLSchemeHandler', apiUrl: 'https://developer.apple.com/documentation/webkit/wkurlschemehandler'), MacOSPlatform(apiName: 'WKURLSchemeHandler', apiUrl: 'https://developer.apple.com/documentation/webkit/wkurlschemehandler'), WindowsPlatform(), LinuxPlatform(apiName: 'WebKitURISchemeRequest', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/class.URISchemeRequest.html')])
final
Event fired when the WebView finds the custom-scheme while loading a resource.
Here you can handle the url request and return a CustomSchemeResponse to load a specific resource encoded to base64.
Officially Supported Platforms/Implementations:
- Android WebView
- iOS WKWebView (Official API - WKURLSchemeHandler)
- macOS WKWebView (Official API - WKURLSchemeHandler)
- Windows WebView2
- Linux WPE WebKit (Official API - WebKitURISchemeRequest)
Parameters - Officially Supported Platforms/Implementations:
request: all platforms
Use the PlatformWebViewCreationParams.isPropertySupported method to check if this property is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(),
IOSPlatform(
apiName: 'WKURLSchemeHandler',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkurlschemehandler',
),
MacOSPlatform(
apiName: 'WKURLSchemeHandler',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkurlschemehandler',
),
WindowsPlatform(),
LinuxPlatform(
apiName: 'WebKitURISchemeRequest',
apiUrl:
'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/class.URISchemeRequest.html',
),
],
)
final FutureOr<CustomSchemeResponse?> Function(
T controller,
WebResourceRequest request,
)?
onLoadResourceWithCustomScheme;