Arslan Ehsan
Arslan Ehsan

Reputation: 151

How To Flip An Image in flutter

enter image description here

i am capturing an image by camera and want to flip that image as i show in sample picture of Giraffe.

Upvotes: 4

Views: 2925

Answers (2)

Rajni Gujarati
Rajni Gujarati

Reputation: 2937

With Flutter 3.10.2 and above versions (Don't know about the previous versions have this), you can flip as below:

Transform.flip(
 flipX: true, // Flip horizontally
 flipY: true, // Flip vertically
 child: Your widget,
)

Upvotes: 1

blackkara
blackkara

Reputation: 5052

Use Transform and give the image as child,

 Transform(
    alignment: Alignment.center,
    transform: Matrix4.rotationY(math.pi),
    child: Image.network('https://i.sstatic.net/VroJR.png'),
  )

enter image description here

Upvotes: 5

Related Questions