sendCustomNavigationAutoEvent method

Future<void> sendCustomNavigationAutoEvent(
  1. String event,
  2. Object data
)

Sends a custom event from Flutter to the native Android Auto or CarPlay implementation.

This allows you to communicate custom data from your Flutter app to your native Android Auto screen or CarPlay scene delegate implementations.

The event parameter identifies the type of event being sent. The data parameter contains the event payload, which can be any serializable type.

Note: You must handle this event in your native implementation:

  • Android: Override the event handling in your AndroidAutoBaseScreen subclass
  • iOS: Override the event handling in your BaseCarSceneDelegate subclass

Example:

await autoViewController.sendCustomNavigationAutoEvent(
  'showMenu',
  {'menuId': 'myMenu'}
);

Implementation

Future<void> sendCustomNavigationAutoEvent(String event, Object data) {
  return GoogleMapsNavigationPlatform.instance.autoAPI
      .sendCustomNavigationAutoEvent(event: event, data: data);
}