volume_util 0.0.2 volume_util: ^0.0.2 copied to clipboard
A flutter plugin to config and monitor volume.
volume_util #
A flutter plugin to config and monitor volume. Support Android and iOS platform.
Getting Started #
Get Volume #
final VolumeUtil volumeUtil = VolumeUtil();
double volume = await volumeUtil.getVolume();
Set Volume #
double volume = 0.5;
final VolumeUtil volumeUtil = VolumeUtil();
bool success = await volumeUtil.setVolume(volume);
Listen Volume Change #
final VolumeUtil volumeUtil = VolumeUtil();
StreamSubscription ss = volumeUtil.getVolumeChangeStream().listen((volume) {
debugPrint("volume:$volume");
});
...
ss.cancel();