Event.eventType constructor

Event.eventType(
  1. String type,
  2. String name,
  3. {bool canBubble = true,
  4. bool cancelable = true}
)

Creates a new Event object of the specified type.

This is analogous to document.createEvent. Normally events should be created via their constructors, if available.

var e = new Event.type('MouseEvent', 'mousedown', true, true);

Implementation

factory Event.eventType(String type, String name,
    {bool canBubble: true, bool cancelable: true}) {
  final Event e = document._createEvent(type);
  e._initEvent(name, canBubble, cancelable);
  return e;
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-html/Event/Event.eventType.html