NetworkService class
Service for executing HTTP/REST network requests using Dio.
- Implemented types
Constructors
- NetworkService({required NetworkConfig config})
-
Creates a NetworkService instance with the specified
config.
Properties
- config → NetworkConfig
-
The network configuration containing base URL, timeouts, and headers.
final
- dio → Dio
-
Exposes the underlying
Dioinstance for advanced customizations.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delete(
String path, {dynamic data, Map< String, dynamic> ? queryParameters, bool isFormData = false, Options? options}) → Future -
Sends a DELETE request to the specified
path. -
get(
String path, {dynamic data, Map< String, dynamic> ? queryParameters, Options? options}) → Future -
Sends a GET request to the specified
path. -
init(
) → Future< void> -
Initializes the service asynchronously.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patch(
String path, {dynamic data, Map< String, dynamic> ? queryParameters, bool isFormData = false, Options? options}) → Future -
Sends a PATCH request to the specified
path. -
post(
String path, {dynamic data, Map< String, dynamic> ? queryParameters, bool isFormData = false, Options? options}) → Future -
Sends a POST request to the specified
path. -
put(
String path, {dynamic data, Map< String, dynamic> ? queryParameters, bool isFormData = false, Options? options}) → Future -
Sends a PUT request to the specified
path. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited