Field<T extends Object, V> class

A field defined in a class that is relevant for its mapping.

Constructors

Field(String name, Object? getter(T)?, {String? key, FieldMode mode = FieldMode.field, Function? arg, bool opt = false, V? def, MappingHook? hook, Object? data})
const

Properties

arg Function?
An optional type factory when this field is of a generic type.
final
data Object?
final
def → V?
An optional default value for this field.
final
getter → (Object? Function(T)?)
The getter returns the fields value for a given instance.
final
hashCode int
The hash code for this object.
no setterinherited
hook MappingHook?
The optional mapping hook for this field.
final
key String
The mapping key of the field, or the name by default.
final
mode FieldMode
The mode of the field.
final
name String
The name of the field.
final
opt bool
Whether this field is optional in the class constructor.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

decode<R>(Map<String, dynamic> value, DecodingContext context) → R
encode(T value, EncodingContext context) → dynamic
get(T value) Object?
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