SimpleOverlayNetworkLog class

Represents a network request/response log entry This class extends BaseLog and adds specific fields for network operations

Properties:

  • method: HTTP method used (GET, POST, etc.)
  • url: The request URL
  • requestHeaders: Map of request headers
  • requestBody: Request payload/body
  • statusCode: Response status code (optional)
  • responseHeaders: Map of response headers (optional)
  • responseBody: Response payload/body (optional)
  • isSuccess: Boolean indicating if the request was successful
  • timestamp: When the log was created
  • tag: Identifier for the log entry

Example usage:

NetworkLog(
  timestamp: DateTime.now(),
  tag: 'API_CALL',
  method: 'GET',
  url: 'https://api.example.com/data',
  requestHeaders: {'Content-Type': 'application/json'},
  requestBody: '',
  isSuccess: true
);
Inheritance

Constructors

SimpleOverlayNetworkLog({required DateTime timestamp, required String tag, required String method, required String url, required Map<String, String> requestHeaders, required String requestBody, int? statusCode, Map<String, String>? responseHeaders, String? responseBody, required bool isSuccess})
Creates a new NetworkLog instance

Properties

hashCode → int
The hash code for this object.
no setterinherited
isSuccess → bool
Indicates if the network request was successful
final
method → String
HTTP method used for the request (GET, POST, etc.)
final
requestBody → String
Request body/payload sent to the server
final
requestHeaders → Map<String, String>
Map of headers sent with the request
final
responseBody → String?
Response body/payload received from the server (optional)
final
responseHeaders → Map<String, String>?
Map of headers received in the response (optional)
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
statusCode → int?
Response status code from the server (optional)
final
tag → String
A string identifier used to categorize or filter logs.
finalinherited
timestamp → DateTime
The exact date and time when the log entry was created.
finalinherited
url → String
The URL that was requested
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts the NetworkLog instance to a JSON Map
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromJson(Map<String, dynamic> json) → SimpleOverlayNetworkLog
Creates a NetworkLog instance from a JSON Map