1

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

new Container()
// vs
Container()
creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402
Andrew Takao
  • 105
  • 1
  • 13

1 Answers1

6

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.

creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402