The following code has the same effect, butuses the optional new keyword before the constructor name:

    1. var p1 = new Point(2, 2);

    Version note: The new keyword became optional in Dart 2.

    Constructing two identical compile-time constants results in a single,canonical instance:

    1. var a = const ImmutablePoint(1, 1);
    2. assert(identical(a, b)); // They are the same instance!

    Within a constant context, you can omit the before a constructoror literal. For example, look at this code, which creates a const map:

    1. // Only one const, which establishes the constant context.
    2. 'point': [ImmutablePoint(0, 0)],
    3. 'line': [ImmutablePoint(1, 10), ImmutablePoint(-2, 11)],
    4. };

    If a constant constructor is outside of a constant contextand is invoked without ,it creates a non-constant object:

    Version note: The const keyword became optional within a constant context in Dart 2.