Mirror widget orientation flutter

802

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"),
    )
);
Share:
802
Pation
Author by

Pation

Updated on December 29, 2022

Comments

  • Pation
    Pation over 1 year

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

    enter image description here

  • Pation
    Pation about 3 years
    Appreciate that!