Future<Null> cancel()

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).

The object is no longer usable after this method has been called.

Source

Future<Null> cancel() {
  return TestAsyncUtils.guard(() async {
    assert(_pointer._isDown);
    await _dispatcher(_pointer.cancel(), _result);
    assert(!_pointer._isDown);
    return null;
  });
}