toMap method

Map<String, Object?> toMap()

Converts this object to a map.

Implementation

Map<String, Object?> toMap() {
  return <String, Object?>{
    if (cameraResolution != null)
      'cameraResolution': <int>[
        cameraResolution!.width.toInt(),
        cameraResolution!.height.toInt(),
      ],
    'facing': cameraDirection.rawValue,
    'lensType': cameraLensType.rawValue,
    if (formats.isNotEmpty)
      'formats': formats.map((f) => f.rawValue).toList(),
    'returnImage': returnImage,
    'speed': detectionSpeed.rawValue,
    'timeout': detectionTimeoutMs,
    'torch': torchEnabled,
    'invertImage': invertImage,
    'autoZoom': autoZoom,
    'initialZoom': initialZoom,
  };
}