Dart Adding a new key value to map

Solution 1:

void main() {
  var myMap = {'A': {'b':3}};
  myMap['A']!['c'] = 3;
  print(myMap);
}

Solution 2:

Assuming you started with:

var myMap = {'A': {'b': 3}};

You can update like this:

myMap['A'] = {
  'b': 3,
  'c': 3,
 };