setFieldValue method

dynamic setFieldValue(
  1. int fieldID,
  2. Object? value
)
override

Set a field's value by fieldId. Primitive types must be "boxed" in the appropriate object wrapper type.

Implementation

setFieldValue(int fieldID, Object? value) {
  switch (fieldID) {
    case TTL_DURATION:
      if (value == null) {
        unsetTtl_duration();
      } else {
        this.ttl_duration = value as int?;
      }
      break;

    case TTL_COL:
      if (value == null) {
        unsetTtl_col();
      } else {
        this.ttl_col = value as Int8List?;
      }
      break;

    case COMMENT:
      if (value == null) {
        unsetComment();
      } else {
        this.comment = value as Int8List?;
      }
      break;

    default:
      throw new ArgumentError("Field $fieldID doesn't exist!");
  }
}