【发布时间】:2021-03-24 10:23:27
【问题描述】:
升级到最新版本的颤振后,我的所有列表都会收到弃用警告。
List<MyClass> _files = List<MyClass>();
=>'List' is deprecated and shouldn't be used.
不幸的是,它没有给出替换它的提示。 那么我们现在应该改用什么呢?
- Dart SDK 版本:2.12.0-141.0.dev
- Flutter:通道主机,1.25.0-9.0.pre.42
【问题讨论】:
-
见list
-
lint 表示不推荐使用未命名的
Listconstructor,而不是List类型本身。 -
这里的这个问题及其答案比那里的另一个问题要清楚得多:stackoverflow.com/questions/63451506/…