Flutter Remove list item

后端 未结 3 1552
迷失自我
迷失自我 2021-02-05 02:03

I have a question in my flutter dart script, this my script:

List replytile = new List();

replytile.add(
    new ReplyTile(
          


        
3条回答
  •  情书的邮戳
    2021-02-05 02:48

    In your case this works:

    replytile.removeWhere((item) => item.id == '001');
    

    For list with specific datatype such as int, remove also works.Eg:

    List id = [1,2,3];
    id.remove(1);
    

提交回复
热议问题