defaultListenerSetup static method

Message defaultListenerSetup({
  1. required dynamic namespace,
  2. required dynamic targetMethod,
  3. required dynamic targetMethodCancellation,
  4. Payload? args,
})

Remember that proto3 doesn't allow required fields anymore. AND, Message was generated by our .proto config file. Because of this I put this 'factory' here as an extension.

Implementation

static Message defaultListenerSetup({
  required namespace,
  required targetMethod,
  required targetMethodCancellation,
  Payload? args,
}) {
  return Message(
    header: Header(
      id: '_',
      namespace: namespace,
      targetMethod: targetMethod,
      targetMethodCancellation: targetMethodCancellation,
      platformCallBackMethodHandler:
          PlatformEntrypoint.platformCallBackMethodHandler,
      intent: Header_CommunicationType.SETUP,
    ),
    payload: args,
  );
}