v3.7.1
volume_controller
A Flutter volume plugin for multiple platform to control system volume.
131Likes 153K30-day downloads160Pub points
AndroidiOSmacOSWindowsLinux
kurenai7968/volume_controller open-source repository details.
{"sdk":"flutter"}{"sdk":"flutter"}^6.0.0English project snapshot. Visit GitHub for the latest content.
Control and observe the system volume on Android, iOS, macOS, Windows, and Linux.
>=3.44.0^3.12.0The iOS plugin uses the scene lifecycle APIs introduced for Flutter plugins in Flutter 3.38.
| Platform | Supported |
|---|---|
| Android | ✅ |
| iOS | ✅ |
| macOS | ✅ |
| Windows | ✅ |
| Linux | ✅ |
showSystemUI is supported on Android and iOS only.0 on every platform:
STREAM_MUSIC mute (isStreamMute / ADJUST_MUTE).0 and unmute restores the previous volume saved by the plugin.isMuted() is volume == 0. setMute(true) sets volume to 0; setMute(false) restores the previous volume saved by the plugin. iOS 26 AVAudioSession.setOutputMuted is not used, because it mutes this app's audio session rather than the system volume.Show or hide the volume system UI. The default value is true. Supported on iOS and Android only.
VolumeController.instance.showSystemUI = true;
Get the current system volume.
double volume = await VolumeController.instance.getVolume();
Set the system volume. The input should be in the range 0.0 to 1.0.
await VolumeController.instance.setVolume(double volume);
Add a listener to monitor system volume changes.
fetchInitialVolume: Send the current volume immediately. Defaults to true.VolumeController.instance.addListener((volume) {
// Do something with the volume
}, fetchInitialVolume: true);
Remove the volume listener.
await VolumeController.instance.removeListener();
Check whether the system is muted.
bool isMuted = await VolumeController.instance.isMuted();
Mute or unmute the system volume.
await VolumeController.instance.setMute(bool mute);