title: Flutter Inkwell does not update right away
body: <p>I am trying to insert a widget / change height of a widget upon clicking a button. As demonstrated by the video, the <code>InkWell</code> does not update after calling <code>setState()</code>. This only happens with <code>Ink</code>, if changed to <code>Container</code> everything works fine. <br>
  <br>
  market.dart</p>
  <pre><code>class MarketPage extends StatefulWidget {
    const MarketPage({Key? key}) : super(key: key);
  
    @override
    _MarketPageState createState() =&gt; _MarketPageState();
  }
  
  class _MarketPageState extends State&lt;MarketPage&gt; {
    List&lt;String&gt; displayedList = [];
    bool isSearchActive = false;
  
    final TextEditingController _controller = new TextEditingController();
  
    @override
    void initState() {
      super.initState();
      MarketList marketList = context.read&lt;MarketList&gt;();
      displayedList = marketList.markets.keys.toList();
    }
  
    @override
    Widget build(BuildContext context) {
      return SingleChildScrollView(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Padding(
              padding: const EdgeInsets.all(25),
              child: Row(
                mainAxisSize: MainAxisSize.max,
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Expanded(
                    child: Text(
                      &quot;Markets&quot;,
                      style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold),
                    ),
                  ),
                  isSearchActive == false
                      ? GestureDetector(
                          onTap: () {
                            print(&quot;hello&quot;);
                            setState(() {
                              isSearchActive = !isSearchActive;
                            });
                          },
                          child: Icon(
                            Icons.search,
                            size: 30,
                          ),
                        )
                      : GestureDetector(
                          onTap: () {
                            setState(() {
                              isSearchActive = !isSearchActive;
                            });
                          },
                          child: Icon(
                            Icons.arrow_right,
                            size: 30,
                          ),
                        )
                ],
              ),
            ),
            Container(
              height: isSearchActive == true ? 100 : 0,
            ),
            Flexible(
              child: ListView.separated(
                padding: EdgeInsets.all(20),
                separatorBuilder: (BuildContext context, int index) {
                  return SizedBox(
                    height: 15,
                  );
                },
                shrinkWrap: true,
                physics: BouncingScrollPhysics(),
                scrollDirection: Axis.vertical,
                itemCount: displayedList.length,
                itemBuilder: (BuildContext ctxt, int index) {
                  return MarketCard(
                      index, displayedList.length - 1, displayedList[index]);
                },
              ),
            ),
          ],
        ),
      );
    }
  </code></pre>
  <p><br><br>
  market_card.dart</p>
  <pre><code>class MarketCard extends StatefulWidget {
    final int myIndex;
    final int lastIndex;
    final String name;
  
    MarketCard(this.myIndex, this.lastIndex, this.name);
  
    @override
    State&lt;MarketCard&gt; createState() =&gt; _MarketCardState();
  }
  
  class _MarketCardState extends State&lt;MarketCard&gt; {
    @override
    initState() {
      super.initState();
    }
  
    @override
    Widget build(BuildContext context) {
      return Consumer&lt;MarketList&gt;(
        builder: (context, value, child) =&gt; InkWell(
          onTap: () {
            FocusManager.instance.primaryFocus?.unfocus();
            Navigator.push(
              context,
              MaterialPageRoute(
                builder: (context) =&gt; MarketDetailsPage(widget.name),
              ),
            );
          },
          borderRadius: BorderRadius.vertical(
            top: widget.myIndex == 0 ? Radius.circular(10) : Radius.circular(0),
            bottom: widget.myIndex == widget.lastIndex
                ? Radius.circular(10)
                : Radius.circular(0),
          ),
          child: card(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Row(
                      children: [
                        ClipOval(
                          child: SizedBox(
                            width: 50,
                            height: 50,
                            child:
                                Image.asset(value.markets[widget.name]!.iconURL),
                          ),
                        ),
                        SizedBox(width: 15),
                        Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Text(
                              value.markets[widget.name]!.name,
                              style: TextStyle(
                                  fontWeight: FontWeight.bold, fontSize: 18),
                            ),
                            SizedBox(height: 10),
                            Text(
                              &quot;\$${value.markets[widget.name]!.currentPrice.toString()}&quot;,
                              style: TextStyle(
                                  fontWeight: FontWeight.bold,
                                  color: value.markets[widget.name]!
                                              .priceChangePercent &gt;
                                          0
                                      ? Colors.green
                                      : Colors.red),
                            ),
                          ],
                        ),
                      ],
                    ),
                    Icon(Icons.keyboard_arrow_right),
                  ],
                )
              ],
            ),
          ),
        ),
      );
    }
  
    @override
    void dispose() {
      super.dispose();
    }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Gqp5b.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gqp5b.gif" alt="enter image description here" /></a></p>