Create a menu on avatar click

Issue

I’ve been searching for quite a while now, and I don’t know if I’m not searching the correct term, but I want to make a menu that displays over the current screen when you click on your avatar.

Like this one from Google:

Avatar menu

Or this one from Facebook:

Facebook notify drawer

I tried using showMenu(), but this one requires that I use PopUpMenuItem() which is, but it does not allow customizing the whole menu. For what I understand, I have to draw a Material() widget or Stack() over the current screen, but I have no knowledge on that.

Solution

What you need is an OverlayEntry. They’re tricky, and there are packages that help you manage overlays more easily. Please check these:

https://pub.dev/packages/modals

https://pub.dev/packages/flutter_portal

Answered By – Olga P

Answer Checked By – Candace Johnson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.