CPGridButton class

A menu item button displayed on a grid template. https://developer.apple.com/documentation/carplay/cpgridbutton iOS 12.0+ | iPadOS 12.0+ | Mac Catalyst 13.1+

Constructors

CPGridButton({required List<String> titleVariants, required String image, AutoImageTint? imageTint, AutoImageSize? imageSize, String? loadingImage, AutoImageTint? loadingImageTint, dynamic onPress()?, FutureOr<void> onPressWithCompletion(Future<void> complete(), CPGridButton self)?, String? id})
Creates CPGridButton

Properties

hashCode → int
The hash code for this object.
no setterinherited
image → String
The image displayed on the button.
final
imageSize → AutoImageSize?
final
imageTint → AutoImageTint?
Optional tint applied to image.
final
loadingImage → String?
Optional image swapped in while the button is in its loading state (after the user taps and before onPressWithCompletion's complete is called).
final
loadingImageTint → AutoImageTint?
Optional tint applied to loadingImage while it is displayed.
final
onPress → dynamic Function()?
The block invoked after the user taps the button. iOS 12.0+ | iPadOS 12.0+ | Mac Catalyst 13.1+
final
onPressWithCompletion → FutureOr<void> Function(Future<void> complete(), CPGridButton self)?
A loading-aware alternative to onPress. Call complete() to stop loading. Returning from this handler does not complete the interaction; throwing completes it automatically. The completion is idempotent and awaitable. Specify only one callback. Loading image rotation requires iOS 26 or later.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
titleVariants → List<String>
An array of title variants for the button. When the system displays the button, it selects the title that best fits the available screen space, so arrange the titles from most to least preferred when creating a grid button. Also, localize each title for display to the user, and be sure to include at least one title in the array. iOS 12.0+ | iPadOS 12.0+ | Mac Catalyst 13.1+
final
uniqueId → String
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

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