toJson method
Implementation
Map<String, dynamic> toJson() {
final json = <String, dynamic>{'name': name, 'value': value};
if (path is String) {
json['path'] = path;
}
if (domain is String) {
json['domain'] = domain;
}
if (secure is bool) {
json['secure'] = secure;
}
if (expiry is DateTime) {
json['expiry'] = (expiry!.millisecondsSinceEpoch / 1000).ceil();
}
return json;
}