I have to make container which bottom is triangular shape as below image.
How to create this shape in flutter?
you can use this package and after adding this package add this code wrap 2 containers
class MyCustomTriangleClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
Path path = Path();
path.lineTo(size.width / 2, size.height * .2/*change this number to edit the triangle sahpe as you want and add more one Square*/);
path.lineTo(size.width, 0);
path.close();
return path;
}
@override
bool shouldReclip(CustomClipper old) {
return old != this;
}
}
and use this Widget
ClipPath(
clipper: MyCustomTriangleClipper (),
child: Container(
height: 120,
// width: double.infinity,
color: Colors.black,
),
),
Use this in widget tree
Create the customShapePainter class