I'm using a Card widget in flutter to display text. I want to use an asset image as the background/texture for the card, and display text on top. I'm having trouble figuring out how to layer the widgets properly. Any insight is much appreciated.
Do something like this:
Card(
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("images/image.png"),
fit: BoxFit.fitWidth,
alignment: Alignment.topCenter,
),
),
child: Text("YOUR TEXT"),
),
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With