getTitle method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebView.getTitle', apiUrl: 'https://developer.android.com/reference/android/webkit/WebView#getTitle()'), IOSPlatform(apiName: 'WKWebView.title', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/1415015-title'), MacOSPlatform(apiName: 'WKWebView.title', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/1415015-title'), WebPlatform(), WindowsPlatform(apiName: 'ICoreWebView2.get_DocumentTitle', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2210.55#get_documenttitle'), LinuxPlatform(apiName: 'webkit_web_view_get_title', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.get_title.html')])
Future<String?> getTitle()

Gets the title for the current page.

Officially Supported Platforms/Implementations:

Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(
      apiName: 'WebView.getTitle',
      apiUrl:
          'https://developer.android.com/reference/android/webkit/WebView#getTitle()',
    ),
    IOSPlatform(
      apiName: 'WKWebView.title',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkwebview/1415015-title',
    ),
    MacOSPlatform(
      apiName: 'WKWebView.title',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkwebview/1415015-title',
    ),
    WebPlatform(),
    WindowsPlatform(
      apiName: 'ICoreWebView2.get_DocumentTitle',
      apiUrl:
          'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2210.55#get_documenttitle',
    ),
    LinuxPlatform(
      apiName: 'webkit_web_view_get_title',
      apiUrl:
          'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.get_title.html',
    ),
  ],
)
Future<String?> getTitle() {
  throw UnimplementedError(
    '${PlatformInAppWebViewControllerMethod.getTitle.name} is not implemented on the current platform',
  );
}