Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create parallelogram shape Container in Flutter?

I really don,t know how to create a parallelogram shape container in a flutter. I also found the flutter library for this but I can't use it because this is not supported by null safety. enter image description here

like image 243
Mohammad Faizan Avatar asked Oct 22 '25 07:10

Mohammad Faizan


1 Answers

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,
  ),
),
like image 184
Yeasin Sheikh Avatar answered Oct 23 '25 21:10

Yeasin Sheikh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!