我使用的相机包是: 相机: 吉特: 网址:https://github.com/flutter/plugins.git 路径:包/相机/相机 参考:cfa709835ab85702ee8a9ed24bbe7a3fe736c3f5
code
是:
try {
final path =
join((await getTemporaryDirectory()).path, '${DateTime.now()}.png');
await controller.takePicture(**path**);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PreviewScreen(
imgPath: path,
)),
);
相同的代码在不同的项目中运行良好,但每当我将其实施到现有项目时,都会得到 error
:
Too many positional arguments: 0 expected, but 1 found. Try removing the extra argument.
在代码的第 4 行,粗体文本 *path
当我从那里删除 **path 时, 触发函数后的控制台输出为:
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.
请帮忙。 抱歉我的英语不好。