stopRecording method
Stops the recording session.
Stops the recorder and transitions the status to RecorderStatus.stopping. On success the status becomes RecorderStatus.stopped; if RecorderConfiguration.continuousRecording is enabled and a chunk boundary was reached the status becomes RecorderStatus.restarting.
Returns
- GemError.success Recording stopped successfully (or restarted when chunking with continuous recording).
- GemError.recordedLogTooShort The recording was shorter than RecorderConfiguration.minDurationSeconds and was discarded.
- GemError.busy The recorder is busy and could not stop.
- GemError.general A generic error occurred while stopping the recorder.
Implementation
Future<GemError> stopRecording() async {
final String? resultString = await GemKitPlatform.instance
.getChannel(mapId: -1)
.invokeMethod<String>(
'callObjectMethod',
jsonEncode(<String, Object>{
'id': pointerId,
'class': 'Recorder',
'method': 'stopRecording',
'args': <dynamic, dynamic>{},
}),
);
return GemErrorExtension.fromCode(jsonDecode(resultString!)['result']);
}