Do you need to use the “new” keyword in Dart?

No, it does not. With Dart 2 (click for the announcement with more information) the new and also const keywords were made optional.

This means that new Widget() does the exact same as Widget() on its own.


The const keyword can, however, change a value that would not be a const implicitly to a const.
So you will have to explicitly specify const when needed.

Leave a Comment