ApiEndpointMixin<T extends Object> class abstract

Mixin class that implements the getJson, postJson, get and post methods of ApiEndpoint.

Also implements the name field as runtimeType.toString().

Implemented types
Implementers

Constructors

ApiEndpointMixin()

Properties

deserializer JsonDeserializer<T>
Deserializes JSON to an object of type T.
no setter
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
Returns the headers for the API endpoint request.
no setterinherited
host String
The host part of the API endpoint request.
no setterinherited
name String
Returns the name of the endpoint
no setteroverride
path String
The path element for the API endpoint uri.
no setterinherited
protocol HttpProtocol
The protocol of the API endpoint.
no setterinherited
queryParameters Map<String, String>?
The query parameters for the endpoint.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serializer JsonSerializer<T>
Serializes an object of type T to JSON.
no setter

Methods

get() Future<T?>
Asynchronously returns an object of type T from the API endpoint.
override
getJson() Future<Map<String, dynamic>?>
Asynchronously gets a JSON object from the API endpoint using GET.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post(T? obj) Future<T?>
Asynchronously posts an obj of type T to the API endpoint using POST.
override
postJson(JSON? json) Future<Map<String, dynamic>?>
Asynchronously posts a json document to the API endpoint using POST.
override
toString() String
A string representation of this object.
inherited

Operators

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