FaceDetectionConfig.fromMap constructor

FaceDetectionConfig.fromMap(
  1. Map<String, dynamic>? map
)

Implementation

factory FaceDetectionConfig.fromMap(Map<String, dynamic>? map) {
  if (map == null) return FaceDetectionConfig();

  return FaceDetectionConfig(
    message: map['message'] ?? '',
    messageStyle: Utils.getTextStyle(map['messageStyle']) ??
        const TextStyle(color: Colors.white),
    showControls: Utils.getBool(map['showControls'], fallback: true),
    showCaptureControl:
        Utils.getBool(map['showCaptureControl'], fallback: true),
    showFlashControl: Utils.getBool(map['showFlashControl'], fallback: true),
    showCameraLensControl:
        Utils.getBool(map['showCameraLensControl'], fallback: true),
    showStatusMessage:
        Utils.getBool(map['showStatusMessage'], fallback: true),
    indicatorShape: _parseIndicatorShape(map['indicatorShape']),
    autoDisableCaptureControl:
        Utils.getBool(map['autoDisableCaptureControl'], fallback: false),
    autoCapture: Utils.getBool(map['autoCapture'], fallback: false),
    imageResolution: _parseImageResolution(map['imageResolution']),
    defaultFlashMode: _parseFlashMode(map['defaultFlashMode']),
    orientation: _parseOrientation(map['orientation']),
    performanceMode: _parsePerformanceMode(map['performanceMode']),
    accuracyConfig: _parseAccuracyConfig(map['accuracyConfig']),
  );
}