toRaw method

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

Implementation

@override
Pointer<RawNativeCloseEvent> toRaw([int methodLength = 0]) {
  List<int> methods = [
    code,
    stringToNativeString(reason).address,
    wasClean ? 1 : 0
  ];

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

  return rawEvent;
}