cancel method Null safety

Future<void> cancel(
  1. {Duration timeStamp = Duration.zero}
)

End the gesture by canceling the pointer (as would happen if the system showed a modal dialog on top of the Flutter application, for instance).

Implementation

Future<void> cancel({ Duration timeStamp = Duration.zero }) {
  return TestAsyncUtils.guard<void>(() async {
    assert(_pointer._isDown);
    await _dispatcher(_pointer.cancel(timeStamp: timeStamp));
    assert(!_pointer._isDown);
  });
}