getCookie method

Future<Cookie?> getCookie({
  1. required WebUri url,
  2. required String name,
  3. @Deprecated("Use webViewController instead") InAppWebViewController? iosBelow11WebViewController,
  4. InAppWebViewController? webViewController,
})

Gets a cookie by its name for the given url.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • url: all platforms
  • name: all platforms
  • webViewController:
    • macOS WKWebView
    • iOS WKWebView
    • Web <iframe> but requires same origin
    • Windows WebView2

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

Implementation

Future<Cookie?> getCookie({
  required WebUri url,
  required String name,
  @Deprecated("Use webViewController instead")
  InAppWebViewController? iosBelow11WebViewController,
  InAppWebViewController? webViewController,
}) => platform.getCookie(
  url: url,
  name: name,
  iosBelow11WebViewController: iosBelow11WebViewController?.platform,
  webViewController: webViewController?.platform,
);