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 OLD_SPACE_NAME:
      if (value == null) {
        unsetOld_space_name();
      } else {
        this.old_space_name = value as Int8List?;
      }
      break;

    case NEW_SPACE_NAME:
      if (value == null) {
        unsetNew_space_name();
      } else {
        this.new_space_name = value as Int8List?;
      }
      break;

    case IF_NOT_EXISTS:
      if (value == null) {
        unsetIf_not_exists();
      } else {
        this.if_not_exists = value as bool?;
      }
      break;

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