gotoPreset method Null safety

Future<bool> gotoPreset(
  1. String profileToken,
  2. Preset preset
)

Operation to go to a saved preset position for the Preset in the selected profile. The operation is supported if there is support for at least on PTZ preset by the Preset.

Implementation

Future<bool> gotoPreset(String profileToken, Preset preset) async {
  loggy.debug('gotoPreset');

  final envelope = await Soap.retrieveEnvelope(
      uri, onvif.secureRequest(SoapRequest.gotoPreset(profileToken, preset)));

  if (envelope.body.gotoPresetResponse == null) {
    throw Exception();
  }

  return true;
}