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

A Flutter volume plugin for ios and android control system volume.

volume_controller #

This plugin allows you to control and listen to the system volume.

Variables #

  • bool showSystemUI: Show or hide the volume system UI. The default value is true.

    VolumeController.instance.showSystemUI = true;
    

Functions #

  • getVolume: Get the current volume from the system.

    double volume = await VolumeController.instance.getVolume();
    
  • setVolume: Set the system volume. The input is a double number in the range [0, 1].

    await VolumeController.instance.setVolume(double volume);
    
  • maxVolume: Set the volume to the maximum level.

    await VolumeController.instance.maxVolume();
    
  • muteVolume: Mute the system volume.

    await VolumeController.instance.muteVolume();
    
  • 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});
    
  • removeListener: Remove the volume listener.

    VolumeController.instance.removeListener();
    
85
likes
0
points
72.6k
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter volume plugin for ios and android control system volume.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on volume_controller