-1

I write some code to take picture and saved in getTemporaryDirectory() path variable but wheni initalize the path on _cameraController.takePicture(path); it shows me error of

    Too many positional arguments: 0 allowed, but 1 found.
    Try removing the extra positional arguments. 

    await _cameraController.takePicture(path);

i dont get which arguments is this talking about on path variable please someone help me out with this error

Here is my code for taking picture:-

void takePhoto(BuildContext context) async{

final path = join((await getTemporaryDirectory()).path,"${DateTime.now()}.png");

  await _cameraController.takePicture(path);

  Navigator.push(context, MaterialPageRoute(builder: (builder)=>CameraViewPage()));

}

this function will show me an error on await _cameraController.takePicture(path); line on path for Too many positional arguments: 0 allowed

does anyone know about this error?

Please help me,

Thank You.

Anuj Verma
  • 11
  • 4
  • 1
    The error couldn’t really be more clear. You’re passing a parameter to a method which does not accept a parameter. Please explain specifically what you don’t understand about this – Clive Mar 11 '23 at 19:16

1 Answers1

0

This method don't have parameters.

Future<XFile> takePicture()

lsaudon
  • 1,263
  • 11
  • 24