MouseEvent class
MouseEvent is an event triggered by mouse gestures. In contrast
to the fundamental html.MouseEvent class it can represent
the mouse events in a drag operation. Instead of a bare bone
'mouse move' event it can represent a 'mouse hover' or
a 'mouse drag' event.
class MouseEvent {
static const int CLICK = 0;
static const int DOUBLE_CLICK = 1;
static const int DRAG_START = 2;
static const int DRAG = 3;
static const int DRAG_END = 4;
static const int HOVER = 5;
/// the type of the mouse event
final int type;
/// the underlying DOM mouse event
final html.MouseEvent event;
/**
* Create a mouse event of type [type] connected to the
* underlying DOM mouse [event].
*/
MouseEvent(this.type, this.event);
String get _typeAsString {
switch(type) {
case CLICK: return "CLICK";
case DOUBLE_CLICK: return "DOUBLE_CLICK";
case DRAG: return "DRAG";
case DRAG_START: return "DRAG_START";
case DRAG_END: return "DRAG_END";
case HOVER: return "HOVER";
}
}
/// returns true if this mouse event is a drag event
bool get isDragEvent => type == DRAG_START || type == DRAG ||
type == DRAG_END;
@override
toString() => "{MouseEvent: type=${_typeAsString}, x=${event.offset.x},"
" y=${event.offset.y}";
}
Static Properties
Constructors
new MouseEvent(int type, MouseEvent event) #
Create a mouse event of type type connected to the underlying DOM mouse event.
MouseEvent(this.type, this.event);
Properties
final MouseEvent event #
the underlying DOM mouse event
final html.MouseEvent event