VolumeController class

Provides access to the system volume.

Mute is a system switch on Windows, macOS, Linux, and Android API 23+. On iOS and older Android, mute is volume 0, and unmute restores the previous level saved by this plugin.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showSystemUI ↔ bool
Whether to show the system UI when changing the volume.
getter/setter pair

Methods

addListener(void onData(double)?, {bool fetchInitialVolume = true}) → StreamSubscription<double>
Listens for system volume changes.
getVolume() → Future<double>
Current system volume, from 0.0 to 1.0.
isMuted() → Future<bool>
Whether the system volume is muted.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeListener() → Future<void>
Cancels the volume listener.
setMute(bool mute) → Future<void>
Mutes or unmutes the system volume.
setVolume(double volume) → Future<void>
Sets the system volume. Values outside 0.0–1.0 are clamped.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

instance → VolumeController
Get the singleton instance of VolumeController
no setter