navigate method
- @SupportedPlatforms(platforms: [AndroidPlatform(apiName: 'WebViewCompat.navigate', apiUrl: 'https://developer.android.com/reference/androidx/webkit/WebViewCompat#navigate(android.webkit.WebView,java.lang.String,androidx.webkit.NavigationParameters)', note: 'Requires [WebViewFeature.NAVIGATION_LISTENER]. Falls back to loadUrl otherwise.')])
Loads url with optional history replacement and extra headers.
This is the AndroidX WebViewCompat.navigate API. When the feature is
unavailable the call falls back to loadUrl.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebViewCompat.navigate):
- Requires WebViewFeature.NAVIGATION_LISTENER. Falls back to loadUrl otherwise.
Parameters - Officially Supported Platforms/Implementations:
url: all platformsreplaceHistory: all platformsheaders: all platforms
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebViewCompat.navigate',
apiUrl:
'https://developer.android.com/reference/androidx/webkit/WebViewCompat#navigate(android.webkit.WebView,java.lang.String,androidx.webkit.NavigationParameters)',
note:
'Requires [WebViewFeature.NAVIGATION_LISTENER]. Falls back to loadUrl otherwise.',
),
],
)
Future<void> navigate({
required WebUri url,
bool replaceHistory = false,
Map<String, String>? headers,
}) {
throw UnimplementedError(
'${PlatformInAppWebViewControllerMethod.navigate.name} is not implemented on the current platform',
);
}