[英]Using camera package in flutter not getting picture clicked and preview
The camera package I am using is: camera: git: url: https://github.com/flutter/plugins.git path: packages/camera/camera ref: cfa709835ab85702ee8a9ed24bbe7a3fe736c3f5 The camera package I am using is: camera: git: url: https://github.com/flutter/plugins.git path: packages/camera/camera ref: cfa709835ab85702ee8a9ed24bbe7a3fe736c3f5
The code
is: code
是:
try {
final path =
join((await getTemporaryDirectory()).path, '${DateTime.now()}.png');
await controller.takePicture(**path**);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PreviewScreen(
imgPath: path,
)),
);
Same code is working fine in different project but whenever I am implementing it to existing one getting error
:相同的代码在不同的项目中运行良好,但是每当我将其实施到现有的项目中时都会
error
:
Too many positional arguments: 0 expected, but 1 found. Try removing the extra argument.
on line number 4 of code, the bold text * path在代码的第 4 行,粗体文本 *路径
When I am removing the **path from there, The console output after triggering function is:当我从那里删除**路径时,触发 function 后的控制台 output 是:
console output: I/flutter (13243): Error:Previous capture has not returned yet.
I/flutter (13243): Error message : takePicture was called before the previous capture returned.
I/flutter (13243): Error:Previous capture has not returned yet.
I/flutter (13243): Error message : takePicture was called before the previous capture returned.
Please help.请帮忙。 Sorry for my bad English.
对不起,我的英语不好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.