title: How to fix a button at bottom of a single child scrollview with a list
body: <p>I have a SingleChildScrollView and inside it I have a list with some cards, that you can remove ou add more. I need to fix an add button at the bottom of the screen, when the card list is not scrollable yet, but when the card list increase size and the scrollview is able to scroll now (to see all the content), the button must follow the list and not keep fixed at the bottom anymore.</p>
  <p>For now, what I did to solve this, was check the scroll view every time that a card is added ou removed, if I checked that the screen is now scrollable or not scrollable I change some properties of my build widget:</p>
  <pre><code> SingleChildScrollView(
            controller: _scrollController,
            physics: AlwaysScrollableScrollPhysics(),
            child: Container(
              height: isNotScrollable
                  ? _pageSize - (_appBarSize + _notifySize)
                  : null,
              padding: const EdgeInsets.symmetric(
                  horizontal: Constraints.paddingNormal),
              child: Column(
  .....
  </code></pre>
  <p>and after the list render I create the button like this</p>
  <pre><code>isNotScrollable
                      ? Expanded(
                          child: Container(),
                        )
                      : Container(),
                  CVButton(
                    color: Palette.white,
  </code></pre>
  <p>Basically, my idea is: if the screen is not scrollable yet (the list content fits in the screen size) I will set a height to the container inside scrollview and add a Expanded() widget before the add button (so the button will stay in the bottom of the container), but if the screen is scrollable (the list content not fits inside the screen size) so I remove the container height and the Expanded widget, then the button will follow the list now as normally.</p>
  <p>I don't know if this is the better way to deal with that, I want to know if there is some way to do this without this 'dinamic' way that I am doing, only with fixed widgets and not changing the widget according to the state of the scrollview.</p>
  <p><a href="https://i.stack.imgur.com/GhPqC.png" rel="nofollow noreferrer">An example when the list becomes scrollable and the button will keep at list bottom</a></p>
  <p><a href="https://i.stack.imgur.com/iV9IL.png" rel="nofollow noreferrer">Here the list is not scrollable yet but the button must be at the screen bottom and not list bottom</a></p>
  <p>(I dont wanna use bottomNavBar)</p>
  <p>Anyone has any idea how I can solve this?</p>