fieldValue method

Object? fieldValue(
  1. String fieldName
)

Returns the current value of fieldName.

During edit or insert state this reads from the active edit buffer; in browse state it reads the current stored record. Throws when there is no current record or the field name is unknown.

Implementation

Object? fieldValue(String fieldName) {
  final record = _currentRecordRaw;
  if (record == null) {
    throw StateError('Dataset has no current record.');
  }

  final index = fieldIndex(fieldName);
  if (_isEditingRecord(record)) {
    return _editCoordinator.buffer![index];
  }

  return record.valueAt(index);
}