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

How can I align a widget to the center of a Row and align the other 2 widgets to the center of each remaining space?

Link to the printscreen of the figma model

I want to place the VerticalDivider widget right in the middle of the Row with the other 2 Columns that contain "Objetivo: Recomendação médica" and "Nível do aluno: intermediário" and I want both of these Columns in the middle of the space left for each one.

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

>Solution :

Use Expanded to split remaining spaces in a Flex (like Row or Column).

For example:

Row(
  children: [
    Expanded(child: Container(color: Colors.blue)),
    VerticalDivider(),
    Expanded(child: Container(color: Colors.orange)),
  ],
)

enter image description here

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