TechproCarPlatform class abstract

The native side of techpro_carplay, as seen from Dart.

Apps use TechproCar.instance instead. Tests can set instance to a fake, such as FakeCarPlatform from package:techpro_carplay/testing.dart.

Messages are plain maps. Dart → native: setRoot, push, update, showAlert (with an encoded template or alert), pop, popToRoot, dismissAlert and getConnection. Native → Dart events:

Event Args
connectionChanged connected (bool), platform (carPlay or androidAuto)
select templateId, elementId: a list item, grid item or button was tapped
popped templateId: the user went back from that screen in the car
alertDismissed alertId: the car closed the alert
Inheritance
  • Object
  • PlatformInterface
  • TechproCarPlatform
Implementers

Constructors

TechproCarPlatform()
Creates a platform. Subclass this; don't implement it.

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

dismissAlert() → Future<void>
Closes the alert, if one is shown.
getConnection() → Future<Map<String, Object?>>
Returns the current connection, in the same format as the connectionChanged event.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pop() → Future<void>
Removes the top screen.
popToRoot() → Future<void>
Removes every screen except the root.
push(Map<String, Object?> template) → Future<void>
Shows template on top of the current screen.
setEventHandler(CarEventHandler? handler) → void
Sets the function that receives native events, or null to stop.
setRoot(Map<String, Object?> template) → Future<void>
Replaces the whole screen stack with template.
showAlert(Map<String, Object?> alert) → Future<void>
Shows alert on top of the current screen.
toString() → String
A string representation of this object.
inherited
update(Map<String, Object?> template) → Future<void>
Replaces the screen whose id matches template in place.

Operators

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

Static Properties

instance ↔ TechproCarPlatform
The platform in use. Defaults to MethodChannelTechproCar.
getter/setter pair