value property
T
value
override
获取值
Implementation
T get value {
super.collect();
if (_dirty) {
dynamic currentValue = _excute();
if (currentValue != _data) {
_data = currentValue;
/// 数据发生改变,
Ref.update(() {}, UpdateOptions(refs: [this]));
}
_dirty = false;
}
return _data;
}
data
设置值,触发全部依赖的widget更新
Implementation
@override
set value(dynamic val) {
print('app wrong: RefCompute set value 不能赋值!');
throw new TypeError();
}