CameraConfiguration.fromJson constructor

CameraConfiguration.fromJson(
  1. Map<String, dynamic> json
)

Creates a new instance from a JSON map.

Implementation

factory CameraConfiguration.fromJson(Map<String, dynamic> json) {
  return CameraConfiguration(
    captureType: json['captureType'] == null
        ? CaptureType.video
        : CaptureType.fromJson(json['captureType']),
    captureCount: json['captureCount'] == null
        ? CaptureCount.multi
        : CaptureCount.fromJson(json['captureCount']),
    photoClipDuration: (json['photoClipDuration'] as num?)?.toDouble() ?? 5.0,
  );
}