positionSetting property

DisplayPosition? positionSetting

Returns the value of the positionSetting field. Returns null if the field is not defined in the message.

Implementation

DisplayPosition? get positionSetting {
  final field = getField(UserProfilePositionSettingField.ID);
  if (field != null && field.isValid()) {
    var subField = field.getValidSubField(fields);
    final value = field.getValue(subField: subField);
    if (value == null) {
      return null;
    }
    return DisplayPositionExt.fromValue(value);
  } else {
    return null;
  }
}
void positionSetting=(DisplayPosition? value)

Sets the positionSetting field with value. Throws FieldNotDefinedError if the field is not defined in the message.

Implementation

set positionSetting(DisplayPosition? value) {
  final field = getField(UserProfilePositionSettingField.ID);

  if (field != null) {
    if (value == null) {
      field.clear();
    } else {
      var subField = field.getValidSubField(fields);
      field.setValue(0, value.value, subField);
    }
  } else {
    throw FieldNotDefinedError(field!.name);
  }
}