createSyntheticPointerEvent function
SyntheticPointerEvent
createSyntheticPointerEvent({
- SyntheticPointerEvent? 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,
- num? pointerId,
- num? width,
- num? height,
- num? pressure,
- num? tangentialPressure,
- num? tiltX,
- num? tiltY,
- num? twist,
- String? pointerType,
- bool? isPrimary,
Returns a newly constructed SyntheticPointerEvent 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
SyntheticPointerEvent createSyntheticPointerEvent({
SyntheticPointerEvent? 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,
num? pointerId,
num? width,
num? height,
num? pressure,
num? tangentialPressure,
num? tiltX,
num? tiltY,
num? twist,
String? pointerType,
bool? isPrimary,
}) {
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,
),
'pointerId': pointerId ?? baseEvent?.pointerId,
'width': width ?? baseEvent?.width,
'height': height ?? baseEvent?.height,
'pressure': pressure ?? baseEvent?.pressure,
'tangentialPressure': tangentialPressure ?? baseEvent?.tangentialPressure,
'tiltX': tiltX ?? baseEvent?.tiltX,
'tiltY': tiltY ?? baseEvent?.tiltY,
'twist': twist ?? baseEvent?.twist,
'pointerType': pointerType ?? baseEvent?.pointerType,
'isPrimary': isPrimary ?? baseEvent?.isPrimary,
}) as SyntheticPointerEvent;
}