Working with Maps
Get introduced to some of the properties and methods of a map in Dart.
Just like lists and sets, maps are objects that have associated properties and methods. Let’s take a look at some of them below.
Adding Key-value pairs
To add a new key-value pair to a map that has already been declared, use the following syntax:
Let’s add some key-value pairs to the numbers map we have declared in the widget below.
In the code snippet above, we added 3 key-value pairs to numbers.
Finding the number of pairs in a map
Just as we discussed for lists and sets, ...