Recently, Google launched version 2.15 of their programming language Dart. Some new features include constructor tear-offs and improved enumerations.
What is Dart?
Dart is an object-oriented, open-source programming language developed by Google. Since its first stable release in 2011, Dart has undergone many changes. Version 2 introduced a static type system. The programming language is also used in Flutter, Google’s mobile framework.
What is special about Dart?
Applications for Dart?
Dart is a general-purpose language that you can use for frontend-, mobile- and back end-applications
- To develop backend applications you can use dart:html and dart:io or opt for frameworks such as Aqueduct.
- For mobile applications, you can use the Flutter framework.
Function tear-offs already existed in Dart. In case the lambda parameter(s) and the following function call each had the same signature, you could write it shorter.
Dart 2.15 adds the same functionality when calling constructors.
It can also be used with named constructors.
The Dart team has also made some improvements to the enumeration API. You can call the getter .name to get the String value of an enum value.
It is now also possible to search for an enum value by name.
Finally, you can also map the value of an enum to name-value pairs.
You can find more information on this and other new additions at: https://dart.dev/guides/whats-new