Skip to content Skip to sidebar Skip to footer

Flutter Takepicture() Function Does Not Take An Image Path As Stated In The Flutter Docs

I am currently trying to code a camera app, which captures an image and displays it through a separate widget. For that I use the Flutter docs here. This is the the full code.

Solution 1:

Your code will work with this version of the camera plugin

dependencies:camera:0.5.8+17

Since version 0.6.x takePicture has no parameter. If you want to run it with the latest plugin version, take a look at the current example.

Solution 2:

A bit late, but maybe this will help other to use the last camera version. The controller -> takePicture() method return a XFile and XFile object have a method saveTo()

      XFile picture = await controller.takePicture();
      picture.saveTo(filePath);

Post a Comment for "Flutter Takepicture() Function Does Not Take An Image Path As Stated In The Flutter Docs"