CPListItem class
A selectable row in a list template. https://developer.apple.com/documentation/carplay/cplistitem iOS 12.0+ | iPadOS 12.0+ | Mac Catalyst 13.1+
- Inheritance
-
- Object
- CPListTemplateItem
- CPListItem
Constructors
-
CPListItem({String? text, String? detailText, FutureOr<
void> onPress(dynamic complete(), CPListItem self)?, String? image, AutoImageTint? imageTint, String? accessoryImage, String? trailingImage, AutoImageTint? trailingImageTint, double? playbackProgress, bool? isPlaying, CPListItemPlayingIndicatorLocation? playingIndicatorLocation, CPListItemAccessoryType? accessoryType, String? id}) - Creates CPListItem that manages the content of a single row in a CPListTemplate. CarPlay manages the layout of a list item and may adjust its layout to allow for the display of auxiliary content, such as, an accessory or a Now Playing indicator. A list item can display primary text, secondary text, now playing indicators as playback progress, an accessory image and a trailing image.
Properties
- accessoryImage ↔ String?
-
Backward compatible trailing accessory image.
getter/setter pair
- accessoryType ↔ CPListItemAccessoryType?
-
The accessory that the list item displays in its trailing region.
iOS 14.0+ | iPadOS 14.0+ | Mac Catalyst 14.0+
getter/setter pair
- detailText ↔ String?
-
The list item’s secondary text.
iOS 12.0+ | iPadOS 12.0+ | Mac Catalyst 13.1+
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- image ↔ String?
-
The image that the list item displays in its leading region.
getter/setter pair
- imageTint ↔ AutoImageTint?
-
Optional tint applied to image. Use AutoImageTint.platform when the
host should choose a selected or focused row safe color.
getter/setter pair
- isPlaying ↔ bool?
-
A Boolean value that determines whether the list item displays its Now Playing indicator.
iOS 14.0+ | iPadOS 14.0+ | Mac Catalyst 14.0+
getter/setter pair
-
onPress
→ FutureOr<
void> Function(dynamic complete(), CPListItem self)? -
An optional closure that CarPlay invokes when the user selects the list item.
iOS 14.0+ | iPadOS 14.0+ | Mac Catalyst 14.0+
final
- playbackProgress ↔ double?
-
The playback progress status for the content that the list item represents.
iOS 14.0+ | iPadOS 14.0+ | Mac Catalyst 14.0+
getter/setter pair
- playingIndicatorLocation ↔ CPListItemPlayingIndicatorLocation?
-
The location where the list item displays its Now Playing indicator.
iOS 14.0+ | iPadOS 14.0+ | Mac Catalyst 14.0+
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text ↔ String?
-
The item’s primary text.
iOS 14.0+ | iPadOS 14.0+ | Mac Catalyst 14.0+
getter/setter pairinherited
- trailingImage ↔ String?
-
The image that the list item displays in its trailing region.
getter/setter pair
- trailingImageTint ↔ AutoImageTint?
-
Optional tint applied to trailingImage.
getter/setter pair
- uniqueId → String
-
no setteroverride
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setAccessoryImage(
String? accessoryImage) → void - Updating the image displayed in the trailing region of the list item cell.
-
setAccessoryType(
CPListItemAccessoryType accessoryType) → void - Setter for accessoryType
-
setDetailText(
String detailText) → void - Updating the list item's secondary text.
-
setImage(
String image, {AutoImageTint? imageTint}) → void - Updating the image which will be displayed on the leading edge of the list item cell.
-
setImageTint(
AutoImageTint? imageTint) → void -
Updates the tint applied to image. Pass
nullto remove the tint. -
setIsPlaying(
bool isPlaying) → void - Setter for isPlaying
-
setPlaybackProgress(
double playbackProgress) → void - Setter for playbackProgress When the given value is not between 0.0 and 1.0, throws RangeError
-
setPlayingIndicatorLocation(
CPListItemPlayingIndicatorLocation playingIndicatorLocation) → void - Setter for playingIndicatorLocation
-
setText(
String text) → void - Updating the list item's primary text.
-
setTrailingImage(
String trailingImage, {AutoImageTint? imageTint}) → void - Updating the image displayed on the trailing edge of the list item cell.
-
setTrailingImageTint(
AutoImageTint? imageTint) → void -
Updates the tint applied to trailingImage. Pass
nullto remove it. -
toJson(
) → Map< String, dynamic> -
override
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
{String? text, String? detailText, String? image, AutoImageTint? imageTint, String? accessoryImage, String? trailingImage, AutoImageTint? trailingImageTint, double? playbackProgress, bool? isPlaying, CPListItemPlayingIndicatorLocation? playingIndicatorLocation, CPListItemAccessoryType? accessoryType}) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited