📜  dart this 构造函数 - Dart 代码示例

📅  最后修改于: 2022-03-11 14:48:07.035000             🧑  作者: Mango

代码示例2
class MyClass {
  int param1;
  MyClass(this.param1);
}
final obj = MyClass(100);

class MyClassNamed {            // with named parameters
  int param1;
  MyClassNamed({required this.param1});
}
final objNamedParam = MyClassNamed(param1: 100);