Cameras.fromMap constructor
fromMap is the method to convert the map to class.
Implementation
factory Cameras.fromMap(Map<String, dynamic> map) {
return Cameras(
name: map['name'] ?? '',
resolution: map['resolution'] ?? '',
videoResolution: map['videoResolution'] ?? '',
orientation: map['orientation'] ?? '',
focalLength: map['focalLength'] ?? '',
focusModes: List<String>.from(map['focusModes']),
videoSnapshotSupported: map['videoSnapshotSupported'] ?? false,
videoStabilizationSupported: map['videoStabilizationSupported'] ?? false,
zoomSupported: map['zoomSupported'] ?? false,
smoothZoomSupported: map['smoothZoomSupported'] ?? false,
autoExposureLockingSupported:
map['autoExposureLockingSupported'] ?? false,
autoWhiteBalanceLockingSupported:
map['autoWhiteBalanceLockingSupported'] ?? false,
flashSupported: map['flashSupported'] ?? false,
);
}