I have a card which contains an image of the prodcut and product details above the image i.e in the Stack.
Problem is with the gradient design which is like a triangular shape i.e
I have tried using Linear Gradient inside Box Decoration of a container widget like this :
Align(
alignment: Alignment.bottomCenter,
child: Container(
height: 141,
width: double.maxFinite,
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10),
bottomRight: Radius.circular(10),
),
gradient: LinearGradient(
begin: Alignment.bottomLeft,
end: Alignment.topRight,
colors: [Colors.black, Color(0x00000000)],
),
),
child: Container(
// Data inside Column
),
),
),
but did’t work.
2
Answers
You should add where the gradient starts and ends, which you did, but you forgot the parameter
stops: [0.7, 1]
give whatever numbers you want from 0 to 1.If that does not work, try changing colors to this
colors: [Colors.black, Colors.transparent]
. Hope this helpsyou can add more color transparent and add custom Alignment
example :