dispatchPointerEvent method

  1. @override
Future<void> dispatchPointerEvent(
  1. PointerEvent event

Converts the PointerEvent and sends an Android MotionEvent to the view.

This method can only be used if a PointTransformer is provided to AndroidViewController.pointTransformer. Otherwise, an AssertionError is thrown. See AndroidViewController.sendMotionEvent for sending a MotionEvent without a PointTransformer.

The Android MotionEvent object is created with MotionEvent.obtain. See documentation of MotionEvent.obtain for description of the parameters.


Future<void> dispatchPointerEvent(PointerEvent event) async {
  if (event is PointerHoverEvent) {

  if (event is PointerDownEvent) {


  final AndroidMotionEvent? androidEvent =

  if (event is PointerUpEvent) {
  } else if (event is PointerCancelEvent) {

  if (androidEvent != null) {
    await sendMotionEvent(androidEvent);