0

I have multiple maps inside maps, such as:

Program = {'day0': {'area0': {'exercise0': 'value'}}, 'day1': {'area0': {'exercise0': 'value'}}};

And, I want to add data to 'exercise0'. But, sometimes previous data will not be set. Such as creating 'area0' without setting 'day1'. So...

Program['day0']['area0']['exercise0'] = 'failure';

...this code doesn't work, because 'area0' is not set.

I have used addAll too:

Program.addAll({
  'day${dayIndex}': {
    "area0": {
      'area': Chest,
      'exercise0': {'exercise': Chest.exercises[0]},
    },
    "area1": {
      'area': FrontArm,
      'exercise0': {'exercise': FrontArm.exercises[0]},
    }
  },
});

But rn this one overwrites the existing values.

0 Answers0