marianocordoba / fab-circular-menu

A Flutter package to create a nice circular menu using a Floating Action Button.
https://pub.dev/packages/fab_circular_menu
MIT License
198 stars 72 forks source link

Menu not auto close after clicked on menu item #4

Closed chungbkhn closed 4 years ago

chungbkhn commented 4 years ago

After clicked on one menu item, I want a solution to close menu by code but I can't found anyway to do it at the moment. This feature is quite comment, I think it should be an item in wishlist features :) Thanks for your time.

marianocordoba commented 4 years ago

I will add a way to open/close the menu programmatically asap

yelkamel commented 4 years ago

Any news ? :)

eliasjtg commented 4 years ago

News?

j574144 commented 4 years ago

Hi, thanks in advance, please add this feature according your available, but thinking on our nerve system 😂

marianocordoba commented 4 years ago

Hey! First of all, thanks for waiting. I've just added a controller property that takes a FabCircularMenuController which allows you to control the menu programatically.

final controller = FabCircularMenuController();

FabCircularMenu(
  child: ...,
  controller: controller,
  options: <Widget>[
    IconButton(icon: Icon(Icons.widgets), onPressed: () {
      controller.isOpen = false;
    }, iconSize: 48.0, color: Colors.white),
    ...
  ],
 )

I will improve documentation and examples soon.