MtCarPlayHandler class

Manages CarPlay integration for audio apps.

Handles connection lifecycle, template updates, navigation stack, and automatic playback state synchronization with the player.

Example:

final handler = MtCarPlayHandler(
  delegate: myCarPlayDelegate,
  playerStreams: (
    playbackState: player.playbackStateStream,
    positionState: player.positionStateStream,
    currentItem: player.currentItemStream,
  ),
);
await handler.init();

Constructors

MtCarPlayHandler({required MtCarPlayDelegate delegate, required MtCarPlayPlayerStreams playerStreams})
Creates a CarPlay handler.

Properties

connectionStream Stream<bool>
Stream of connection status changes.
no setter
hashCode int
The hash code for this object.
no setterinherited
isConnected bool
Whether CarPlay is currently connected.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() Future<void>
Disposes resources.
init() Future<void>
Initializes the CarPlay handler.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pop() Future<bool>
Pops the top template from the navigation stack.
popToRoot() Future<void>
Pops to the root template.
refresh() Future<void>
Refreshes the CarPlay content.
showNowPlaying() Future<void>
Shows the Now Playing screen.
toString() String
A string representation of this object.
inherited

Operators

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