Flutter构造函数错误 [英] Flutter constructor error

查看:53
本文介绍了Flutter构造函数错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用的代码段有问题,并且由于我是 dart 的新手,所以我不太理解该错误消息。有人可以向我解释为什么错误消息说

I have a problem with a code snippet I tried to play with, and since I am new to dart I don't really understand the error message. Can somebody explain to me why the error message says


构造函数返回类型 dynamic而不是预期类型
小部件。

The constructor returns type 'dynamic' that isn't of expected type 'widget'.

以及如何解决?

推荐答案

MaterialList 不存在。看来您是说 TwoLevelList ,已弃用。您应该尝试 ListView

The class MaterialList doesn't exist. It looks like maybe you meant TwoLevelList, which is deprecated. You should try ListView instead.

这篇关于Flutter构造函数错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆