【发布时间】:2019-12-04 08:30:01
【问题描述】:
当我尝试通过单击按钮打开相机时出现此错误
错误:
The following NoSuchMethodError was thrown building CameraHomeScreen(dirty, state: _CameraHomeScreenState#5d87d):
The getter 'isEmpty' was called on null.
Receiver: null
Tried calling: isEmpty
hrer 是 我的代码:
.
.
.
List<CameraDescription> cameras;
String _videoPath = null;
Future _recordVideo() async {
final videoPath = await Navigator.push(context, PageTransition(type: PageTransitionType.rightToLeft, child: CameraHomeScreen(cameras)));
setState(() {
_videoPath = videoPath;
});
}
.
.
.
【问题讨论】:
-
能否请您发布整个代码,就像您调用 .isEmpty 的位置一样?
-
谢谢,我解决了。
-
这只是一些愚蠢的错误:)
-
出错了,很高兴你解决了它。