getSystemVolume method

  1. @override
Future<double?> getSystemVolume()
override

Reads the system media volume as a percentage in [0, 100], or null when the platform has no implementation.

以 [0, 100] 百分比读取系统媒体音量;平台无实现时返回 null。

Example / 示例:

final percent = await MovaPlatform.instance.getSystemVolume();

Implementation

@override
Future<double?> getSystemVolume() async {
  try {
    return await methodChannel.invokeMethod<double>('getSystemVolume');
  } on PlatformException {
    return null;
  } on MissingPluginException {
    return null;
  }
}