getProperty<TValue> method

  1. @override
BindableProperty<TValue>? getProperty<TValue>(
  1. Object propertyKey, {
  2. bool required = false,
})
override

获取指定 propertyKey 对应的属性

propertyKey 属性键

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

Implementation

@override
BindableProperty<TValue>? getProperty<TValue>(Object propertyKey,
    {bool required = false}) {
  var property = _properties?[propertyKey] as BindableProperty<TValue>?;
  if (required && property == null)
    throw NotfoundPropertyException(propertyKey);
  return property;
}