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

Weights to the fields in flutter

In Android studio we give the height or width zero and give it some weight. Is there any way we can do this in flutter ? if Yes then how ?

<EditText
            android:id="@+id/etInputOTP1"
            android:layout_width="0dp"
            android:layout_height="60dp"
            android:layout_weight="1"/>          //Like this

>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

You can use the Expanded widget to give a child widget a specific weight when laying out a row or column.

To give a widget a weight of 2 in a row:

Row(
  children: [
    Expanded(
      child: Text('Widget 1'),
      flex: 2,
    ),
    Expanded(
      child: Text('Widget 2'),
      flex: 1,
    ),
  ],
)
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