Search packages, repositories and app categories

Package detailsv3.7.1

volume_controller

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

AndroidiOSmacOSWindowsLinux
30-day downloads
187K
Likes
132
Pub points
160

Install package

flutter pub add volume_controller

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The volume_controller package is a cross-platform Flutter plugin that enables developers to control system volume across Android, iOS, macOS, Windows, and Linux. It provides a simple API to adjust, mute, and query volume levels, making it ideal for media apps, audio tools, or any application requiring system-level audio control. The plugin abstracts platform-specific implementations, ensuring consistent behavior across devices. It supports both stream-based volume monitoring and direct volume manipulation. Built with ease of integration in mind, it works seamlessly within existing Flutter projects.

Use cases

  • Media player volume control
  • Audio app system integration
  • Accessibility tools
  • Automated testing of audio features
  • System-wide volume adjustments

Key features

  • Cross-platform support (Android, iOS, macOS, Windows, Linux)
  • Volume level adjustment and muting
  • Real-time volume monitoring via streams
  • Simple, consistent API
  • Platform abstraction for native volume controls

Suitable for

  • Developers building audio-centric apps
  • Apps needing system volume access
  • Multi-platform audio utilities
  • Testing audio behaviors across OSes

Considerations

  • Requires appropriate platform permissions
  • Behavior may vary slightly between OSes
  • Limited to system volume (not app-specific)
  • Not suitable for low-level audio processing
  • May require user permission on some platforms

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Volume Controller

pub package license

Control and observe the system volume on Android, iOS, macOS, Windows, and Linux.

Requirements

  • Flutter >=3.44.0
  • Dart ^3.12.0

The iOS plugin uses the scene lifecycle APIs introduced for Flutter plugins in Flutter 3.38.

Supported Platforms

Platform Supported
Android ✅
iOS ✅
macOS ✅
Windows ✅
Linux ✅

Notes

  • iOS volume control must be tested on a real device. The simulator does not support system volume control.
  • showSystemUI is supported on Android and iOS only.
  • Mute is not volume 0 on every platform:
    • Windows, macOS, Linux: system mute. Volume can stay non-zero while muted.
    • Android API 23+: STREAM_MUSIC mute (isStreamMute / ADJUST_MUTE).
    • Android API 21–22: mute sets volume to 0 and unmute restores the previous volume saved by the plugin.
    • iOS: there is no public system media mute API. 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.

Variables

ShowSystemUI

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

VolumeController.instance.showSystemUI = true;

Functions

GetVolume

Get the current system volume.

double volume = await VolumeController.instance.getVolume();
SetVolume

Set the system volume. The input should be in the range 0.0 to 1.0.

await VolumeController.instance.setVolume(double volume);
AddListener

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);
RemoveListener

Remove the volume listener.

await VolumeController.instance.removeListener();
IsMuted

Check whether the system is muted.

bool isMuted = await VolumeController.instance.isMuted();
SetMute

Mute or unmute the system volume.

await VolumeController.instance.setMute(bool mute);

Categories

Source repository

Projects using this package