How to add linear gradient to a rounded container in flutter. Here is my code. This does apply a gradient, but it appears like a rectangle container on the top of the rounded container.
Container(
height:300,
width: double.infinity,
padding: EdgeInsets.all(10.0),
margin: EdgeInsets.only(top: 8.0, bottom: 0, left: 8.0, right: 8.0),
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage("assets/images/img.png"),
),
borderRadius: BorderRadius.circular(15.0),
color: Colors.black),
child:Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.black.withOpacity(0.5),
Colors.black.withOpacity(0.7),
],
),
child:MoreWidgets(),
),
),