getVolume static method
Get the current volume level. From 0.0 to 1.0.
Use stream
to set the audio stream type on Android.
Implementation
static Future<double?> getVolume({
AudioStream stream = _defaultAudioStream,
}) async {
final receivedValue = await methodChannel.invokeMethod<String>(
MethodName.getVolume,
{
if (Platform.isAndroid) MethodArg.audioStream: stream.index,
},
);
return receivedValue != null ? double.parse(receivedValue) : null;
}