sendCustomNavigationAutoEvent method
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
AndroidAutoBaseScreensubclass - iOS: Override the event handling in your
BaseCarSceneDelegatesubclass
Example:
await autoViewController.sendCustomNavigationAutoEvent(
'showMenu',
{'menuId': 'myMenu'}
);
Implementation
Future<void> sendCustomNavigationAutoEvent(String event, Object data) {
return GoogleMapsNavigationPlatform.instance.autoAPI
.sendCustomNavigationAutoEvent(event: event, data: data);
}