DioLink class

A simple HttpLink implementation using Dio.

To use non-standard Request and Response shapes you can override serializeRequest, parseResponse

Constructors

Properties

client → Dio
Dio client instance.
final
defaultHeaders Map<String, String>
Default HTTP headers
final
endpoint String
Endpoint of the GraphQL service
final
hashCode int
The hash code for this object.
no setterinherited
parser → ResponseParser
Parser used to parse response
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serializableErrors bool
Whether errors should be serializable. Must be set to true when the errors should be able to be sent across isolate boundaries. In particular, setting this to true causes the FormData of dio.RequestOptions of dio.DioException to be stripped out from thrown Exceptions, along with other potentially non-serializable fields like callbacks or the cancel token.
final
serializer → RequestSerializer
Serializer used to serialize request
final
useGETForQueries bool
Whether to use a GET request for queries.
final

Methods

close({bool force = false}) → void
Closes the underlining Dio client
concat(Link next) → Link
Adds next after this link
inherited
dispose() Future<void>
Can be called to clean up resources
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
request(Request request, [NextLink? forward]) Stream<Response>
A function called when a request reaches this Link
route(LinkRouter route) → Link
Route requests after this link
inherited
split(bool test(Request request), Link left, [Link right = const PassthroughLink()]) → Link
Split requests after this link
inherited
toString() String
A string representation of this object.
inherited

Operators

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