successFunction property

(void Function(Picture, Event)?) successFunction

Gets or sets the function to call when an image set by #source loads successfully. The arguments to this function are this Picture and the HTMLImageElement's "load" Event.

This is called once per Picture, for every Picture that is using the same #source that loaded successfully. This will never be called if the #source is never set, and is not called with Pictures that use #element instead. It is even called for a Picture source that has already loaded, so that creating copies of a Picture with this property set will call it once for each newly created Picture.

The default value is null, meaning that no specific action occurs when an image finishes loading.

Implementation

void Function(
  _i3.Picture,
  _i6.Event,
)? get successFunction => (
      _i3.Picture p0,
      _i6.Event p1,
    ) =>
        _i4.callMethod(
          _i4.getProperty(
            this,
            'successFunction',
          ),
          r'call',
          [
            this,
            p0,
            p1,
          ],
        );
void successFunction=(void value(Picture, Event)?)

Implementation

set successFunction(
    void Function(
      _i3.Picture,
      _i6.Event,
    )? value) {
  _i4.setProperty(
    this,
    'successFunction',
    value == null ? _i5.undefined : _i4.allowInterop(value),
  );
}