首页 > 解决方案 > What does 'new' mean in Flutter?

问题描述

Is there a difference between the following two statements in Dart?

new Container()
// vs
Container()

标签: flutterdart

解决方案


There is no difference. The new keyword was mandatory at some point, but was made optional with Dart version 2.

See this answer for more information. You can also mark your question as a duplicate above using the comment I posted.


推荐阅读