setVolume method

Future<bool> setVolume(
  1. Device device,
  2. int volume
)

setVolume Will lower or raise the volume to the indicated device - 0% to 100%

Implementation

Future<bool> setVolume(Device device, int volume) async {
  try {
    final command = 'SoundVolumeView /SetVolume ${device.name} $volume';
    await shell.run(command);
    return true;
  } catch( error ) {
    return false;
  }
}