Just like functions, Dart implements the expected behavior for classical object-oriented programming.
In this recipe, you used inheritance, which is a building block of OOP. Consider the following class declaration:
class OfficialName extends Name {
...
This means that OfficialName inherits all the properties and methods that are available in the Name class, and may add more or override existing ones.
One of the more interesting syntactical features in Dart is the constructor shorthand. This allows you to automatically assign members in constructors by simply adding the this keyword, which is demonstrated in the Name class, as shown in the following code block:
const Name(this.first, this.last);
The Dart plugin for Android Studio and Visual Studio Code also has a handy shortcut for generating constructors, so you can make this process go even faster. Try deleting the constructors from the Name class. You should see red underlines underneath the first and last properties. Move your cursor to one of those properties (it doesn't matter which one) and press Option + Enter:
You should see a popup appear that generates constructions for final fields. If you hit Enter, your constructor will appear without you having to type anything. It's convenient.