v3.7.1
volume_controller
다중 플랫폼용 Flutter 볼륨 플러그인으로 시스템 볼륨을 제어합니다.
131좋아요 15.3만30일 다운로드160Pub 점수
AndroidiOSmacOSWindowsLinux
kurenai7968/volume_controller open-source repository details.
{"sdk":"flutter"}{"sdk":"flutter"}^6.0.0아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Control and observe the system volume on Android, iOS, macOS, Windows, and Linux.
>=3.44.0^3.12.0The iOS plugin uses the scene lifecycle APIs introduced for Flutter plugins in Flutter 3.38.
| Platform | Supported |
|---|---|
| Android | ✅ |
| iOS | ✅ |
| macOS | ✅ |
| Windows | ✅ |
| Linux | ✅ |
showSystemUI is supported on Android and iOS only.0 on every platform:
STREAM_MUSIC mute (isStreamMute / ADJUST_MUTE).0 and unmute restores the previous volume saved by the plugin.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.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 to true.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);