availableCameras method
Enumerate camera devices. The result is stable for the lifetime of the process.
Implementation
@override
Future<List<XCameraDescription>> availableCameras() async {
final raw = await _invoke<List<Object?>>('availableCameras');
return raw
.map((e) {
final m = (e as Map).cast<Object?, Object?>();
return XCameraDescription(
id: m['id'] as String,
lens: _parseLens(m['lens'] as String?),
sensorOrientation: (m['sensorOrientation'] as num?)?.toInt() ?? 0,
);
})
.toList(growable: false);
}