createSyntheticFocusEvent function

SyntheticFocusEvent createSyntheticFocusEvent({
  1. SyntheticFocusEvent? baseEvent,
  2. bool? bubbles,
  3. bool? cancelable,
  4. Object? currentTarget,
  5. bool? defaultPrevented,
  6. void preventDefault()?,
  7. void stopPropagation()?,
  8. num? eventPhase,
  9. bool? isTrusted,
  10. Object? nativeEvent,
  11. Object? target,
  12. num? timeStamp,
  13. String? type,
  14. Object? relatedTarget,
})

Returns a newly constructed SyntheticFocusEvent 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 baseEvents with the named parameters provided. The named parameters takes precedence, and therefore can be used to override specific fields on the baseEvent.

Implementation

SyntheticFocusEvent createSyntheticFocusEvent({
  SyntheticFocusEvent? 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,
  /*DOMEventTarget*/ Object? relatedTarget,
}) {
  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,
    ),
    'relatedTarget': relatedTarget ?? baseEvent?.relatedTarget,
  }) as SyntheticFocusEvent;
}