startRecording method

Future<GemError> startRecording()

Starts the recording session.

Initiates the recorder and transitions status to RecorderStatus.starting and then to RecorderStatus.recording on success.

Always await the returned future to ensure the operation has completed.

Returns

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']);
}