InfospectNetworkResponse.fromMap constructor
InfospectNetworkResponse.fromMap(
- Map map
Creates an instance of the InfospectNetworkResponse
class from a Map representation.
Parameters:
map
: A Map containing the key-value pairs representing theInfospectNetworkResponse
object.
Returns an instance of the InfospectNetworkResponse
class with the data populated from the provided Map.
Implementation
factory InfospectNetworkResponse.fromMap(Map map) {
return InfospectNetworkResponse(
status: map['status'] != null ? map['status'] as int : null,
size: map['size'] ?? 0,
responseTime: DateTime.fromMicrosecondsSinceEpoch(map['time']),
body: map['body'] as dynamic,
headers: (map['headers'] as Map?)?.getMap<String>(),
);
}