flutter-context-menu
flutter-context-menu copied to clipboard
How to change the color of the menu?
I have two white bars, but I can't find a way to remove them.
Have you tried using a custom card builder? Also check the src for the default card to see which ThemeData values you might need to set: https://github.com/gskinnerTeam/flutter-context-menu/blob/master/lib/src/widgets/context_menu_card.dart
@esDotDev I used a ContextMenuRegion and a GenericContextMenu to create my menu.
I'm not sure where is this "custom card builder"
Check the docs on styling https://github.com/gskinnerTeam/flutter-context-menu/tree/master?tab=readme-ov-file#-%EF%B8%8Fstyling [Edit] - Wrong link
Putting the widget after the theme definition fixed the problem:
The example in the README is not correct
return ContextMenuOverlay(
child: MaterialApp(...)
);
This will be more correct
return MaterialApp(
theme: ...,
child: ContextMenuOverlay(child: ...)
);
Another issue appeared, it used by default when overring the secondary color instead of onPrimary for the text color.
@esDotDev https://github.com/gskinnerTeam/flutter-context-menu/pull/21 this should fix the issue
Hi @esDotDev, thank you for merging the pull request! I'd like to know about the release cycle for this project. When will these changes be available for Flutter users?