NetworkService class abstract

Base class for all network services.

Inheritance

Constructors

NetworkService()

Properties

errorLevel Level
The level to log error messages at.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
level Level
The level to log messages at.
no setterinherited
name String
The name of the service.
no setteroverride
namespace String
The namespace to log messages under. e.g. 'Service.Auth'
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addInterceptor(Interceptor interceptor) → void
Adds an interceptor to the network service.
delete(String url, {Map<String, String>? headers, Map<String, String>? queryParameters}) Future<HttpResponse>
Sends a DELETE request to the specified url and optional headers and queryParameters.
dispose() → void
Disposes controllers, streams, etc.
inherited
get(String url, {Map<String, String>? headers, Map<String, String>? queryParameters}) Future<HttpResponse>
Sends a GET request to the specified url and optional headers and queryParameters.
log(Object message, [Object? error, StackTrace? stackTrace]) → void
Logs a message with an optional error and stack trace.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patch(String url, Object body, {Map<String, String>? headers, Map<String, String>? queryParameters}) Future<HttpResponse>
Sends a PATCH request to the specified url with the specified body and optional headers and queryParameters.
post(String url, Object body, {Map<String, String>? headers, Map<String, String>? queryParameters}) Future<HttpResponse>
Sends a POST request to the specified url with the specified body and optional headers and queryParameters.
put(String url, Object body, {Map<String, String>? headers, Map<String, String>? queryParameters}) Future<HttpResponse>
Sends a PUT request to the specified url with the specified body and optional headers and queryParameters.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

timeout Duration
The duration after which a request will be considered as timed out (default is 15 seconds).
getter/setter pair