DioLink class Null safety
A simple HttpLink implementation using Dio.
To use non-standard Request and Response shapes
you can override serializeRequest, parseResponse
Constructors
-
DioLink(String endpoint, {required Dio client, Map<
String, String> defaultHeaders = const {}, RequestSerializer serializer = const RequestSerializer(), ResponseParser parser = const ResponseParser()})
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.
read-onlyinherited
- parser → ResponseParser
-
Parser used to parse response
final
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- serializer → RequestSerializer
-
Serializer used to serialize request
final
Methods
-
close(
{bool force = false}) → void - Closes the underlining Dio client
-
concat(
Link next) → Link -
Adds
nextafter this linkinherited -
dispose(
) → Future< void> -
Can be called to clean up resources
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
request(
Request request, [NextLink? forward]) → Stream< Response> -
A function called when a request reaches this Link
override
-
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