title: How to delete a list inside the list in dart?
body: <p>I want to delete the list inside the list of the Map. The map contains key is dynamic and the value is List. The List is composed also of sub list and I want to delete some of the sub lists.</p>
  <pre><code>
  </code></pre>
  <pre><code>void main() {
    List list = [1,2];
    Map&lt;dynamic, List&gt; events = {1: list,
                                    2: [['a1','a2'],['a3','a4','a5'],'y'],
                                    'A': []};
    print(events);
    events[2]?.remove((item) =&gt; item == 'y' );//deleting only the 'y'
    print(events[1]);     //correct print
    print(events[2]);     //correct print
    print(events['A']);   //correct print
    print('above is correct--------below is error');
    
    events[2]?.remove((item) =&gt; item== ['a1','a2']);//trying to DELETE the ['a1',a2]
    print(events[2]); //error, ['a1','a2'] not DELETED :(
  }
  </code></pre>
  <pre><code>
  </code></pre>