Cookie.fromJson constructor
Implementation
factory Cookie.fromJson(Map<String, dynamic> json) {
return Cookie(
name: json['name'] as String,
value: json['value'] as String,
domain: json['domain'] as String,
path: json['path'] as String,
expires: json['expires'] as num,
size: json['size'] as int,
httpOnly: json['httpOnly'] as bool? ?? false,
secure: json['secure'] as bool? ?? false,
session: json['session'] as bool? ?? false,
sameSite: json.containsKey('sameSite')
? CookieSameSite.fromJson(json['sameSite'] as String)
: null,
priority: CookiePriority.fromJson(json['priority'] as String),
sameParty: json['sameParty'] as bool? ?? false,
sourceScheme: CookieSourceScheme.fromJson(json['sourceScheme'] as String),
sourcePort: json['sourcePort'] as int,
partitionKey: json.containsKey('partitionKey')
? json['partitionKey'] as String
: null,
partitionKeyOpaque: json.containsKey('partitionKeyOpaque')
? json['partitionKeyOpaque'] as bool
: null,
);
}