MediaAction class
Represents a media playback action triggered by system media controls.
Constructors
-
MediaAction(String name, {Duration? seekPosition, String? customIconResource, String? customLabel, Map<
String, dynamic> ? customExtras}) -
Creates a new MediaAction instance with the given
nameand optionalseekPosition.const -
MediaAction.custom({required String name, required String customLabel, required String customIconResource, Map<
String, dynamic> ? customExtras}) -
Creates a custom media action for Android.
factory
Properties
-
customExtras
→ Map<
String, dynamic> ? -
Optional bundle of extra data to pass with the custom action.
final
- customIconResource → String?
-
The Android resource name for the icon (e.g., 'ic_favorite_border').
final
- customLabel → String?
-
The label to display for this custom action.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- name → String
-
The unique name of the action.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- seekPosition → Duration?
-
Optional seek position in milliseconds (only set for seekTo actions).
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts this action to a JSON map.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- fastForward → const MediaAction
- Action to fast-forward playback by a standard interval.
- pause → const MediaAction
- Action to pause playback.
- play → const MediaAction
- Action to resume playback.
- repeat → const MediaAction
- Action to toggle repeat mode.
- rewind → const MediaAction
- Action to rewind playback by a standard interval.
- seekTo → const MediaAction
- Action to seek to a specific position.
- shuffle → const MediaAction
- Action to toggle shuffle mode.
- skipToNext → const MediaAction
- Action to skip to the next track.
- skipToPrevious → const MediaAction
- Action to skip to the previous track.
- stop → const MediaAction
- Action to stop playback.