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
fieldNameas FdcDecimal, using FdcDecimal.zero for null or non-convertible values. -
decimalOrZeroAt(
int fieldIndex) → FdcDecimal -
Returns the value at
fieldIndexas FdcDecimal, using FdcDecimal.zero for null or non-convertible values. -
decimalValue(
String fieldName) → FdcDecimal? -
Returns the raw decimal value for
fieldName, ornullwhen the field is null or cannot be converted to a decimal. -
decimalValueAt(
int fieldIndex) → FdcDecimal? -
Returns the value at
fieldIndexconverted to FdcDecimal, ornullwhen it cannot be represented as a decimal. -
doubleValue(
String fieldName) → double? -
Returns
fieldNameconverted to double, ornullwhen unavailable. -
intValue(
String fieldName) → int? -
Returns
fieldNameconverted to int, ornullwhen unavailable. -
isFieldChanged(
String fieldName) → bool -
Whether the current value of
fieldNamediffers from its original value. -
isFieldChangedAt(
int fieldIndex) → bool -
Whether the current value at
fieldIndexdiffers from its original value. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
numOrZero(
String fieldName) → num -
Returns
fieldNameas num, using zero when the value is null or cannot be converted. -
numOrZeroAt(
int fieldIndex) → num -
Returns the value at
fieldIndexas num, using zero when conversion is not possible. -
numValue(
String fieldName) → num? -
Returns the raw numeric value for
fieldName, ornullwhen the field is null or cannot be converted to a number. -
numValueAt(
int fieldIndex) → num? -
Returns the value at
fieldIndexconverted to num, ornullwhen conversion is not possible. -
originalValue(
String fieldName) → dynamic -
Returns the original accepted value of
fieldName, ornullwhen this context has no original-value snapshot. -
originalValueAt(
int fieldIndex) → dynamic -
Returns the original accepted value at
fieldIndex, ornullwhen 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