Mirror widget orientation flutter

Viewed 602

How can I mirror widget or image in flutter as images belowenter image description here

enter image description here

1 Answers

for this, use Transform Widget, first import this

import 'dart:math'; 

for actual screen

return Scaffold(
  body: Transform(
    alignment: Alignment.center,
    transform: Matrix4.rotationY(0),
    child: Image.network("https://www.vhv.rs/dpng/d/177-1771227_cartoon-figure-drawing-doremon-hd-png-download.png"),
  )
);

for mirror view(180 degree rotate) (that you needed)

return Scaffold(
    body: Transform(
      alignment: Alignment.center,
      transform: Matrix4.rotationY(pi),
      child: Image.network("https://www.vhv.rs/dpng/d/177-1771227_cartoon-figure-drawing-doremon-hd-png-download.png"),
    )
);
Related