createPortWithCallback function

int createPortWithCallback(
  1. void callback(
    1. dynamic
    )
)

Implementation

int createPortWithCallback(void Function(dynamic) callback) {
  final port = ReceivePort()..listen(callback);
  return port.sendPort.nativePort;
}