Ada*_*n P 2 widget dart flutter
声明小部件 和 新小部件有什么区别
例:
appBar: AppBar(... ),
appBar: new AppBar(... ),
title: Text('Hi'),
title: new Text('Hi'),
Run Code Online (Sandbox Code Playgroud)
new并且在const上下文中,const最近已变为可选。
因此,没有区别,如果以下标识符是具有默认构造函数的类(如果使用,则为命名构造函数),Dart只是假设new或const(取决于上下文MyWidget.fooName())
另请参见https://github.com/dart-lang/sdk/blob/master/docs/language/informal/optional-new-const.md
| 归档时间: |
|
| 查看次数: |
659 次 |
| 最近记录: |