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, dynamic onPress(dynamic complete(), CPListItem self)?, String? image, 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
- 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
- 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 → dynamic 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
- uniqueId → String
-
no setteroverride
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setAccessoryType(
CPListItemAccessoryType accessoryType) → void - Setter for accessoryType
-
setDetailText(
String detailText) → void - Updating the list item's secondary text.
-
setImage(
String image) → void - Updating the image which will be displayed on the leading edge of the list item cell.
-
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.
-
toJson(
) → Map< String, dynamic> -
override
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
{String? text, String? detailText, String? image, double? playbackProgress, bool? isPlaying, CPListItemPlayingIndicatorLocation? playingIndicatorLocation, CPListItemAccessoryType? accessoryType}) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited