toRaw method

  1. @override
Pointer<RawNativeGestureEvent> toRaw([
  1. int methodLength = 0
])
override

Implementation

@override
Pointer<RawNativeGestureEvent> toRaw([int methodLength = 0]) {
  List<int> methods = [
    stringToNativeString(state).address,
    stringToNativeString(direction).address,
    doubleToUint64(deltaX),
    doubleToUint64(deltaY),
    doubleToUint64(velocityX),
    doubleToUint64(velocityY),
    doubleToUint64(scale),
    doubleToUint64(rotation)
  ];

  Pointer<RawNativeGestureEvent> rawEvent = super.toRaw(methods.length).cast<RawNativeGestureEvent>();
  Uint64List bytes = rawEvent.ref.bytes.asTypedList((rawEvent.ref.length + methods.length));
  bytes.setAll(rawEvent.ref.length, methods);

  return rawEvent;
}