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

[Flutter] Flutter Table with height and width constraints in different cells

Discussão em 'Mobile' iniciado por Stack, Novembro 5, 2024 às 14:23.

  1. Stack

    Stack Membro Participativo

    I have this example table: Table

    Table(
    columnWidths: {
    0: IntrinsicColumnWidth(),
    1: FlexColumnWidth(),
    },
    border: TableBorder.all(),
    children: [
    TableRow(
    children: [
    TableCell(
    child: Container(
    color: Colors.black.withOpacity(0.2),
    padding: EdgeInsets.all(5),
    child: Text("Width"),
    )),
    Container(
    height: 100,
    color: Colors.red.withOpacity(0.2),
    child: Text("Height"),
    alignment: Alignment.center,
    ),
    ],
    ),
    ],
    )


    The width of the second Container is indirectly set by the first Container because of the ColumnWidths.

    The Problem is, that I need the first Container to take up all the available height in its cell

    I tried wrapping the Container with:

    • Expanded
    • Flexible
    • IntrinsicHeight
    • Column

    With the first two, an error occured ('Incorrect use of ParentDataWidget'), the second one did nothing and for the Column I tried putting two Elements inside the Column and set its MainAxis to spaceBetween but it did... nothing...

    Continue reading...

Compartilhe esta Página