NetworkClient class

A utility class for handling HTTP requests with consistent error handling and configuration.

Constructors

NetworkClient.new({required String baseUrl, required String apiKey, Client? client})
Creates a new NetworkClient.

Properties

apiKey String
The API key to be included in requests.
final
baseUrl String
The base URL for API requests.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Closes the HTTP client.
getJson(String endpoint) Future<Map<String, dynamic>>
Performs a GET request and returns the parsed JSON response.
getJsonList(String endpoint) Future<List>
Performs a GET request and returns the parsed JSON response as a list.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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