createSyntheticMouseEvent function
SyntheticMouseEvent
createSyntheticMouseEvent({
- SyntheticMouseEvent? baseEvent,
- bool? bubbles,
- bool? cancelable,
- Object? currentTarget,
- bool? defaultPrevented,
- void preventDefault()?,
- void stopPropagation()?,
- num? eventPhase,
- bool? isTrusted,
- Object? nativeEvent,
- Object? target,
- num? timeStamp,
- String? type,
- bool? altKey,
- num? button,
- num? buttons,
- num? clientX,
- num? clientY,
- bool? ctrlKey,
- Object? dataTransfer,
- bool? metaKey,
- num? pageX,
- num? pageY,
- num? screenX,
- num? screenY,
- bool? shiftKey,
Returns a newly constructed SyntheticMouseEvent instance.
In addition to creating empty instances (by invoking without any parameters) or completely custom instances
by using the named parameters, this function will merge previously existing baseEvent
s with the named parameters provided.
The named parameters takes precedence, and therefore can be used to override specific fields on the baseEvent
.
Implementation
SyntheticMouseEvent createSyntheticMouseEvent({
SyntheticMouseEvent? baseEvent,
bool? bubbles,
bool? cancelable,
Object? currentTarget,
bool? defaultPrevented,
void Function()? preventDefault,
void Function()? stopPropagation,
num? eventPhase,
bool? isTrusted,
Object? nativeEvent,
Object? target,
num? timeStamp,
String? type,
bool? altKey,
num? button,
num? buttons,
num? clientX,
num? clientY,
bool? ctrlKey,
Object? dataTransfer,
bool? metaKey,
num? pageX,
num? pageY,
/*DOMEventTarget*/ Object? relatedTarget,
num? screenX,
num? screenY,
bool? shiftKey,
}) {
return jsifyAndAllowInterop({
..._wrapBaseEventPropertiesInMap(
baseEvent: baseEvent,
bubbles: bubbles,
cancelable: cancelable,
currentTarget: currentTarget,
defaultPrevented: defaultPrevented,
preventDefault: preventDefault,
stopPropagation: stopPropagation,
eventPhase: eventPhase,
isTrusted: isTrusted,
nativeEvent: nativeEvent,
target: target,
timeStamp: timeStamp,
type: type,
),
'altKey': altKey ?? baseEvent?.altKey ?? false,
'button': button ?? baseEvent?.button,
'buttons': buttons ?? baseEvent?.buttons,
'clientX': clientX ?? baseEvent?.clientX,
'clientY': clientY ?? baseEvent?.clientY,
'ctrlKey': ctrlKey ?? baseEvent?.ctrlKey ?? false,
'dataTransfer': dataTransfer ?? baseEvent?.dataTransfer,
'metaKey': metaKey ?? baseEvent?.metaKey ?? false,
'pageX': pageX ?? baseEvent?.pageX,
'pageY': pageY ?? baseEvent?.pageY,
'relatedTarget': relatedTarget ?? baseEvent?.relatedTarget,
'screenX': screenX ?? baseEvent?.screenX,
'screenY': screenY ?? baseEvent?.screenY,
'shiftKey': shiftKey ?? baseEvent?.shiftKey ?? false,
}) as SyntheticMouseEvent;
}