FlutterCarplay class

An object in order to integrate Apple CarPlay in navigation and manage all user interface elements appearing on your screens displayed on the CarPlay screen.

Using CarPlay, you can display content from your app on a customized user interface that is generated and hosted by the system itself. Control over UI elements, such as touch target size, font size and color, highlights, and so on.

Useful Links:

Constructors

FlutterCarplay()
Creates an FlutterCarplay and starts the connection.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListenerOnConnectionChange(dynamic onCarplayConnectionChange(CPConnectionStatusTypes status)) → void
Callback function will be fired when CarPlay connection status is changed. For example, when CarPlay is connected to the device, in the background state, or completely disconnected.
closeConnection() → void
A function that will disconnect all event listeners from CarPlay. The action will be irrevocable, and a new FlutterCarplay controller must be created after this, otherwise CarPlay will be unusable.
forceUpdateRootTemplate() → void
It will set the current root template again.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pauseConnection() → void
A function that will pause the all active event listeners from CarPlay.
removeListenerOnConnectionChange() → void
Removes the callback function that has been set before in order to listen on CarPlay connection status changed.
resumeConnection() → void
A function that will resume the paused all event listeners from CarPlay.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

connectionStatus String
Current CarPlay connection status. It will return one of CPConnectionStatusTypes as String.
no setter
rootTemplate → dynamic
Getter for current root template. Return one of type CPTabBarTemplate, CPGridTemplate, CPListTemplate
no setter

Static Methods

pop({bool animated = true, int count = 1}) Future<bool>
Removes the top-most template from the navigation hierarchy.
popModal({bool animated = true}) Future<bool>
Removes a modal template. Since CPAlertTemplate and CPActionSheetTemplate are both modals, they can be removed. If animated is true, CarPlay animates the transition between templates.
popToRoot({bool animated = true}) Future<bool>
Removes all of the templates from the navigation hierarchy except the root template. If animated is true, CarPlay animates the presentation of the template.
push({required dynamic template, bool animated = true}) Future<bool>
Adds a template to the navigation hierarchy and displays it.
setRootTemplate({required dynamic rootTemplate, bool animated = true}) → void
Sets the root template of the navigation hierarchy. If a navigation hierarchy already exists, CarPlay replaces the entire hierarchy.
showActionSheet({required CPActionSheetTemplate template, bool animated = true}) → void
It will present CPActionSheetTemplate modally.
showAlert({required CPAlertTemplate template, bool animated = true}) → void
It will present CPAlertTemplate modally.