ComputedFieldTransform class

Adds a computed field based on existing fields.

Inheritance

Constructors

ComputedFieldTransform(String fieldName, dynamic compute(Map<String, dynamic> data), {TransformPhase phase = TransformPhase.both})
Creates a ComputedFieldTransform.

Properties

compute → dynamic Function(Map<String, dynamic> data)
The function to compute the field value.
final
fieldName String
The name of the new field.
final
hashCode int
The hash code for this object.
no setterinherited
name String
Optional name for debugging.
no setterinherited
phase TransformPhase
When to apply this transform.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

appliesIn(TransformPhase phase) bool
Whether this transform should apply in the given phase.
inherited
apply(Map<String, dynamic> data) Map<String, dynamic>
Applies the transform to data.
override
applyAsync(Map<String, dynamic> data) Future<Map<String, dynamic>>
Applies the transform asynchronously.
inherited
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