getMetaThemeColor method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(note: 'This method is implemented using JavaScript.'), IOSPlatform(apiName: 'WKWebView.themeColor', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/3794258-themecolor', note: 'On iOS < 15.0, this method is implemented using JavaScript.'), LinuxPlatform(apiName: 'webkit_web_view_get_theme_color', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.get_theme_color.html'), MacOSPlatform(apiName: 'WKWebView.themeColor', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/3794258-themecolor', note: 'On iOS < 12.0, this method is implemented using JavaScript.'), WebPlatform(note: 'This method is implemented using JavaScript.'), WindowsPlatform(note: 'This method is implemented using JavaScript.')])
Future<Color?> getMetaThemeColor()

Returns an instance of Color representing the content value of the <meta name="theme-color" content=""> tag of the current WebView, if available, otherwise null.

Officially Supported Platforms/Implementations:

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

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(note: 'This method is implemented using JavaScript.'),
    IOSPlatform(
      apiName: 'WKWebView.themeColor',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkwebview/3794258-themecolor',
      note: 'On iOS < 15.0, this method is implemented using JavaScript.',
    ),
    LinuxPlatform(
      apiName: 'webkit_web_view_get_theme_color',
      apiUrl:
          'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.get_theme_color.html',
    ),
    MacOSPlatform(
      apiName: 'WKWebView.themeColor',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkwebview/3794258-themecolor',
      note: 'On iOS < 12.0, this method is implemented using JavaScript.',
    ),
    WebPlatform(note: 'This method is implemented using JavaScript.'),
    WindowsPlatform(note: 'This method is implemented using JavaScript.'),
  ],
)
Future<Color?> getMetaThemeColor() {
  throw UnimplementedError(
    '${PlatformInAppWebViewControllerMethod.getMetaThemeColor.name} is not implemented on the current platform',
  );
}