getTitle method
Gets the title for the current page.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebView.getTitle)
- iOS WKWebView (Official API - WKWebView.title)
- macOS WKWebView (Official API - WKWebView.title)
- Web <iframe> but requires same origin
- Windows WebView2 (Official API - ICoreWebView2.get_DocumentTitle)
- Linux WPE WebKit (Official API - webkit_web_view_get_title)
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@override
Future<String?> getTitle() async {
Map<String, dynamic> args = <String, dynamic>{};
return await channel?.invokeMethod<String?>('getTitle', args);
}