huextrat / menu_button

Flutter plugin to display a popup menu button widget with handsome design and easy to use.
https://pub.dev/packages/menu_button
MIT License
65 stars 23 forks source link

Transparent toggledChild, vertical offset for the menu, border in opened state #19

Open plavunov opened 3 years ago

plavunov commented 3 years ago

Hi! This is what I am trying to achieve: desired

I was able to make the title child look the way I need:

current-closed

But then, I ran into trouble. I was trying to make the toggledChild transparent by all possible means, but it either keeps instantiating it as a white box, or just removes it (which shifts the menu in an undesired way).

current-opened

Also, it would be especially useful if there was a way to provide a vertical offset for the menu, in order to achieve the desired menu look (because the initial title child needs to stay in place)

Finally, do you think it's possible to provide a border that would only be visible when the menu is opened?

Thanks!

huextrat commented 3 years ago

Hi,

By using the following properties you should have a transparent background for the whole menu button.

itemBackgroundColor: Colors.transparent,
menuButtonBackgroundColor: Colors.transparent,

Now about the border you should have a way with decoration property with a custom border ;)

For instance:

decoration: BoxDecoration(
    border: Border.all(
    color: Colors.black,
        width: 1,
    ),
),