Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Some Vulgar Ideas About The "DropDownButton" #520

Closed
LinHaoLove opened this issue Sep 8, 2022 · 0 comments
Closed

Some Vulgar Ideas About The "DropDownButton" #520

LinHaoLove opened this issue Sep 8, 2022 · 0 comments

Comments

@LinHaoLove
Copy link

LinHaoLove commented Sep 8, 2022

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant