FdcRowContext class

Public read-only row context used by calculated fields and validators.

This is intentionally a value/context API, not a record API. It lets user code inspect field values for the row being calculated or validated without exposing the dataset's internal mutable record representation.

Constructors

FdcRowContext({required Map<String, int> fieldIndexByName, required List<String> fieldNames, required List<Object?> values, List<Object?>? originalValues, List<FdcDataType>? fieldTypes, bool decimalNullAsZero = false})
Creates a FdcRowContext.
const

Properties

fieldCount int
Returns the current field count.
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

Methods

decimalOrZero(String fieldName) FdcDecimal
Returns fieldName as FdcDecimal, using FdcDecimal.zero for null or non-convertible values.
decimalOrZeroAt(int fieldIndex) FdcDecimal
Returns the value at fieldIndex as FdcDecimal, using FdcDecimal.zero for null or non-convertible values.
decimalValue(String fieldName) FdcDecimal?
Returns the raw decimal value for fieldName, or null when the field is null or cannot be converted to a decimal.
decimalValueAt(int fieldIndex) FdcDecimal?
Returns the value at fieldIndex converted to FdcDecimal, or null when it cannot be represented as a decimal.
doubleValue(String fieldName) double?
Returns fieldName converted to double, or null when unavailable.
intValue(String fieldName) int?
Returns fieldName converted to int, or null when unavailable.
isFieldChanged(String fieldName) bool
Whether the current value of fieldName differs from its original value.
isFieldChangedAt(int fieldIndex) bool
Whether the current value at fieldIndex differs from its original value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
numOrZero(String fieldName) num
Returns fieldName as num, using zero when the value is null or cannot be converted.
numOrZeroAt(int fieldIndex) num
Returns the value at fieldIndex as num, using zero when conversion is not possible.
numValue(String fieldName) num?
Returns the raw numeric value for fieldName, or null when the field is null or cannot be converted to a number.
numValueAt(int fieldIndex) num?
Returns the value at fieldIndex converted to num, or null when conversion is not possible.
originalValue(String fieldName) → dynamic
Returns the original accepted value of fieldName, or null when this context has no original-value snapshot.
originalValueAt(int fieldIndex) → dynamic
Returns the original accepted value at fieldIndex, or null when no original-value snapshot is available.
originalValuesSnapshot() List<Object?>
Returns a copy of the original accepted row values, when available.
toMap() Map<String, Object?>
Materializes the current row values as a field-name map.
toString() String
A string representation of this object.
inherited
value(String fieldName) → dynamic
Returns the runtime value for fieldName.
valueAt(int fieldIndex) → dynamic
Returns the runtime value at fieldIndex, applying decimal-null-as-zero behavior when this context was configured for calculated-field evaluation.
valuesSnapshot() List<Object?>
Returns an immutable-style copy of the row values used for validation.

Operators

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