Structs in Dart
Go’s structs are typed collections of fields. They’re useful for grouping data together to form records.
This person
struct type has name
and age
fields.
Here’s a constructor that initializes a Person
with a given name.
To run the program, just execute the Dart file.
Now that we’ve seen how to create and use structs in Dart, let’s move on to more advanced features of the language.