WaveformPlayerController class
Controller for WaveformPlayer to programmatically control playback.
Create a controller and pass it to WaveformPlayer.controller:
final controller = WaveformPlayerController();
WaveformPlayer(
audioUrl: 'https://example.com/audio.mp3',
controller: controller,
)
// Later:
await controller.play();
await controller.pause();
controller.seekToPercentage(0.5);
Constructors
Properties
- duration → Duration
-
Gets the total duration.
no setter
- errorMessage → String?
-
Gets the error message if any.
no setter
- hasError → bool
-
Gets whether there's an error.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAttached → bool
-
Whether a WaveformPlayer is currently attached.
no setter
- isLoading → bool
-
Gets whether the player is loading.
no setter
- isPlaying → bool
-
Gets the current playing state.
no setter
- position → Duration
-
Gets the current position.
no setter
- positionPercentage → double
-
Gets the current position as a percentage (0.0 to 1.0).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
attach(
WaveformPlayerDelegate delegate) → void - Attaches this controller to a WaveformPlayer's state.
-
detach(
) → void - Detaches this controller from the WaveformPlayer.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → Future< void> - Pauses the audio.
-
play(
) → Future< void> - Plays the audio.
-
seekTo(
Duration position) → Future< void> - Seeks to a specific position.
-
seekToPercentage(
double percentage) → Future< void> - Seeks to a specific position as a percentage (0.0 to 1.0).
-
togglePlayPause(
) → Future< void> - Toggles play/pause state.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited