setVolume method

Future<bool> setVolume(
  1. int newVolume
)

Set volume (0-100)

Implementation

Future<bool> setVolume(int newVolume) async {
  final success = await _service.setVolume(
    newVolume,
    _state.selectedPlayer.isNotEmpty ? _state.selectedPlayer : null,
  );
  if (success) {
    _updateState(_state.copyWith(volume: newVolume));
  } else {
    _updateState(_state.copyWith(errorMessage: 'Failed to set volume'));
  }
  return success;
}