Inside of the dart language most types come from from the parent type
Object which could be called the root type in this case. From the root type in the case of dart you can end up with a type tree a little like this for the basic types.
With this tree here is some of the most common types layed out:
- "String" => 'This is a string in dart'
- A string is a list of characters
- "int" => 42069
- An int is a whole number and it can be positive or negative.
- "double" => 3.14195
- A double is a number that can have a decimal point after the whole number.
- "bool" => True or False
- A bool stores true or false information.
- "Map<K,V>" => (look below)
- Maps store data with "keys" and "values" with types stored in the in the "<K,V>" part of the specific "Map" type.
- "List<T>" =>
<int>[2, 4, 6, 8, 10]
- Holds a list of items of type T
- "dynamic" => Anything
- In dart you are also able to store things with type dynamic where it can be any type.
- Previous: Spying, Not Just in Adulthood: Part Two