PlatformCookieManager class abstract
Class that implements a singleton object (shared instance) which manages the cookies used by WebView instances.
- Inheritance
-
- Object
- PlatformInterface
- PlatformCookieManager
- Annotations
-
- @SupportedPlatforms.new(platforms: [AndroidPlatform(note: 'It is implemented using [CookieManager](https://developer.android.com/reference/android/webkit/CookieManager).'), IOSPlatform(note: """It is implemented using [WKHTTPCookieStore](https://developer.apple.com/documentation/webkit/wkhttpcookiestore). On iOS below 11.0, it is implemented using JavaScript. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies for JavaScript restrictions. """), LinuxPlatform(apiName: 'WebKitCookieManager', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/class.CookieManager.html', note: 'It is implemented using WebKitCookieManager from WPE WebKit.'), MacOSPlatform(note: 'It is implemented using [WKHTTPCookieStore](https://developer.apple.com/documentation/webkit/wkhttpcookiestore).'), WebPlatform(note: """It is implemented using JavaScript. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies for JavaScript restrictions. """), WindowsPlatform()])
Constructors
- PlatformCookieManager(PlatformCookieManagerCreationParams params)
-
Creates a new PlatformCookieManager
factory
- PlatformCookieManager.implementation(PlatformCookieManagerCreationParams params)
- Used by the platform implementation to create a new PlatformCookieManager.
- PlatformCookieManager.static()
-
Creates a new PlatformCookieManager to access static methods.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- params → PlatformCookieManagerCreationParams
-
The parameters used to initialize the PlatformCookieManager.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
deleteAllCookies(
) → Future< bool> - Removes all cookies.
-
deleteCookie(
{required WebUri url, required String name, String path = "/", String? domain, PlatformInAppWebViewController? iosBelow11WebViewController, PlatformInAppWebViewController? webViewController}) → Future< bool> -
Removes a cookie by its
namefor the givenurl,domainandpath. -
deleteCookies(
{required WebUri url, String path = "/", String? domain, PlatformInAppWebViewController? iosBelow11WebViewController, PlatformInAppWebViewController? webViewController}) → Future< bool> -
Removes all cookies for the given
url,domainandpath. -
flush(
) → Future< void> - Ensures all cookies currently accessible through the getCookie API are written to persistent storage. This call will block the caller until it is done and may perform I/O.
-
getAllCookies(
) → Future< List< Cookie> > - Fetches all stored cookies.
-
getCookie(
{required WebUri url, required String name, PlatformInAppWebViewController? iosBelow11WebViewController, PlatformInAppWebViewController? webViewController}) → Future< Cookie?> -
Gets a cookie by its
namefor the givenurl. -
getCookies(
{required WebUri url, PlatformInAppWebViewController? iosBelow11WebViewController, PlatformInAppWebViewController? webViewController}) → Future< List< Cookie> > -
Gets all the cookies for the given
url. -
isClassSupported(
{TargetPlatform? platform}) → bool -
Check if the current class is supported by the defaultTargetPlatform or a specific
platform. -
isMethodSupported(
PlatformCookieManagerMethod method, {TargetPlatform? platform}) → bool -
Check if the given
methodis supported by the defaultTargetPlatform or a specificplatform. -
isPropertySupported(
PlatformCookieManagerCreationParamsProperty property, {TargetPlatform? platform}) → bool -
Check if the given
propertyis supported by the defaultTargetPlatform or a specificplatform. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeSessionCookies(
) → Future< bool> - Removes all session cookies, which are cookies without an expiration date.
-
setCookie(
{required WebUri url, required String name, required String value, String path = "/", String? domain, int? expiresDate, int? maxAge, bool? isSecure, bool? isHttpOnly, HTTPCookieSameSitePolicy? sameSite, PlatformInAppWebViewController? iosBelow11WebViewController, PlatformInAppWebViewController? webViewController}) → Future< bool> -
Sets a cookie for the given
url. Any existing cookie with the samehost,pathandnamewill be replaced with the new cookie. The cookie being set will be ignored if it is expired. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited