fluent_ui
fluent_ui copied to clipboard
Some Vulgar Ideas About The "DropDownButton"
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