ApiService class abstract
ApiService is the main class to use to make API calls. This use an instance of Dio (possibly created using DioClient) and has several methods to automatize data extraction
Constructors
- ApiService.new(Dio _dio)
-
const
Properties
Methods
-
compute<
T> (Future< Response> request, {String? mapperKey, T mapper(Map<String, dynamic> )?, T messageMapper(String)?}) → Future<T> - A Dio fetch call needs to be computed to extract data or resolve to an ApiError. You are responsible of your compute logic as it should match with your needs.
-
defaultExtractResult<
T> (Map< String, dynamic> data, String? mapperKey, T mapper(Map<String, dynamic> )?, T messageMapper(String)?) → T -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withAuth(
) → Map< String, dynamic> -
Adding this to your Dio request options will trigger
the
_AuthorizationInterceptor
to inject authorization headers before executing the API call.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited