title: In flutter How to add a list to another list, how to delete, and recall the data?
body: <p><strong>To make my question clear:</strong><br />
  I work in meals page layout and the idea is the user will select the food item of his/her meal from a list by click on a checkbox, and after that add meal in the system.</p>
  
  <p><strong>Question is:</strong><br />
  I need to create a list (growth list) that contains all the food item information that the user is select it and after the user is press "add" button I will save each single food item' information from list to the database. I try to match ways but it not work. and I don't understand the wrong. I try a list and the problem is was how to callback the single food item's information. After that, now I try nested list and the problem is was how to insert or add the food item's information to a list.</p>
  
  <p><strong>here a code of nested list:</strong> </p>
  
  <pre><code>List&lt;List&gt; food= [];
  </code></pre>
  
  <p>add when click on checkbox:</p>
  
  <pre><code>List foo=[widget.id,widget.name,widget.carbs,widget.Amunt];
  //when try with insert:
  food.insert(index, foo);
  //when try with add:
  food[index].add(foo);
  </code></pre>
  
  <p>remove:</p>
  
  <pre><code>food.removeAt(index);
  </code></pre>
  
  <p>callback:</p>
  
  <pre><code>for(int i=0;i&lt;food.length;i++){
     Item vat= Item(food[i][0],mealId, dbEmail,food[i][1], food[i][2], food[i][3]);
     var dbItem= await helper.insertFood(Item);
                      }
  </code></pre>
  
  <p><strong>here an old code of list:</strong> </p>
  
  <pre><code>List food;
  </code></pre>
  
  <p>add when click on checkbox:</p>
  
  <pre><code>List foo=[widget.id,widget.name,widget.carbs,widget.Amunt];
  
   varty.add({ 'id':widget.id,'name':widget.name,'carb':widget.carbs,'amunt':widget.Amunt});
  </code></pre>
  
  <p>remove:</p>
  
  <pre><code>food.removeAt(index);
  </code></pre>
  
  <p>callback:</p>
  
  <pre><code>for(int i=0;i&lt;food.length;i++){
     Item vat= Item(food[i]['id'],mealId,dbEmail,food[i]['name'],food[i]['carb'],food[i]['amunt']);
     var dbItem= await helper.insertFood(Item);
                      }
  </code></pre>
  
  <p><br />
  <br />
  I think there's something I didn't use the right way but I don't know what it is!
  So, I would be grateful for any help.</p>