1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] How to make a widget fill remaining space in a Column

Discussão em 'Mobile' iniciado por Stack, Outubro 17, 2024 às 10:53.

  1. Stack

    Stack Membro Participativo

    In Android, we can do the following to make ImageView to fill as much space as possible depending on the size of the TextView.

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:eek:rientation="vertical">
    <ImageView
    android:layout_width="wrap_content"
    android:layout_height="0dp"
    android:layout_weight="1"/>
    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
    </LinearLayout>


    How do we achieve this in Flutter? Assume I need to make Datetime(green) to fill as much as possible.

    new Column(
    children: <Widget>[
    new Text('Title',
    style: new TextStyle(fontWeight: FontWeight.bold)
    ),
    new Text('Datetime',
    style: new TextStyle(color: Colors.grey)
    ),
    ],
    )


    [​IMG]

    Continue reading...

Compartilhe esta Página