flutter-context-menu icon indicating copy to clipboard operation
flutter-context-menu copied to clipboard

How to change the color of the menu?

Open stephane-archer opened this issue 11 months ago • 6 comments

I have two white bars, but I can't find a way to remove them.

Screenshot 2024-12-23 at 21 41 46 Screenshot 2024-12-23 at 21 41 37

stephane-archer avatar Dec 23 '24 20:12 stephane-archer

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 avatar Dec 23 '24 21:12 esDotDev

@esDotDev I used a ContextMenuRegion and a GenericContextMenu to create my menu. I'm not sure where is this "custom card builder"

stephane-archer avatar Dec 23 '24 21:12 stephane-archer

Check the docs on styling https://github.com/gskinnerTeam/flutter-context-menu/tree/master?tab=readme-ov-file#-%EF%B8%8Fstyling [Edit] - Wrong link

esDotDev avatar Dec 23 '24 21:12 esDotDev

Screenshot 2024-12-23 at 22 16 15 Screenshot 2024-12-23 at 22 16 28

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. Screenshot 2024-12-23 at 22 22 47

stephane-archer avatar Dec 23 '24 21:12 stephane-archer

@esDotDev https://github.com/gskinnerTeam/flutter-context-menu/pull/21 this should fix the issue

stephane-archer avatar Dec 23 '24 21:12 stephane-archer

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?

stephane-archer avatar Dec 23 '24 22:12 stephane-archer