fluent_ui icon indicating copy to clipboard operation
fluent_ui copied to clipboard

Some Vulgar Ideas About The "DropDownButton"

Open LinHaoLove opened this issue 3 years ago • 0 comments

Hi,Sir I am not good at English expression. Please forgive me if my expression is inaccurate. This is my first time to use "fluent_ui". I have some vulgar ideas about the "DropDownButton".

Here is the official document。(fluent_ui: ^3.12.0)

return MenuFlyout(
  color: widget.menuColor,
  shape: widget.menuShape,
  items: widget.items.map((item) {
    if (widget.closeAfterClick) {
      return MenuFlyoutItem(
        onPressed: () {
          item.onPressed?.call();
          flyoutController.close();
        },
        key: item.key,
        leading: item.leading,
        text: item.text,
        trailing: item.trailing,
      );
    }
    return item;
  }).toList(),
);

I hope that in flyoutcontroller After close(), do some operations, such as push、ShowDialog and so on. If I do item.onPressed?.call() first and then flyoutController.close(), the operation I want may not be very ideal So would it be better to do this?

///first step
 flyoutController.close();
///second step
item.onPressed?.call();

Edit WinXaito: formatting

LinHaoLove avatar Sep 08 '22 02:09 LinHaoLove