command function Null safety

Future command(
  1. String baseName,
  2. {Map<String, dynamic> parameters = emptyBody,
  3. ResponseType responseType = ResponseType.json,
  4. dynamic additionalHeaders = emptyBody}
)

baseName is 'takePicture', not 'camera.takePicture' responseType default is ResponseType.json use ResponseType.stream if using camara.getLivePreview and the response is a stream

Implementation

Future<dynamic> command(String baseName,
    {Map<String, dynamic> parameters = emptyBody,
    ResponseType responseType = ResponseType.json,
    additionalHeaders = emptyBody}) async {
  var response = await ThetaBase.post('commands/execute',
      responseType: responseType,
      additionalHeaders: additionalHeaders,
      body: {
        'name': 'camera.$baseName',
        'parameters': parameters,
      });

  return response;
}