updateValue<TValue> method

void updateValue<TValue>(
  1. Object propertyKey,
  2. TValue? updator(
    1. TValue
    ), {
  3. bool requiredProperty = true,
})

更新指定 propertyKey 对应的属性值

propertyKey 属性键

updator 指定值更新处理器 当 updator 处理器返回 null 时将不回写属性值

requiredProperty 指定 propertyKey 对应属性是否必须存在, 其值为 true 时, 如 propertyKey 对应属性不存在则抛出异常 默认值为 true

Implementation

void updateValue<TValue>(Object propertyKey, TValue? Function(TValue) updator,
        {bool requiredProperty = true}) =>
    getPropertyOf<TValue, WriteableBindableProperty<TValue>>(propertyKey,
            required: requiredProperty)
        ?.update(updator);