onPointerCancel method

  1. @override
void onPointerCancel(
  1. PointerCancelEvent event
)
override

Used by the Listener callback to stop displaying the cursor

Implementation

@override
void onPointerCancel(PointerCancelEvent event) {
  if (!value.supportedPointerKinds.contains(event.kind)) return;
  if (value is Drawing) {
    value = _finishLineForState(_addPoint(event, value)).copyWith(
      pointerPosition: null,
      activePointerIds:
          value.activePointerIds.where((id) => id != event.pointer).toList(),
    );
  } else if (value is Erasing) {
    value = _erasePoint(event).copyWith(
      pointerPosition: null,
      activePointerIds:
          value.activePointerIds.where((id) => id != event.pointer).toList(),
    );
  }
}