KRestApi<CacheType> class abstract

Base class for concrete API clients owned by an KRestApiBase.

Subclasses receive their parent KRestApiBase through the constructor and can read shared state such as baseUrl and per-client cache values from it.

Example:

class ChatsApi extends kickin.Api<Map<String, dynamic>> { // Map<String, dynamic> is the type of the cache for this API client
  ChatsApi(super.parent);
}

Use this for API modules that need access to the shared base configuration.

Constructors

KRestApi(KRestApiBase _parent)

Properties

baseUrl String
no setter
cache → CacheType?
no setter
hashCode int
The hash code for this object.
no setterinherited
id String
If you are using multiple KRestApi instance on the same parent, you must override the id to prevent cache conflicts.
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearCache() → void
headerWithJsonContentType([Map<String, String>? headers]) Map<String, String>
joinWithBaseUrl(String endpoint) String
Only use when baseUrl is not provided by the parent KRestApiBase or when you want to override it for a specific API client.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setCache(CacheType value) → void
toString() String
A string representation of this object.
inherited

Operators

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