dispatchEvent method

Future<void> dispatchEvent(
  1. Finder finder,
  2. Event event, {
  3. void before(
    1. Element
    )?,
  4. bool pump = true,
})

Implementation

Future<void> dispatchEvent(Finder finder, web.Event event,
    {void Function(web.Element)? before, bool pump = true}) async {
  var element = _findDomElement(finder);

  var source = (element.renderObject as DomRenderObject).node;
  if (source is web.Element) {
    before?.call(source);
    source.dispatchEvent(event);
  }

  if (pump) {
    await pumpEventQueue();
  }
}