You can use transform
with skewX
for this.
Container(
width: 400,
height: 100,
transform: Matrix4.skewX(-.3),
decoration: BoxDecoration(
border: Border.all(
color: Colors.black,
),
color: Colors.amber,
),
),
For a shape like this you need to use CustomPainter
for details on how to use it you can refer to this .
You can also use a website like flutter shape maker for the same thing but to make it easier you can draw your shape and it'll auto generate the code for you.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.