converter property

TargetConversion? get converter

Gets or sets a converter function to apply to the data property value in order to produce the value to set to the target property. This conversion function is used in both OneWay and TwoWay bindings, when transferring a value from the source to the target. The default value is null -- no conversion takes place. Otherwise the value should be a function that takes one or two arguments and returns the desired value. However, the return value is ignored when the #targetProperty is the empty string.

Conversion functions must not have any side-effects other than setting the target property. In particular you should not try to modify the structure of the visual tree in the target GraphObject's Part's visual tree.

The function is passed the value from the source (the first argument) and the target GraphObject (the second argument). If the #targetProperty is a property name, that property is set to the function's return value. If the #targetProperty is the empty string, the function should set a property on the second argument, which will be the target GraphObject.

Implementation

_i3.TargetConversion get converter => ([
      _i2.dynamic p0,
      _i2.dynamic p1,
    ]) =>
        _i4.callMethod(
          _i4.getProperty(
            this,
            'converter',
          ),
          r'call',
          [
            this,
            p0,
            p1,
          ],
        );
set converter (TargetConversion? value)

Implementation

set converter(_i3.TargetConversion value) {
  _i4.setProperty(
    this,
    'converter',
    value == null ? _i5.undefined : _i4.allowInterop(value),
  );
}