A Flutter plugin to monitor and adjust device volume from 0 to 100%.
To use this package, add volume_regulator as a dependency in your pubspec.yaml file.
dependencies:
volume_regulator: ^2.4.2// Import package
import 'package:volume_regulator/volume_regulator.dart';
// Set the new volume, between 0-100.
VolumeRegulator.setVolume(50);
// Get the current volume.
VolumeRegulator.getVolume().then((value) {
print(value);
});This event is fired when the volume has changed.
VolumeRegulator.volumeStream.listen((value) {
print(value);
});- iOS: SDK 10.0 (or later)
- Android: API Level 23 (or later)
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.