ActionSlotLayout class
Represents a customizable action slot layout for system media controls.
Controls the order and placement of media buttons (such as in Android notification and media card controls), as well as which actions appear in compact view.
- Annotations
Constructors
-
ActionSlotLayout(List<
MediaAction> slots, {List<int> ? compactActionIndices}) -
Creates a new ActionSlotLayout with the specified
slotslist.const -
ActionSlotLayout.fromMap(Map<
int, MediaAction> map, {List<int> ? compactActionIndices}) -
Creates an ActionSlotLayout from a map of slot indices to MediaAction.
factory
-
ActionSlotLayout.sequential({MediaAction skipPrevious = MediaAction.skipToPrevious, MediaAction playPause = MediaAction.play, MediaAction skipNext = MediaAction.skipToNext, MediaAction? custom1, MediaAction? custom2, List<
int> ? compactActionIndices}) -
Preset for legacy sequential layout:
[skipPrevious, playPause, skipNext, custom1, custom2].factory -
ActionSlotLayout.symmetrical({MediaAction? left, MediaAction skipPrevious = MediaAction.skipToPrevious, MediaAction playPause = MediaAction.play, MediaAction skipNext = MediaAction.skipToNext, MediaAction? right, List<
int> ? compactActionIndices}) -
Preset for modern symmetrical layout:
[left (custom1), skipPrevious, playPause, skipNext, right (custom2)].factory
Properties
-
allActions
→ Set<
MediaAction> -
Returns the set of unique MediaActions contained in the slots.
no setter
-
compactActionIndices
→ List<
int> ? -
The indices of actions from slots to display in compact mode
(e.g., collapsed Android notification).
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
slots
→ List<
MediaAction> -
The ordered list of action slots (up to 5 actions).
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serializes this layout for platform channel transmission.
-
toMap(
) → Map< int, MediaAction> - Converts the slot layout to a Map of slot index to MediaAction.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override