$filter<TValue> static method
BindableProperty<TValue>
$filter<TValue>(
- ValueListenable<
TValue> valueListenable, { - required bool filter(
- TValue value
- required TValue initial,
- PropertyValueChanged<
TValue> ? valueChanged,
过滤指定 ValueListenable 得到一个新的绑定属性
valueListenable
指定来源 ValueListenable
filter
指定过滤方法,当此方法返回值为 true
时则将此值写入属性
initial
指定初始值
valueChanged
指定属性值变更后的回调方法
Implementation
static BindableProperty<TValue> $filter<TValue>(
ValueListenable<TValue> valueListenable,
{required bool Function(TValue value) filter,
required TValue initial,
PropertyValueChanged<TValue>? valueChanged}) =>
TransformBindableProperty(valueListenable,
transformer: (TValue value) => filter(value) ? value : null,
initial: initial,
valueChanged: valueChanged);