title: onTap() in ListView.builder in Flutter
body: <p>Good morning,
  I wrote a widget thanks to which I can download data from api, list them and search dynamically by the appropriate word. Now I would like to apply the function to go to the details of individual objects after clicking on its object from the list. I tried to use the onTap () function but to no avail</p>
  
  <p>below paste the code:</p>
  
  <pre><code>class _HomePageState extends State&lt;HomePage&gt; {
  
    List&lt;Order&gt; _notes = List&lt;Order&gt;();
    List&lt;Order&gt; _notesForDisplay = List&lt;Order&gt;();
  
    Future&lt;List&lt;Order&gt;&gt; fetchNotes() async {
      var url = 'http://10.0.2.2:80/order';
      var response = await http.get(url);
  
      var notes = List&lt;Order&gt;();
  
      if (response.statusCode == 200) {
        var notesJson = json.decode(response.body);
        for (var noteJson in notesJson) {
          notes.add(Order.fromJson(noteJson));
        }
      }
      return notes;
    }
  
    @override
    void initState() {
      fetchNotes().then((value) {
        setState(() {
          _notes.addAll(value);
          _notesForDisplay = _notes;
        });
      });
      super.initState();
    }
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        home:Scaffold(
        appBar: PreferredSize(
          preferredSize: Size.fromHeight(100.0),
          child: AppBar(
            iconTheme: IconThemeData(color: Color.fromRGBO(9, 133, 46, 100)),
              backgroundColor: Colors.white,
              actions: &lt;Widget&gt;[
                IconButton(
                  icon: Icon(
                    Icons.shopping_cart,
                    color: Color.fromRGBO(9, 133, 46, 100),
                  ),
                  onPressed: (){
                    print('klikniete');
                  },
                ),
              ],
          ),
        ),
        body: Container(
          child: FutureBuilder(
            future: fetchNotes(),
            builder: (BuildContext context, AsyncSnapshot snapshot){
              if(_notesForDisplay.length == null){
                  return Container(
                    child: Center(
                      child:Text("Ładowanie...")
                    ),
                  );
                }else{
                  return ListView.builder(
                    itemCount: _notesForDisplay.length+1,
                    itemBuilder: (BuildContext context, int index) {
                      return index == 0 ? _searchBar() : _listItem(index-1);  
                      },
                  );
                }
            },
          ),
        ),    
      );
    }
  
    _searchBar() {
      return Padding(
        padding: const EdgeInsets.all(8.0),
        child: TextField(
          decoration: InputDecoration(
            hintText: 'Wyszukaj po mieście...'
          ),
          onChanged: (text) {
            text = text.toLowerCase();
            setState(() {
              _notesForDisplay = _notes.where((note) {
                var noteTitle = note.firstName.toLowerCase();
                return noteTitle.contains(text);
              }).toList();
            });
          },
        ),
      );
    }
  
    _listItem(index) {
      return Card(
        child: Padding(
          padding: const EdgeInsets.only(top: 32.0, bottom: 32.0, left: 16.0, right: 16.0),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: &lt;Widget&gt;[
              Text(
                _notesForDisplay[index].firstName,
                style: TextStyle(
                  fontSize: 22,
                  fontWeight: FontWeight.bold
                ),
              ),
              // Text(
              //   _notesForDisplay[index].lastName,
              //   style: TextStyle(
              //     color: Colors.grey.shade600
              //   ),
              // ),
            ],
          ),
        ),
      );
    }
  }
  </code></pre>
  
  <p>Anyone have any idea as to how I can move to the details of the object after clicking?</p>