toRaw method

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

Implementation

@override
Pointer<RawNativeTouchEvent> toRaw([int methodLength = 0]) {
  List<int> methods = [
    touches.toNative().address,
    touches.length,
    targetTouches.toNative().address,
    targetTouches.length,
    changedTouches.toNative().address,
    changedTouches.length,
    altKey ? 1 : 0,
    metaKey ? 1 : 0,
    ctrlKey ? 1 : 0,
    shiftKey ? 1 : 0
  ];

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

  return rawEvent;
}