title: I have created a card list with listview.builder from api. Now i want to change a card color in inkwell tap when one card is tapped
body: <p>I want to change a card color when a card is tapped. I made all functioanlities. I set inkwell too for tapping. Everything is ready but i am confused how to change a specific card color when it is tapped. Tried with bool to change a card color. But when i tapped a card all card color is changing. this not i want . I want only one card color should change when it is tapped.</p>
  <pre><code>isPressed ? Colors.blueAccent : Colors.white,
  
   InkWell(
                                onTap: () {
                                  setState(() {
                                    isPressed = !isPressed;
                                  });
    
  </code></pre>
  <p>in listview.builder i can fetch data in card from api.</p>
  <pre><code>  ListView.builder(
                          itemCount: widget.notification == null
                              ? 0
                              : widget.notification.length,
                          itemBuilder: (context, index) { 
      return
      
      
       Card(
                            shape: RoundedRectangleBorder(
                                borderRadius: BorderRadius.circular(10.0)),
                            color: isPressed ? Colors.blueAccent : Colors.white,
                            child: Padding(
                              padding: EdgeInsets.all(16.0),
                              child: InkWell(
                                onTap: () {
                                  setState(() {
                                    isPressed = !isPressed;
                                  });
                                  Navigator.push(
                                      context,
                                      new MaterialPageRoute(
                                          builder: (BuildContext context) =&gt;
                                              new DetailPage()));
                                },
                                child: Column(
                                  children: &lt;Widget&gt;[
                                    Row(
                                      children: [
                                        SizedBox(
                                          width: 20,
                                        ),
                                        Text(
                                          'Status',
                                          style: TextStyle(
                                              fontWeight: FontWeight.bold),
                                        ),
                                        SizedBox(
                                          width: 67,
                                        ),
                                        Text(widget.notification[index][&quot;data&quot;]
                                                [&quot;message&quot;]
                                            .toString()),
                                      ],
                                    ),
  </code></pre>