How do I get an overlay to appear on a button click and then that button stay above the overlay in flutter?

Issue

I’m developing an app and I want the button I click on to activate a total screen overlay. Basically turn the screen darker whilst keeping the button I’ve clicked above this overlay. Ive managed to hack my way through it by putting a container with a black opacity in a stack with the button and then have it show on click but it doesn’t fully over the screen because of the space the bottom navigation bar takes. Any ideas?

enter image description here

Solution

I figured out a hacky way of doing it. I put the controller.currentPage and the bottom nav bar into a stack with a container with Colors.black.withOpacity(0.5). then just triggered in on click. kinda works but its hacky.

enter image description here

Answered By – David

Answer Checked By – Willingham (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *