startImageStream method
Future<void>
startImageStream(
{ - required void onImageStream(
- CameraImage image
),
})
Implementation
Future<void> startImageStream({required void Function(CameraImage image) onImageStream}) async {
if (cameraController == null) {
log("unable to startImageStream, cameraController missing");
return;
}
cameraController?.startImageStream((image) {
if (timer != null) return;
timer = Timer(const Duration(seconds: 2), () {
onImageStream(image);
timer?.cancel();
timer = null;
});
});
}