toRaw method

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

Implementation

@override
Pointer<RawNativeMessageEvent> toRaw([int methodLength = 0]) {
  List<int> methods = [
    stringToNativeString(jsonEncode(data)).address,
    stringToNativeString(origin).address
  ];

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

  return rawEvent;
}