FlowPlayer class

Manage behaviour of audio player


FlowPlayer({AudioPlayer? mockedAudioPlayer, LoopMode loopMode = LoopMode.off, double volume = 1})
mockedAudioPlayer is audioPlayer used Useful for testing


hashCode int
The hash code for this object.
no setterinherited
loopMode → LoopMode
AudioPlayer loopMode Useful for make music loop infinite
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
volume double
Volume used for current player Updated at every play call
getter/setter pair


loadAsset(String asset) Future<void>
Load audio from app assets asset need to have full assets path
loadUrl(String url) Future<void>
Load audio from url (network) Stop current playing audio if any
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
pause() Future<void>
Pause current audio played
play() Future<void>
Play current loaded audio Update configuration (volume and loopMode)
restart() Future<void>
Restart current loaded audio Useful for effect like click sound that have to be played multiple time
setVolume(double volume) Future<void>
Set volume of current flow Only updated when calling play method
stop() Future<void>
Stop current audio played
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.