fromJson static method

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

Creates a NetworkLog instance from a JSON Map

This is the inverse operation of toJson(). It takes a Map containing serialized log information and creates a NetworkLog instance from it.

Parameters:

  • json: Map containing the serialized log data

Returns: A new NetworkLog instance populated with the deserialized data

Implementation

static SimpleOverlayNetworkLog fromJson(Map<String, dynamic> json) =>
    SimpleOverlayNetworkLog(
      timestamp: DateTime.parse(json['timestamp']),
      tag: json['tag'],
      method: json['method'],
      url: json['url'],
      requestHeaders: Map<String, String>.from(json['requestHeaders']),
      requestBody: json['requestBody'],
      statusCode: json['statusCode'],
      responseHeaders: json['responseHeaders'] != null
          ? Map<String, String>.from(json['responseHeaders'])
          : null,
      responseBody: json['responseBody'],
      isSuccess: json['isSuccess'],
    );