【发布时间】:2021-08-18 11:37:50
【问题描述】:
如果这听起来像一个非常愚蠢的问题,我很抱歉,但它在 Dart 和 Flutter 中确实是新的。在 Flutter 的示例中,我经常看到这样的构造函数:
class CalTable extends StatefulWidget {
// Constructor with initializer ( : )
CalTable({Key key}) : super(key: key);
@override
_CalTableState createState() => _CalTableState();
}
我知道 {} 是 MAP 还是 SET。但是这里的 {} 到底是什么意思?又为什么用它来传达一个值 Key key?
提前致谢
【问题讨论】: