title: Flutter/Dart Issue using callback to remove listview item
body: <p>It is probably just a small error but my callback is not working.
  I'm trying to delete a Listview item using a callback but when I press the icon button nothing happens at all.
  I've written a sample code as my code is too long.</p>
  
  <p>I'm building the listView in <code>UserListView</code> and passing the data to the <code>User</code> widget.</p>
  
  <pre><code>
  class UserListView extends StatefulWidget {
    @override
    _UserListViewState createState() =&gt; _UserListViewState();
  }
  
  class _UserListViewState extends State&lt;UserListView&gt; {
    List&lt;User&gt; user = [];
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
          appBar: AppBar(title: Text("User")),
          body: StreamBuilder&lt;QuerySnapshot&gt;(
              stream: userRef.snapshots(),
              builder: (context, snapshot) {
                if (!snapshot.hasData) {
                  return Text("something happend");
                }
                user = snapshot.data.documents
                    .map((doc) =&gt; User.fromDocument(doc))
                    .toList();
                if (user.isEmpty) {
                  return Text("no user");
                }
                return ListView.builder(
                  itemCount: user.length,
                  itemBuilder: (BuildContext context, int index) {
                    final item = user[index];
                    return User(
                      index: item.index,
                      username: item.username,
                      uid: item.uid,
                      country: item.country,
                      removeUser: () {
                        setState(() {
                          user.removeAt(item.index);
                        });
                      },
                    );
                  },
                );
              }));
    }
  }
  </code></pre>
  
  <p>In <code>User</code> im trying to call the function <code>removeUser</code> but nothing happens at all.</p>
  
  <pre><code>
  class User extends StatefulWidget {
    final int index;
    final String username;
    final String uid;
    final String country;
    final VoidCallback removeUser;
  
    User({this.username, this.country, this.uid, this.index, this.removeUser});
  
    factory User.fromDocument(DocumentSnapshot doc) {
      return User(
        uid: doc['uid'],
        username: doc['username'],
        country: doc['country'],
      );
    }
  
    @override
    _UserState createState() =&gt; _UserState();
  }
  
  class _UserState extends State&lt;User&gt; {
  
    @override
    Widget build(BuildContext context) {
      return Container(
        height: 200.0,
        child: Column(
          children: &lt;Widget&gt;[
            Text(widget.uid),
            Text(widget.username),
            Text(widget.country),
            IconButton(
              icon: Icon(Icons.delete),
              onPressed: () =&gt; widget.removeUser(),
            )
          ],
        ),
      );
    }
  }
  </code></pre>
  
  <p>What am I missing here using the callback "removeUser"?</p>