pluto_menu_bar
pluto_menu_bar copied to clipboard
Enhancement - TextStyles
I use pluto_menu_bar above pluto_grid and it has a very nice look. Would it be possible to add some properties so that we could change the fontsize and color of selected grid items. I'm using only the top level of the menu and whichever they select, I have pluto_grid refreshing to that choice. I would like to change the selected menu option to indicate that the grid is showing that option by changing the color, maybe size and weight also. Right now, I have a separate Text widget that is redundantly stating which menu option is selected.
It's more a space conservation issue, so using pluto_grid's ability for column grouping also uses valuable space. Plus, it would look cleaner with the menu changing state on selection.
need the same - change the style of the top level menu item based on tap (because of refreshing pluto grid with different settings :)
I will be sure to update this in the next version. thank you
Updated to version 3.0.0 of PlutoMenuBar.
change log https://pub.dev/packages/pluto_menu_bar/changelog#300---2022-11-30
demo web link https://weblaze.dev/pluto_menu_bar/build/web/#/
demo source code https://github.com/bosskmk/pluto_menu_bar/blob/master/example/lib/main.dart
It's amazing how quickly you respond. :D Thanks a lot for your work.
I've tried the new property "enableSelectedTopMenu: true", but unfortunately it doesn't behave well in my application. I guess it's because the menu keeps its internal state information which item is selected. In fact, the first time I refresh the widget tree, the selected item is deselected and the text color disappears. It would be great to be able to maintain the state of the selected item outside the menu widget.
@KamilSvoboda https://pluto.weblaze.dev/the-case-of-assigning-the-id-of-plutomenuitem
If PlutoMenuItem
is created in the build
method, it seems to be a problem because PlutoMenuItem.key
changes from build to build.
Try creating PlutoMenuItem
in initState
or setting id
to PlutoMenuItem
.
If that doesn't work, please attach a minimal executable example code so I can test it.
thank you
@bosskmk You're right. Unfortunately, I have to create MenuItem only in the Build method, because it calls the ChangeNotifier instance (see provider), which is created only in the Build method. The use of Key for MenuItem has also crossed my mind, but unfortunately I didn't know that it's an Id property. Not it works, thank you a lot!
@KamilSvoboda
id
was added in this update.
I'm glad if the issue has been resolved.
thank you