Control and observe the system volume on Android, iOS, macOS, Windows, and Linux.
- Flutter
>=3.44.0 - Dart
^3.12.0
The iOS plugin uses the scene lifecycle APIs introduced for Flutter plugins in Flutter 3.38.
| Platform | Supported |
|---|---|
| Android | ✅ |
| iOS | ✅ |
| macOS | ✅ |
| Windows | ✅ |
| Linux | ✅ |
- iOS volume control must be tested on a real device. The simulator does not support system volume control.
showSystemUIis supported on Android and iOS only.- Mute is not volume
0on every platform:- Windows, macOS, Linux: system mute. Volume can stay non-zero while muted.
- Android API 23+:
STREAM_MUSICmute (isStreamMute/ADJUST_MUTE). - Android API 21–22: mute sets volume to
0and unmute restores the previous volume saved by the plugin. - iOS: there is no public system media mute API.
isMuted()isvolume == 0.setMute(true)sets volume to0;setMute(false)restores the previous volume saved by the plugin. iOS 26AVAudioSession.setOutputMutedis 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 totrue.
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);