imports_bindings library

Classes

BackgroundTransformer
The default Transformer for Dio.
BaseOptions
A set of base settings for each Dio(). BaseOptions and Options will be merged into one RequestOptions before sending the requests. See Options.compose.
CancelToken
Controls cancellation of Dio's requests.
Connectivity
Discover network connectivity configurations: Distinguish between WI-FI and cellular, check WI-FI status and more.
ConnectivityPlusLinuxPlugin
The Linux implementation of ConnectivityPlatform.
Representation of a cookie. For cookies received by the server as Cookie header values only name and value properties will be set. When building a cookie for the 'set-cookie' header in the server and when receiving cookies in the client as 'set-cookie' headers all fields can be used.
CookieJar
CookieJar is a cookie container and manager for HTTP requests.
CookieManager
Cookie manager for HTTP requests based on CookieJar.
DefaultCookieJar
DefaultCookieJar is a default cookie manager which implements the standard cookie policy declared in RFC.
Dio
Dio enables you to make HTTP requests easily.
DioMixin
Either<L, R>
Represents a value of one of two possible types, Left or Right.
Eq<T>
A type class used to determine equality between 2 instances of the same type T. Any 2 instances x and y are equal if eqv(x, y) is true.
ErrorInterceptorHandler
The handler for interceptors to handle error occurred during the request.
FeggyConnectionChecker
FeggyNetwork
A network client wrapper that provides error handling and token management.
FileStorage
Persist Cookies in the host file storage.
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
FusedTransformer
A Transformer that has a fast path for decoding UTF8-encoded JSON. If the response is utf8-encoded JSON and no custom decoder is specified in the RequestOptions, this transformer is significantly faster than the default SyncTransformer and the BackgroundTransformer. This improvement is achieved by using a fused Utf8Decoder and JsonDecoder to decode the response, which is faster than decoding the utf8-encoded JSON in two separate steps, since Dart uses a special fast decoder for this case. See https://github.com/dart-lang/sdk/blob/5b2ea0c7a227d91c691d2ff8cbbeb5f7f86afdb9/sdk/lib/_internal/vm/lib/convert_patch.dart#L40
Hash<T>
A type class used to represent a hashing scheme for objects of a given type.
Headers
The headers class for requests and responses.
HKT<G, A>
https://marcosh.github.io/post/2020/04/15/higher-kinded-types-php-solution.html https://medium.com/@gcanti/higher-kinded-types-in-flow-275b657992b7
HKT2<G1, G2, A>
HKT3<G1, G2, G3, A>
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient.
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.
IO<A>
IO<A> represents a non-deterministic synchronous computation that can cause side effects, yields a value of type A and never fails.
IOEither<L, R>
IOEither<L, R> represents a non-deterministic synchronous computation that can cause side effects, yields a value of type R or can fail by returning a value of type L.
IOOption<R>
IOOption<R> represents an synchronous computation that may fails yielding a None or returns a Some(R) when successful.
IORef<T>
Mutable reference in the IO monad.
Left<L, R>
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.
MultipartFile
An upload content that is a part of MultipartRequest. This doesn't need to correspond to a physical file.
None
Option<T>
A type that can contain a value of type T in a Some or no value with None.
Options
The configuration for a single request. BaseOptions and Options will be merged into one RequestOptions before sending the requests. See Options.compose.
Order<T>
The Order type class is used to define a total ordering on some type A.
PartialOrder<T>
The PartialOrder type class is used to define a partial ordering on some type A.
PersistCookieJar
PersistCookieJar is a cookie manager which implements the standard cookie policy declared in RFC. PersistCookieJar persists the cookies in files, if the application exit, the cookies always exist unless user explicitly called delete.
QueuedInterceptor
Interceptor in queue.
QueuedInterceptorsWrapper
A helper class to create QueuedInterceptor in ease.
Reader<R, A>
Reader<R, A> allows to read values A from a dependency/context R without explicitly passing the dependency between multiple nested function calls.
ReaderHKT
Tag the HKT2 interface for the actual Reader.
ReaderTask<E, A>
ReaderTask represents an asynchronous computation that yields a value of type A from a context of type E and never fails.
ReaderTaskEither<E, L, R>
ReaderTaskEither<E, L, R> represents an asynchronous computation (Task) that either yields a value of type R or fails yielding an error of type L (Either), that allows to read values from a dependency/context E (Reader).
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.
SerializableCookie
This class is a wrapper for Cookie class. Because the Cookie class doesn't support Json serialization, for the sake of persistence, we use this class instead of it.
Some<T>
State<S, A>
State<S, A> is used to store, update, and extract state in a functional way.
StateAsync<S, A>
StateAsync<S, A> is used to store, update, and extract async state in a functional way.
Storage
The storage concept to persist cookies.
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.
Task<A>
Task represents an asynchronous computation that yields a value of type A and never fails.
TaskEither<L, R>
TaskEither<L, R> represents an asynchronous computation that either yields a value of type R or fails yielding an error of type L.
TaskOption<R>
TaskOption<R> represents an asynchronous computation that may fails yielding a None or returns a Some(R) when successful.
Transformer
Transformer allows changes to the request/response data before it is sent/received to/from the server.
Unit
Used instead of void as a return statement for a function when no value is to be returned.
WebCookieJar
A WebCookieJar will do nothing to handle cookies since they are already handled by XHRs.

Enums

ConnectivityResult
Connection status check result.
DioExceptionType
The exception enumeration indicates what type of exception has happened during requests.
FileAccessMode
The file access mode when downloading a file, corresponds to a subset of dart:io::FileMode.
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.

Mixins

Alt<KT, A>
Alt type class identifies an associative operation on a type constructor.
Alt2<KT, A, B>
Alt3<KT, P1, P2, P3>
Applicative<G, A>
Applicative2<G, A, B>
Applicative3<G, A, B, C>
Band<T>
Bands are semigroups whose operation (i.e. combine) is also idempotent (an operation that can be applied multiple times without changing the result beyond the initial application).
BoundedSemilattice<T>
A semilattice in which:
CommutativeGroup<T>
An commutative group (also known as an abelian group) is a group whose combine operation is commutative.
CommutativeMonoid<T>
CommutativeMonoid represents a commutative monoid.
CommutativeSemigroup<T>
CommutativeSemigroup represents a commutative semigroup.
Extend<KT, A>
Extend2<KT, A, B>
Filterable<KT, A>
Foldable<G, A>
Foldable2<G, A, B>
Functor<G, A>
Functor<G, A> extends HKT<G, A> to express the fact that the classes implementing the Functor interface will need to be higher kinded types.
Functor2<G, A, B>
Functor3<G, A, B, C>
Group<T>
A group is a monoid where each element has an inverse.
Monad<KT, A>
Monad2<KT, A, B>
Monad3<KT, P1, P2, P3>
Monoid<T>
A monoid is a semigroup with an identity (empty).
OptionsMixin
The mixin class for options that provides common attributes.
Semigroup<T>
A semigroup is any set A with an associative operation (combine).
Semilattice<T>
Semilattices are commutative semigroups whose operation (i.e. combine) is also idempotent.

Extensions

CompositionEitherExtension on Task<Either<L, R>>
CompositionOptionExtension on Task<Option<T>>
CurryExtension2 on Output Function(Input1, Input2)
Extract first parameter from this function to allow curring.
CurryExtension3 on Output Function(Input1, Input2, Input3)
CurryExtension4 on Output Function(Input1, Input2, Input3, Input4)
CurryExtension5 on Output Function(Input1, Input2, Input3, Input4, Input5)
FpdartOnDateTime on DateTime
fpdart extension methods on DateTime
FpdartOnIterable on Iterable<T>
Get the first element of the Iterable. If the Iterable is empty, return None. Functional programming functions on a mutable dart Iterable using fpdart.
FpdartOnIterableOfIterable on Iterable<Iterable<T>>
Functional programming functions on Iterable<Iterable<T>> using fpdart.
FpdartOnList on List<T>
Functional programming functions on a mutable dart Iterable using fpdart.
FpdartOnMap on Map<K, V>
Functional programming functions on a mutable dart Map using fpdart.
FpdartOnOption on Option<T>
FpdartOnOptionMap on Option<Map<K, dynamic>>
FpdartOnPredicate on bool Function()
FpdartOnPredicate1 on bool Function(P)
FpdartOnString on String
Functional programming functions on dart String using fpdart.
FpdartSequenceIterableEither on Iterable<Either<E, A>>
FpdartSequenceIterableIO on Iterable<IO<T>>
FpdartSequenceIterableIOEither on Iterable<IOEither<E, T>>
FpdartSequenceIterableIOOption on Iterable<IOOption<T>>
FpdartSequenceIterableOption on Iterable<Option<T>>
FpdartSequenceIterableState on Iterable<State<S, A>>
Convert a List<State<S, A>> to a single State<S, List<A>>.
FpdartSequenceIterableTask on Iterable<Task<T>>
FpdartSequenceIterableTaskEither on Iterable<TaskEither<E, T>>
FpdartSequenceIterableTaskOption on Iterable<TaskOption<T>>
FpdartTraversableIterable on Iterable<T>
OptionsX on Options
Extension methods for Dio Options to handle common HTTP headers configuration.
UncurryExtension2 on Output Function(Input2) Function(Input1)
UncurryExtension3 on Output Function(Input3) Function(Input2) Function(Input1)
UncurryExtension4 on Output Function(Input4) Function(Input3) Function(Input2) Function(Input1)
UncurryExtension5 on Output Function(Input5) Function(Input4) Function(Input3) Function(Input2) Function(Input1)

Constants

unit → const Unit
Used instead of void as a return statement for a function when no value is to be returned.

Properties

cookieDio Dio
Provides a configured Dio instance with cookie management capabilities.
no setter
dateNow IO<DateTime>
Constructs a DateTime instance with current date and time in the local time zone.
no setter
ioRefEq Eq<IORef<Object?>>
Eq instance to compare IORefs using pointer equality
final
now IO<int>
The number of milliseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
no setter
random IO<double>
Generates a non-negative random floating point value uniformly distributed in the range from 0.0, inclusive, to 1.0, exclusive.
no setter
randomBool IO<bool>
Generates a random boolean value.
no setter

Functions

boolAndMonoid() Monoid<bool>
boolOrMonoid() Monoid<bool>
constF<A>(A a) → A Function(dynamic b)
constf a is a unary function which evaluates to a for all inputs.
defaultDioExceptionReadableStringBuilder(DioException e) String
The default implementation of building a readable string of DioException.
dualEndoMonoid<A>() Monoid<Endo<A>>
endoMonoid<A>() Monoid<Endo<A>>
identity<T>(T a) → T
Returns the given a.
identityFuture<T>(T a) Future<T>
Returns the given a, wrapped in Future.value.
left<L, R>(L l) Either<L, R>
Return a Left(l).
modifyIORef<T>(Endo<T> update, IORef<T> ref) IO<Unit>
Works almost identical to the write method, but instead of taking a value that needs to be written, takes an Endo function, applies the IORef's current value to it and writes the result to the IORef.
modifyIORefC<T>(Endo<T> update) IO<Unit> Function(IORef<T> ref)
A curried version of the modifyIORef
newIORef<T>(T initial) IO<IORef<T>>
Creates a new IORef inside an IO monad with a given initial value.
none<T>() Option<T>
Return a None.
option<T>(T value, bool predicate(T)) Option<T>
Return Some of value when predicate applied to value returns true, None otherwise.
optionOf<T>(T? t) Option<T>
Return None if t is null, Some otherwise.
randomInt(int min, int max) IO<int>
Generates a non-negative random integer uniformly distributed in the range from min, inclusive, to max, exclusive.
readIORef<T>(IORef<T> ref) IO<T>
Extracts a current value of the IORef and returns it inside the IO monad.
Return a Right(r).
some<T>(T t) Option<T>
Return a Some(t).
toBoolEither<L>(String str, L onLeft()) Either<L, bool>
Convert this String to bool, returns the result of onLeft for invalid inputs.
toBoolOption(String str) Option<bool>
Convert this String to bool, returns None for invalid inputs.
toDoubleEither<L>(L onLeft()) Either<L, double> Function(String)
Convert this String to double, returns the result of onLeft for invalid inputs.
toDoubleOption(String str) Option<double>
Convert this String to double, returns None for invalid inputs.
toIntEither<L>(L onLeft()) Either<L, int> Function(String)
Convert this String to int, returns the result of onLeft for invalid inputs.
toIntOption(String str) Option<int>
Convert this String to int, returns None for invalid inputs.
toNumEither<L>(L onLeft()) Either<L, num> Function(String)
Convert this String to num, returns the result of onLeft for invalid inputs.
toNumOption(String str) Option<num>
Convert this String to num, returns None for invalid inputs.
writeIORef<T>(T value, IORef<T> ref) IO<Unit>
Writes the given value to the IORef and returns a Unit inside the IO monad.
writeIORefC<T>(T value) IO<Unit> Function(IORef<T> ref)
A curried version of the writeIORef

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.
DioExceptionReadableStringBuilder = String Function(DioException e)
The readable string builder's signature of DioException.readableStringBuilder.
DioMediaType = MediaType
The type (alias) for specifying the content-type of the MultipartFile.
DoAdapterEither<L> = R Function<R>(Either<L, R>)
DoAdapterIO = A Function<A>(IO<A>)
DoAdapterIOEither<E> = A Function<A>(IOEither<E, A>)
DoAdapterIOOption = A Function<A>(IOOption<A>)
DoAdapterOption = A Function<A>(Option<A>)
DoAdapterReaderTask<E> = Future<A> Function<A>(ReaderTask<E, A>)
DoAdapterReaderTaskEither<E, L> = Future<A> Function<A>(ReaderTaskEither<E, L, A>)
DoAdapterTask = Future<A> Function<A>(Task<A>)
DoAdapterTaskEither<E> = Future<A> Function<A>(TaskEither<E, A>)
DoAdapterTaskOption = Future<A> Function<A>(TaskOption<A>)
DoFunctionEither<L, R> = R Function(DoAdapterEither<L> $)
DoFunctionIO<A> = A Function(DoAdapterIO $)
DoFunctionIOEither<L, A> = A Function(DoAdapterIOEither<L> $)
DoFunctionIOOption<A> = A Function(DoAdapterIOOption $)
DoFunctionOption<A> = A Function(DoAdapterOption $)
DoFunctionReaderTask<E, A> = Future<A> Function(DoAdapterReaderTask<E> $)
DoFunctionReaderTaskEither<E, L, A> = Future<A> Function(DoAdapterReaderTaskEither<E, L> $)
DoFunctionTask<A> = Future<A> Function(DoAdapterTask $)
DoFunctionTaskEither<L, A> = Future<A> Function(DoAdapterTaskEither<L> $)
DoFunctionTaskOption<A> = Future<A> Function(DoAdapterTaskOption $)
Endo<A> = A Function(A a)
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.
NetworkManagerClientFactory = NetworkManagerClient Function()
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.
Separated<KT, A, B> = (HKT<KT, A>, HKT<KT, B>)
ValidateStatus = bool Function(int? status)
The type of a response status code validate callback.

Exceptions / Errors

ApiException
Custom exception class for handling API-related errors.
CookieManagerLoadException
Thrown when the cookie manager fails to load cookies.
CookieManagerSaveException
Thrown when the cookie manager fails to save cookies.
DioException
DioException describes the exception info when a request failed.
NotNullableError<T>
A TypeError thrown by _checkNotNullable.