onTitleChanged property
- @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(), WebPlatform(), 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'), LinuxPlatform(apiName: 'WebKitWebView::notify::title', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/property.WebView.title.html')])
final
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
- Web <iframe> but requires same origin
- Windows WebView2 (Official API - ICoreWebView2.add_DocumentTitleChanged)
- Linux WPE WebKit (Official API - WebKitWebView::notify::title)
Parameters - Officially Supported Platforms/Implementations:
title: all platforms
Use the PlatformWebViewCreationParams.isPropertySupported method to check if this property 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(),
WebPlatform(),
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',
),
LinuxPlatform(
apiName: 'WebKitWebView::notify::title',
apiUrl:
'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/property.WebView.title.html',
),
],
)
final void Function(T controller, String? title)? onTitleChanged;