Maya Paramita
Maya Paramita

Reputation: 13

Flutter How to Capture Photo Mutliple Times without User Clicking Anything

I know how to take picture from flutter by writing down this code:

var picture =  await ImagePicker.pickImage(source: ImageSource.camera);

In this code, when the camera opens, we need to push the camera button then the picture is taken.

But how can we take multiple pictures at once without pushing the camera button? (e.g. for every second, flutter take 10 picture at once then the camera close itself and return to the next code).

Upvotes: 1

Views: 1547

Answers (1)

krumpli
krumpli

Reputation: 742

You have to create a cameraController:

_controller = CameraController(
      widget.camera,
    );

Then, what i do is to set this inside a timer

await _controller.takePicture(path);

Upvotes: 2

Related Questions