RestAdapter<_Model extends Model> class abstract

Constructors that convert app models to and from REST

Constructors

RestAdapter()

Properties

fromKey String?
Retrieves data under this key when deserializing from REST
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toKey String?
Submits data under this key when serializing to REST
no setter

Methods

fromRest(Map<String, dynamic> input, {required RestProvider provider, ModelRepository<RestModel>? repository}) Future<_Model>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
restEndpoint({Query? query, _Model? instance}) String?
The endpoint path to access provided a query. Must include a leading slash.
toRest(_Model input, {required RestProvider provider, ModelRepository<RestModel>? repository}) Future<Map<String, dynamic>>
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

enumValueFromName<T>(Iterable<T> enumValues, String enumName) → T?
Returns an enum value based on its string name. For example, given 'POST', and the enum enum Methods { GET, POST, DELETE }, Methods.POST is returned.
firstWhereOrNull<T>(Iterable<T> values, bool test(T item)) → T?
After Dart 2.12, firstWhere can be a non-nullable return value. Instead of an extension, a predictable static method is used instead.