ApiService class
This class represents an API service that handles HTTP requests. It provides a method to create a Dio instance with customized options and interceptors. Creates a Dio instance with customized options and interceptors.
The Dio instance is configured with a connect timeout of API_GET_AWAY_TIME_OUT milliseconds. It also adds an interceptor that sets the necessary headers for the API request. Additionally, it includes interceptors for handling the response and error cases.
Returns the created Dio instance.
Example usage:
final apiService = ApiService();
final dio = apiService.createDio();
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createDio(
) → Dio -
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