问答详情
源自:2-5 列表List

var list3 = new List(); 编译报错

error: The class 'List' doesn't have an unnamed constructor. (new_with_undefined_constructor_default at chapter2\data_type_list.dart:10)

提问者:慕娘6193276 2023-10-18 23:00

个回答

  • MMhui
    2023-11-09 10:28:05

    dart3之后List()不再是有效的代码,List没有构造函数了,不能再用new List()来定义空数组了