Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Flutter – Floating Button inside a popup widget overlaying the scroll

Im working on my first flutter app so i am still learning possible widgets and how they react in certain structures.

So far I was doing well but cant figure out one thing I want to do.

I want to get a floating button inside of my cupertinopopusurface widget like this.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

My structure is similar, on the home screen I have a listview builder that builds my cards and when you press on each one it opens a cupertinopopupsurface.

Inside I also built a Single child scroll view structure for all my contant and its scrollable but I would to get a button that overlays it all and is in a fixed placed.

My structure currently is

CupertinoPopupSurface/
Container/
SingleChildScrollView/
Column/
Children/
Row/ (all rows now with content)

I cant get the button fixed somewhere in the structure but then it follows the scrolling its now fixed overlaying the contant.

>Solution :

You can use stack widget inside cupertinopopupsurface like this:

CupertinoPopupSurface(
   child: Stack(
      children:[
         your SingleChildScrollView,
         Positioned(left: 16, right: 16, bottom: 16,child: yourbutton),
      ]
    
    )
)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading