onTitleChanged method
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebChromeClient.onReceivedTitle', apiUrl: 'https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedTitle(android.webkit.WebView,%20java.lang.String)'), IOSPlatform(), MacOSPlatform(), WindowsPlatform(apiName: 'ICoreWebView2.add_DocumentTitleChanged', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2210.55#add_documenttitlechanged')])
- String? title
Event fired when a change in the document title occurred.
title represents the string containing the new title of the document.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebChromeClient.onReceivedTitle)
- iOS WKWebView
- macOS WKWebView
- Windows WebView2 (Official API - ICoreWebView2.add_DocumentTitleChanged)
Parameters - Officially Supported Platforms/Implementations:
title: all platforms
Use the PlatformInAppBrowserEvents.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebChromeClient.onReceivedTitle',
apiUrl:
'https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedTitle(android.webkit.WebView,%20java.lang.String)',
),
IOSPlatform(),
MacOSPlatform(),
WindowsPlatform(
apiName: 'ICoreWebView2.add_DocumentTitleChanged',
apiUrl:
'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2210.55#add_documenttitlechanged',
),
],
)
void onTitleChanged(String? title) {}