[英]Another exception was thrown: type '(BuildContext, int) => dynamic' is not a subtype of type '(BuildContext, int) => Widget'
I would like to know why I am receiving this exception and how I can fix it ? 我想知道为什么会收到此异常以及如何解决它? Code snippet would be helpful 代码段会有所帮助
I'm working on Flutter (Channel beta, v0.6.0, on Linux, locale en_US.UTF-8) 我正在使用Flutter(Linux上的Channel beta v0.6.0,语言环境为en_US.UTF-8)
Flutter doctor shows no issues found Flutter医生显示未发现任何问题
Due to flutter updates, functions rendering widgets need to have the return type explicitly stated 由于更新频繁,功能渲染小部件需要明确声明返回类型
Example : 范例:
If the function was previously defined as 如果该函数先前定义为
buildPhotos(BuildContext context, int index) {
...
}
Change this to 更改为
Widget buildPhotos(BuildContext context, int index) {
...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.