title: Dart nested collections - List<Map<String, Object>>
body: <p>I did a little Basic and Ada programming 25 years ago, but never got any deeper ... now my mind isn't as sharp as it used to be so I bought a few courses about Dart and Flutter on Udemy, but instructors don't really teach programming... They start advanced topics like complex data structures in the first lessons in 3 minute long video and I'm completely lost.</p>
  <p>I'm trying to make some sense on my own about nested collections, researching on the internet, but i can't figure out how to access double nested collections (list/maps inside a list of maps). Can you guys share some links / courses on the topic.</p>
  <p>Here is some sample code, I managed to access to the first map data, but I don't know how to get the items in the 'ingredient' list, neither the data in the 'macros' map... How can i now the 'protein' in my dishes? Thanks in advance.</p>
  <pre><code>void main() {
    var recipes = [
      {
        'name': 'Hoisin Chicken Lettuce Cups',
        'type': 'Salad',
        'ingredients': ['mango', 'hoisin sauce', 'chicken breasts', 'romaine lettuce', 'cress'],
        'calories': 289,
        'macros': {
            'fat': 9.6,
            'sat_fat': 1.8,
            'protein': 31.3,
            'carbs': 20.3,
            'sugar': 19.2,
            'salt': 1.3,
            'fibre': 2.5,
          },
      },
      {
        'name': 'Smoked Salmon Plates',
        'type': 'Salad',
        'ingredients': ['cucumber', 'dill', 'smoked salmon', 'avocado', 'cottage cheese'],
        'calories': 246,
        'macros': {
            'fat': 17.7,
            'sat_fat': 3.9,
            'protein': 17.1,
            'carbs': 4.4,
            'sugar': 3.2,
            'salt': 1.5,
            'fibre': 1.2,
          },
      },
  
    ];
  
    // Managing to accest collection data... How to get protein amount? 
    // How to know 'macros' lenght? ...
  
    print(recipes);
    print(recipes.length);
    print('---------------------------------------');
    print(recipes[1]);
    print(recipes[1].length);
    print(recipes[1]['ingredients']);
    print(recipes[1]['macros']);
    print('---------------------------------------');
  
  }
  </code></pre>