ap_utils library Null safety

Classes

ApUtils
BaseOptions
The common config for the Dio instance. dio.options is a instance of BaseOptions
CancelToken
You can cancel a request by using a cancel token. One token can be shared with different requests. when a token's cancel method invoked, all requests with this token will be cancelled.
DefaultTransformer
Dio
A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, File downloading etc. and Dio is very easy to use. [...]
DioMixin
ErrorInterceptorHandler
Handler for error interceptor.
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
Headers
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient. [...]
ImagePicker
Provides an easy way to pick an image/video from the image library, or to take a picture/video with the camera.
Interceptor
Dio instance may have interceptor(s) by which you can intercept requests/responses/errors before they are handled by then or catchError.
Interceptors
Interceptors are a queue, and you can add any number of interceptors, All interceptors will be executed in first in first out order.
InterceptorsWrapper
InterceptorsWrapper is a helper class, which is used to conveniently create interceptor(s). More details see Interceptor.
Lock
Add lock/unlock API for interceptors.
LogInterceptor
LogInterceptor is used to print logs during network requests. It's better to add LogInterceptor to the tail of the interceptor queue, otherwise the changes made in the interceptor behind A will not be printed out. This is because the execution of interceptors is in the order of addition.
LostData
The response object of ImagePicker.retrieveLostData. [...]
MultipartFile
A file to be uploaded as part of a MultipartRequest. This doesn't need to correspond to a physical file. [...]
Options
Every request can pass an Options object which will be merged with Dio.options
PackageInfo
Application metadata. Provides application bundle information on iOS and application package information on Android.
PickedFile
A PickedFile is a cross-platform, simplified File abstraction. [...]
RedirectRecord
RequestInterceptorHandler
Handler for request interceptor.
RequestOptions
Response<T>
Response describes the http Response info.
ResponseBody
ResponseInterceptorHandler
Handler for response interceptor.
Toast
Copy from https://github.com/appdev/FlutterToast Source Code https://github.com/appdev/FlutterToast/blob/4d446c80a1807094a3e10c8293e4b7f3c6429f9d/lib/toast.dart
ToastView
ToastWidget
Transformer
Transformer allows changes to the request/response data before it is sent/received to/from the server. [...]

Mixins

OptionsMixin

Constants

kTypeImage → const String
Denotes that an image is being picked.
'image'
kTypeVideo → const String
Denotes that a video is being picked.
'video'

Properties

disablePathProviderPlatformOverride bool
@Deprecated('This is no longer necessary, and is now a no-op'), @visibleForTesting, write-only

Functions

getApplicationDocumentsDirectory() Future<Directory>
Path to a directory where the application may place data that is user-generated, or that cannot otherwise be recreated by your application. [...]
getApplicationSupportDirectory() Future<Directory>
Path to a directory where the application may place application support files. [...]
getDownloadsDirectory() Future<Directory?>
Path to the directory where downloaded files can be stored. This is typically only relevant on desktop operating systems. [...]
getExternalCacheDirectories() Future<List<Directory>?>
Paths to directories where application specific external cache data can be stored. These paths typically reside on external storage like separate partitions or SD cards. Phones may have multiple storage directories available. [...]
getExternalStorageDirectories({StorageDirectory? type}) Future<List<Directory>?>
Paths to directories where application specific data can be stored. These paths typically reside on external storage like separate partitions or SD cards. Phones may have multiple storage directories available. [...]
getExternalStorageDirectory() Future<Directory?>
Path to a directory where the application may access top level storage. The current operating system should be determined before issuing this function call, as this functionality is only available on Android. [...]
getLibraryDirectory() Future<Directory>
Path to the directory where application can store files that are persistent, backed up, and not visible to the user, such as sqlite.db. [...]
getTemporaryDirectory() Future<Directory>
Path to the temporary directory on the device that is not backed up and is suitable for storing caches of downloaded files. [...]

Enums

CameraDevice
Which camera to use when picking images/videos while source is ImageSource.camera. [...]
DioErrorType
ImageSource
Specifies the source where the picked image should come from.
ListFormat
ListFormat specifies the array format (a single parameter with multiple parameter or multiple parameters with the same name) and the separator for array items.
ResponseType
ResponseType indicates which transformation should be automatically applied to the response data by Dio.
RetrieveType
The type of the retrieved data in a LostDataResponse.
StorageDirectory
Corresponds to constants defined in Androids android.os.Environment class. [...]

Typedefs

CancelWrapper = Future Function(Future)
EnqueueCallback = FutureOr Function()
HeaderForEachCallback = void Function(String name, List<String> values)
InterceptorErrorCallback = void Function(DioError e, ErrorInterceptorHandler handler)
InterceptorSendCallback = void Function(RequestOptions options, RequestInterceptorHandler handler)
InterceptorSuccessCallback = void Function(Response e, ResponseInterceptorHandler handler)
JsonDecodeCallback = dynamic Function(String)
The default Transformer for Dio. If you want to custom the transformation of request/response data, you can provide a Transformer by your self, and replace the DefaultTransformer by setting the dio.Transformer.
ProgressCallback = void Function(int count, int total)
Callback to listen the progress for sending/receiving data. [...]
RequestEncoder = List<int> Function(String request, RequestOptions options)
ResponseDecoder = String Function(List<int> responseBytes, RequestOptions options, ResponseBody responseBody)
ValidateStatus = bool Function(int? status)
VoidCallback = dynamic Function()

Exceptions / Errors

DioError
DioError describes the error info when request failed.
MissingPlatformDirectoryException
An exception thrown when a directory that should always be available on the current platform cannot be obtained.