InfospectNetworkCall.fromMap constructor

InfospectNetworkCall.fromMap(
  1. dynamic map
)

Creates an instance of the InfospectNetworkCall class from a Map representation.

Parameters:

  • map: A Map containing the key-value pairs representing the InfospectNetworkCall object.

Returns an instance of the InfospectNetworkCall class with the data populated from the provided Map.

Implementation

factory InfospectNetworkCall.fromMap(dynamic map) {
  return InfospectNetworkCall(
    map['id'] as int,
    time: DateTime.fromMillisecondsSinceEpoch(map['createdTime'] as int),
    client: map['client'] as String,
    loading: map['loading'] as bool,
    secure: map['secure'] as bool,
    method: map['method'] as String,
    endpoint: map['endpoint'] as String,
    server: map['server'] as String,
    uri: map['uri'] as String,
    duration: map['duration'] as int,
    request: map['request'] != null
        ? InfospectNetworkRequest.fromMap(map['request'])
        : null,
    response: map['response'] != null
        ? InfospectNetworkResponse.fromMap(map['response'])
        : null,
    error: map['error'] != null
        ? InfospectNetworkError.fromMap(map['error'])
        : null,
  );
}