How do I set a gradient background to a card correctly?
Copy code
Card(modifier = Modifier.background(linear))
Will set the background behind the card
Copy code
Card(backgroundColor = cardBackground)
will only accept
Color
and no
Brush
m
matvei
05/24/2021, 10:25 AM
Card is a material component and there are no gradients in material design system, therefore there's no such way to set gradient background on a card.
If you want to have gradient cards, you can create your own Card that will live outside of the material (Box + Modifier.background) for example