utils/ap_utils library

Classes

ApUtils
BackgroundTransformer
The default Transformer for Dio.
BaseOptions
The base config for the Dio instance, used by Dio.options.
CancelToken
Controls cancellation of Dio's requests.
Dio
Dio enables you to make HTTP requests easily.
DioMixin
ErrorInterceptorHandler
The handler for interceptors to handle error occurred during the request.
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
Headers
The headers class for requests and responses.
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
Interceptor helps to deal with RequestOptions, Response, and DioException during the lifecycle of a request before it reaches users.
Interceptors
A Queue-Model list for Interceptors.
InterceptorsWrapper
A helper class to create interceptors in ease.
ListParam<T>
Indicates a param being used as queries or form data, and how does it gets formatted.
LogInterceptor
LogInterceptor is used to print logs during network requests. It should be the last interceptor added, otherwise modifications by following interceptors will not be logged. This is because the execution of interceptors is in the order of addition.
LostData
The response object of ImagePicker.retrieveLostData.
LostDataResponse
The response object of ImagePicker.getLostData.
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.
PackageInfoPlusLinuxPlugin
The Linux implementation of PackageInfoPlatform.
PackageInfoPlusWindowsPlugin
The Windows implementation of PackageInfoPlatform.
PickedFile
A PickedFile is a cross-platform, simplified File abstraction.
QueuedInterceptor
Interceptor in queue.
QueuedInterceptorsWrapper
A helper class to create queued-interceptors in ease.
RedirectRecord
A record that records the redirection happens during requests, including status code, request method, and the location.
RequestInterceptorHandler
The handler for interceptors to handle before the request has been sent.
RequestOptions
The internal request option class that is the eventual result after BaseOptions and Options are composed.
Response<T>
The Response class contains the payload (could be transformed) that respond from the request, and other information of the response.
ResponseBody
The response wrapper class for adapters.
ResponseInterceptorHandler
The handler for interceptors to handle after respond.
SyncTransformer
If you want to custom the transformation of request/response data, you can provide a Transformer by your self, and replace the transformer by setting the Dio.transformer.
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.
XFile
A CrossFile is a cross-platform, simplified File abstraction.

Enums

CameraDevice
Which camera to use when picking images/videos while source is ImageSource.camera.
DioExceptionType
The exception enumeration indicates what type of exception has happened during requests.
ImageSource
Specifies the source where the picked image should come from.
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
Indicates which transformation should be applied to the response data.
RetrieveType
The type of the retrieved data in a LostDataResponse.
StorageDirectory
Corresponds to constants defined in Androids android.os.Environment class.

Mixins

OptionsMixin
The mixin class for options that provides common attributes.

Constants

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

Properties

disablePathProviderPlatformOverride bool
no getter

Functions

getApplicationCacheDirectory() Future<Directory>
Path to a directory where the application may place application-specific cache files.
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.
getExternalCacheDirectories() Future<List<Directory>?>
Paths to directories where application specific cache data can be stored externally.
getExternalStorageDirectories({StorageDirectory? type}) Future<List<Directory>?>
Paths to directories where application specific data can be stored externally.
getExternalStorageDirectory() Future<Directory?>
Path to a directory where the application may access top level storage.
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.

Typedefs

DefaultTransformer = SyncTransformer
DioError = DioException
DioError describes the exception info when a request failed.
DioErrorType = DioExceptionType
Deprecated in favor of DioExceptionType and will be removed in future major versions.
HeaderForEachCallback = void Function(String name, List<String> values)
The signature that iterates header fields.
InterceptorErrorCallback = void Function(DioException error, ErrorInterceptorHandler handler)
The signature of Interceptor.onError.
InterceptorSendCallback = void Function(RequestOptions options, RequestInterceptorHandler handler)
The signature of Interceptor.onRequest.
InterceptorSuccessCallback = void Function(Response response, ResponseInterceptorHandler handler)
The signature of Interceptor.onResponse.
JsonDecodeCallback = FutureOr Function(String)
The callback definition for decoding a JSON string.
JsonEncodeCallback = FutureOr<String> Function(Object)
The callback definition for encoding a JSON object.
ProgressCallback = void Function(int count, int total)
The type of a progress listening callback when sending or receiving data.
RequestEncoder = FutureOr<List<int>> Function(String request, RequestOptions options)
The type of a request encoding callback.
ResponseDecoder = FutureOr<String?> Function(List<int> responseBytes, RequestOptions options, ResponseBody responseBody)
The type of a response decoding callback.
ValidateStatus = bool Function(int? status)
The type of a response status code validate callback.

Exceptions / Errors

DioException
DioException describes the exception info when a request failed.
MissingPlatformDirectoryException
An exception thrown when a directory that should always be available on the current platform cannot be obtained.
NotNullableError<T>
A TypeError thrown by _checkNotNullable.