Is there a difference between the following two statements in Dart?
new Container()
// vs
Container()
Is there a difference between the following two statements in Dart?
new Container()
// vs
Container()
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.