Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Flutter change axis coordinates dirrections

Inside AnimatedContainer I draw progressBar from left to right.
Is there any way to change dirrection (mirror axis) so progress bar will start drawing from right to left ?

SizedBox(
  height: 20,
  child: Stack(
    children: [
      AnimatedContainer(
        width: MediaQuery.of(context).size.width / 100 * perc,
        color: Colors.green,
        duration: const Duration(milliseconds: 500),
      ),
      Row(
        mainAxisSize: MainAxisSize.max,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text('text1'),
          Text('text2'),
        ],
      ),
    ],
  ),
);

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Try using positioned widget like Align or Positioned

Align(
  alignment: Alignment.centerRight,
  child: AnimatedContainer(
    alignment: Alignment.centerRight,
    width: MediaQuery.of(context).size.width / 100 * perc,
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading