title: Flutter ListView.builder on remove element not updating list
body: <p>I have a ListView.builder widget</p>
  
  <pre><code>void delete(dynamic obj) {
    setState((){
      pc.remove(obj);
    })
  }
  
  void update(dynamic obj){}
  
  List pc = List();
  
  @override
  void init(){
    super.initState();
    //Fetch data
    setState((){
      pc = data;
    })
  }
  
  @override
  Widget build(BuildContext context) {
    return Container(
      child: ListView.builder(
        padding: EdgeInsets.only(bottom: 72.0),
        itemCount: pc.length,
        itemBuilder: (context, index) {
          return ListItemWid(
            pc.elementAt(index), delete, update);
        },
      ),
    );
  }
  </code></pre>
  
  <p>Here is have shown dynamic as the element type but actually is a fixed object.
  now when the ListItemWid's delete button is called I call the delete function in the stateful widget, and the code in the function is executed, because the object is removed from db. But it is not reflected properly in the View. Sometimes, wrong element is removed, sometimes no element is removed at all. Sometimes it works. I cannot post the actual source code because of restrictions, but I really need help with modifying elements in list view in flutter. The standard methods as demonstrated in flutter gallery are not working.</p>
  
  <p>Just for more information, the list view is shown inside one of the PageView pages and all data is fetched and shown from Sqflite in the current list widget only.</p>
  
  <p>Please help.</p>
  
  <p>Thanks.</p>