DioClient class

A client for making network requests using Dio.

Constructors

DioClient({required Dio dio, FutureOr<Map<String, dynamic>> customHeaders()?, FutureOr<Map<String, dynamic>> customQuery()?, required PlayxNetworkClientSettings settings})

Properties

customHeaders FutureOr<Map<String, dynamic>> Function()?
final
customQuery FutureOr<Map<String, dynamic>> Function()?
final
dio Dio
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings PlayxNetworkClientSettings
final

Methods

attachLogSettings(PlayxNetworkLoggerSettings logSettings) bool
delete<T>(String path, {Object body = const {}, Map<String, dynamic> headers = const {}, Map<String, dynamic> query = const {}, Options? options, String? contentType, bool attachCustomHeaders = true, bool attachCustomQuery = true, CancelToken? cancelToken, PlayxNetworkLoggerSettings? logSettings}) Future<Response>
download<T>(String path, {required dynamic savePath, Map<String, dynamic> headers = const {}, Map<String, dynamic> query = const {}, Options? options, bool attachCustomHeaders = true, bool attachCustomQuery = true, CancelToken? cancelToken, ProgressCallback? onReceiveProgress, bool deleteOnError = true, String lengthHeader = Headers.contentLengthHeader, Object? data, PlayxNetworkLoggerSettings? logSettings, FileAccessMode fileAccessMode = FileAccessMode.write}) Future<Response>
Download file from the given url
get<T>(String path, {Map<String, dynamic> headers = const {}, Map<String, dynamic> query = const {}, Options? options, bool attachCustomHeaders = true, bool attachCustomQuery = true, CancelToken? cancelToken, ProgressCallback? onReceiveProgress, PlayxNetworkLoggerSettings? logSettings}) Future<Response>
sends a GET request to the given url
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patch<T>(String path, {Object body = const {}, Map<String, dynamic> headers = const {}, Map<String, dynamic> query = const {}, Options? options, String? contentType, bool attachCustomHeaders = true, bool attachCustomQuery = true, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, PlayxNetworkLoggerSettings? logSettings}) Future<Response>
post<T>(String path, {Object body = const {}, Map<String, dynamic> headers = const {}, Map<String, dynamic> query = const {}, Options? options, String? contentType, bool attachCustomHeaders = true, bool attachCustomQuery = true, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, PlayxNetworkLoggerSettings? logSettings}) Future<Response>
sends a POST request to the given url
put<T>(String path, {Object body = const {}, Map<String, dynamic> headers = const {}, Map<String, dynamic> query = const {}, Options? options, String? contentType, bool attachCustomHeaders = true, bool attachCustomQuery = true, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, PlayxNetworkLoggerSettings? logSettings}) Future<Response>
toString() String
A string representation of this object.
inherited

Operators

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