CookieParam.fromJson constructor

CookieParam.fromJson(
  1. Map<String, dynamic> json
)

Implementation

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