DOMMouseEvent<T>.synthetic constructor

DOMMouseEvent<T>.synthetic({
  1. DOMTreeMap<T>? treeMap,
  2. Object? event,
  3. Object? eventTarget,
  4. DOMNode? target,
  5. Point<num>? client,
  6. Point<num>? offset,
  7. Point<num>? page,
  8. Point<num>? screen,
  9. int button = 0,
  10. int? buttons,
  11. bool altKey = false,
  12. bool ctrlKey = false,
  13. bool shiftKey = false,
  14. bool metaKey = false,
})

Creates an artificial event. Useful to generated events programmatically.

Implementation

factory DOMMouseEvent.synthetic({
  DOMTreeMap<T>? treeMap,
  Object? event,
  Object? eventTarget,
  DOMNode? target,
  Point<num>? client,
  Point<num>? offset,
  Point<num>? page,
  Point<num>? screen,
  int button = 0,
  int? buttons,
  bool altKey = false,
  bool ctrlKey = false,
  bool shiftKey = false,
  bool metaKey = false,
}) {
  client ??= Point(0, 0);

  return DOMMouseEvent(
      treeMap ?? DOMTreeMapDummy(DOMGeneratorDummy()),
      event,
      eventTarget,
      target,
      client,
      offset ?? client,
      page ?? client,
      screen ?? client,
      button,
      buttons,
      altKey,
      ctrlKey,
      shiftKey,
      metaKey);
}