onPointerUpdate method

  1. @override
void onPointerUpdate(
  1. PointerMoveEvent event
)
override

Used by the Listener callback to update the drawing

Implementation

@override
void onPointerUpdate(PointerMoveEvent event) {
  if (!value.supportedPointerKinds.contains(event.kind)) return;
  if (!value.active) {
    temporaryValue = value.copyWith(
      pointerPosition: null,
    );
    return;
  }
  if (value is Drawing) {
    temporaryValue = _addPoint(event, value).copyWith(
      pointerPosition: _getPointFromEvent(event),
    );
  } else if (value is Erasing) {
    temporaryValue = _erasePoint(event).copyWith(
      pointerPosition: _getPointFromEvent(event),
    );
  }
}