RestSerializable class
An annotation used to specify a class to generate code for.
Creates a serialize/deserialize function for JSON.
Heavily borrowed/inspired by JsonSerializable
Constructors
- RestSerializable({FieldRename? fieldRename, bool? nullable, RestRequestTransformer requestTransformer(Query?, RestModel?)?})
-
Creates a new RestSerializable instance.
const
Properties
- fieldRename → FieldRename
-
Defines the automatic naming strategy when converting class field names
into JSON map keys.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- nullable → bool
-
When
true
(the default),null
fields are handled gracefully when decodingnull
and nonexistent values from JSON. This indicates that the fields from REST could benull
and is not related to Dart nullability.final - requestTransformer → (RestRequestTransformer Function(Query?, RestModel?)?)
-
The interface used to determine the request to send to remote. This class
will be accessed for all provider and repository operations.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaults → const RestSerializable
- An instance of RestSerializable with all fields set to their default values.