pluto_menu_bar icon indicating copy to clipboard operation
pluto_menu_bar copied to clipboard

Enhancement - TextStyles

Open jodymac opened this issue 3 years ago • 7 comments

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.

jodymac avatar Jan 29 '22 20:01 jodymac

need the same - change the style of the top level menu item based on tap (because of refreshing pluto grid with different settings :)

KamilSvoboda avatar Nov 29 '22 13:11 KamilSvoboda

I will be sure to update this in the next version. thank you

bosskmk avatar Nov 29 '22 23:11 bosskmk

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

bosskmk avatar Nov 30 '22 03:11 bosskmk

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 avatar Nov 30 '22 07:11 KamilSvoboda

@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 avatar Nov 30 '22 07:11 bosskmk

@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 avatar Nov 30 '22 08:11 KamilSvoboda

@KamilSvoboda id was added in this update. I'm glad if the issue has been resolved. thank you

bosskmk avatar Nov 30 '22 08:11 bosskmk