toJson method
Implementation
Map<String, dynamic> toJson() {
return {
'url': url,
'status': status,
'statusText': statusText,
'headers': headers.toJson(),
'mimeType': mimeType,
'charset': charset,
'connectionReused': connectionReused,
'connectionId': connectionId,
'encodedDataLength': encodedDataLength,
'securityState': securityState.toJson(),
if (requestHeaders != null) 'requestHeaders': requestHeaders!.toJson(),
if (remoteIPAddress != null) 'remoteIPAddress': remoteIPAddress,
if (remotePort != null) 'remotePort': remotePort,
if (fromDiskCache != null) 'fromDiskCache': fromDiskCache,
if (fromServiceWorker != null) 'fromServiceWorker': fromServiceWorker,
if (fromPrefetchCache != null) 'fromPrefetchCache': fromPrefetchCache,
if (fromEarlyHints != null) 'fromEarlyHints': fromEarlyHints,
if (serviceWorkerRouterInfo != null)
'serviceWorkerRouterInfo': serviceWorkerRouterInfo!.toJson(),
if (timing != null) 'timing': timing!.toJson(),
if (serviceWorkerResponseSource != null)
'serviceWorkerResponseSource': serviceWorkerResponseSource!.toJson(),
if (responseTime != null) 'responseTime': responseTime!.toJson(),
if (cacheStorageCacheName != null)
'cacheStorageCacheName': cacheStorageCacheName,
if (protocol != null) 'protocol': protocol,
if (alternateProtocolUsage != null)
'alternateProtocolUsage': alternateProtocolUsage!.toJson(),
if (securityDetails != null) 'securityDetails': securityDetails!.toJson(),
};
}