setCookie method

  1. @override
Future<void> setCookie(
  1. WebViewCookie cookie
)

Sets a cookie for all WebView instances.

Implementation

@override
Future<void> setCookie(WebViewCookie cookie) {
  if (!_isValidPath(cookie.path)) {
    throw ArgumentError(
        'The path property for the provided cookie was not given a legal value.');
  }
  return _cookieManager.setCookie(
    cookie.domain,
    '${Uri.encodeComponent(cookie.name)}=${Uri.encodeComponent(cookie.value)}; path=${cookie.path}',
  );
}