-
-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ISSUE: MenuFlyoutSubItem was not displaying when hovered or pressing over in a DropdownButton. #964
Conversation
Could you explain the issue better? I don't understand it |
The Problem: return DropDownButton(
title: const Text('menu'),
items: [
MenuFlyoutItem(
text: const Text('import'),
onPressed: () {},
),
// MenuFlyoutSubItem items will not display when hovered or pressed.
MenuFlyoutSubItem(
text: const Text('open with...'),
items: (context) {
return [
MenuFlyoutItem(text: const Text('powerpoint'), onPressed: () {}),
MenuFlyoutItem(text: const Text('excel'), onPressed: () {}),
MenuFlyoutItem(text: const Text('word'), onPressed: () {}),
];
},
),
MenuFlyoutItem(text: const Text('export'), onPressed: () {}),
],
); Upon further reflection, I've identified an issue with the initial solution proposed in the pull request. and best solution it removing the Revised Solution:
I acknowledge that the initial solution might not have been entirely accurate, and I believe this revised approach provides a more effective resolution. I'm open to any feedback you may have and am willing to make further adjustments if necessary. |
I like the first solution better. I'd like to keep the |
the issue is related to the fact that only the first return DropDownButton(
title: const Text('menu'),
items: [
MenuFlyoutItem(
text: const Text('import'),
onPressed: () {},
),
// MenuFlyoutSubItem items will display when hovered or pressed.
MenuFlyoutSubItem(
text: const Text('open with...'),
items: (context) {
return [
MenuFlyoutItem(text: const Text('powerpoint'), onPressed: () {}),
MenuFlyoutItem(text: const Text('excel'), onPressed: () {}),
MenuFlyoutItem(text: const Text('word'), onPressed: () {}),
];
},
),
// Additional MenuFlyoutSubItem items will not display when hovered or pressed.
MenuFlyoutSubItem(
text: const Text('open with 2 ...'),
items: (context) {
return [
MenuFlyoutItem(text: const Text('powerpoint 2'), onPressed: () {}),
MenuFlyoutItem(text: const Text('excel 2'), onPressed: () {}),
MenuFlyoutItem(text: const Text('word 2'), onPressed: () {}),
];
},
),
MenuFlyoutItem(text: const Text('export'), onPressed: () {}),
],
);
I will make another attempt to resolve the issue while retaining the |
Hello there, I've resolved all the issues, and now it works as expected. |
Hello, the tests are not passing and you should rebase your branch. |
|
The error occurred because of the inheritance relationship between the MenuFlyoutSubItem class that extends from MenuFlyoutItem.
before ( picture )1:
after ( picture 2):
Checklist
CHANGELOG.md
with my changes