Skip to content

Some Vulgar Ideas About The "DropDownButton" #520

@LinHaoLove

Description

@LinHaoLove

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions