volume_controller 3.3.3 copy "volume_controller: ^3.3.3" to clipboard
volume_controller: ^3.3.3 copied to clipboard

A Flutter volume plugin for multiple platform to control system volume.

Volume Controller #

This plugin allows you to control and listen to the system volume on your device. It provides a simple API to get, set and monitor the system volume.

Notes #

For iOS, you need to test on a real device as the simulator does not support volume control.

Supported Platforms #

Platform Supported
Android
iOS
macOS
Windows
Linux ❌ (Coming soon)

Variables #

ShowSystemUI #

Show or hide the volume system UI. The default value is true. Supported on iOS and Android only.

VolumeController.instance.showSystemUI = true;
copied to clipboard

Functions #

GetVolume #

Get the current volume from the system

double volume = await VolumeController.instance.getVolume();
copied to clipboard

SetVolume #

Set the system volume. The input is a double number in the range [0.0, 1.0].

await VolumeController.instance.setVolume(double volume);
copied to clipboard

AddListener #

Add a listener to monitor system volume changes.

  • fetchInitialVolume: This parameter is optional and is used to fetch the initial volume when the listener is added. The default value is true.
VolumeController.instance.addListener((volume) {
  // Do something with the volume
}, fetchInitialVolume: true);
copied to clipboard

RemoveListener #

Remove the volume listener.

VolumeController.instance.removeListener();
copied to clipboard

IsMuted #

Check if the system volume is muted. On iOS and Android, this checks if the volume level is equal to 0.

bool isMuted = await VolumeController.instance.isMuted();
copied to clipboard

SetMute #

Mute or unmute the system volume. On iOS and Android, this sets the volume level to 0, and restores the previous volume level when unmuted.

await VolumeController.instance.setMute(bool mute);
copied to clipboard
96
likes
160
points
116k
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.26 - 2025.04.10

A Flutter volume plugin for multiple platform to control system volume.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on volume_controller