DioHttpService class
A concrete implementation of the HttpService interface using the dio
package.
- Implemented types
Constructors
- DioHttpService()
-
factory
- DioHttpService.internal()
Properties
- appId ↔ String
-
getter/setter pair
- appVersion ↔ String?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- platform ↔ String
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getOptionWithoutToken(
) → Options - Helper method to generate request options without authentication headers.
-
getOptionWithToken(
{Map< String, String?> ? headers}) → Future<Options> - Helper method to generate request options with authentication headers.
-
handleDeleteRequest(
String path, {Map< String, String> ? headers}) → Future<Response> -
Performs a DELETE request to the specified
path
with optionalheaders
.override -
handleDeleteRequestWithoutToken(
String path) → Future< Response> -
Performs a DELETE request to the specified
path
without including any authentication token.override -
handleGetRequest(
String path, {Map< String, String?> ? headers}) → Future<Response> -
Performs a GET request to the specified
path
with optionalheaders
.override -
handleGetRequestWithoutToken(
String path) → Future< Response> -
Performs a GET request to the specified
path
without including any authentication token.override -
handlePostRequest(
String path, dynamic data, {Map< String, String> ? headers}) → Future<Response> -
Performs a POST request to the specified
path
with the givendata
, and optionalheaders
.override -
handlePostRequestList(
String path, List? data, {Map< String, String> ? headers}) → Future<Response> -
Performs a POST request to the specified
path
with a list ofdata
items, and optionalheaders
.override -
handlePostRequestWithoutToken(
String path, [Map< String, dynamic> ? data]) → Future<Response> -
Performs a POST request to the specified
path
without including any authentication token. Accepts an optionaldata
parameter.override -
handlePutRequest(
String path, {Map< String, dynamic> ? data, Map<String, String> ? headers}) → Future<Response> -
Performs a PUT request to the specified
path
with optionaldata
andheaders
.override -
handlePutRequestWithoutToken(
String path, [Map< String, dynamic> ? data]) → Future<Response> -
Performs a PUT request to the specified
path
without including any authentication token. Accepts an optionaldata
parameter.override -
init(
{Interceptor? authInterceptor}) → Future< void> - Initializes the DioHttpService instance. Retrieves package information, sets platform details, and adds an optional auth interceptor.
-
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
Static Properties
- instance → DioHttpService
-
Singleton instance of DioHttpService
final