Skip to content
Discussion options

You must be logged in to vote

Yes, it’s quite verbose atm. The reason it’s so verbose is because we expose the button’s decoration rather than color. This allows a greater degree of customisability at the cost of being slightly more verbose.

It's also worth mentioning that this example modifies not just the color, but the border and border radius as well for both the normal & hovered states. It also takes into account the fact that you might want to modify the typography etc.

If you're interested in modifying only the color, it can be shorten to:

context.theme.buttonStyles.outline.copyWith(
  enabledBoxDecoration: BoxDecoration( color: context.theme.colorScheme.secondary),
  enabledHoverBoxDecoration: BoxDecoration(color

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@heyjuns
Comment options

@Pante
Comment options

Pante Apr 2, 2025
Maintainer

Answer selected by heyjuns
@heyjuns
Comment options

@Pante
Comment options

Pante Apr 3, 2025
Maintainer

@heyjuns
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants