DVProtocolContract class

Everything a client and a backend must agree on: model fields and their types, backend function signatures, and the sync schema.

Constructors

DVProtocolContract({List<DVProtocolModel> models = const <DVProtocolModel>[], List<DVProtocolEnum> enums = const <DVProtocolEnum>[], List<DVProtocolFunction> functions = const <DVProtocolFunction>[]})
const

Properties

enums → List<DVProtocolEnum>
final
functions → List<DVProtocolFunction>
final
hashCode → int
The hash code for this object.
no setterinherited
models → List<DVProtocolModel>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shape → String
The digest of the contract the protocol integer stands for: the first eight hex digits of SHA-256 over toJson.
no setter

Methods

enumNamed(String name) → DVProtocolEnum?
function(String name) → DVProtocolFunction?
model(String name) → DVProtocolModel?
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
The canonical form: every list sorted by name, so the same contract written in a different order is the same JSON and the same shape.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

fromJson(Map<String, Object?> json) → DVProtocolContract