startRecording method

Future<GemError> startRecording()

Starts the recording.

Initiates the recording process and transitions the recorder status to RecorderStatus.starting first. If the start is successful, the status will change to RecorderStatus.recording. A notification is issued upon successful start.

Returns

Throws

  • An exception if it fails.

Implementation

Future<GemError> startRecording() async {
  final String? resultString = await GemKitPlatform.instance
      .getChannel(mapId: -1)
      .invokeMethod<String>(
        'callObjectMethod',
        jsonEncode(<String, Object>{
          'id': _pointerId,
          'class': 'Recorder',
          'method': 'startRecording',
          'args': <dynamic, dynamic>{},
        }),
      );
  return GemErrorExtension.fromCode(jsonDecode(resultString!)['result']);
}