Maps are like dictionaries in Python, they are used to store key, value data.

You can create Map using either Map() or {}.

 

var myMap = Map();

var myMap = {};

 

  var p = Map();
  p['key'= 'value';
  
  Map<String, List<String>> g = {'key': ['value1', 'value2', 'value3']};
  
  print(g);

Map is a useful data structure to hold data and pass around your widgets. keys and values can have any data type and you are not limited to text and numbers. By convention, keys are usually strings to make it easier for humans to read and understand the maps.