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

[Flutter] flutter gridview problem with aspect ratio on different devices

Discussão em 'Mobile' iniciado por Stack, Outubro 16, 2024 às 09:43.

  1. Stack

    Stack Membro Participativo

    I want to have a fixed height container in gridview. I am using following code. It is showing different height on different devices. Is there any way to control the height in a way that it look same on all devices.[​IMG]

    GridView.count(
    shrinkWrap: true,
    crossAxisCount: 2,
    mainAxisSpacing: 0,
    childAspectRatio:
    MediaQuery.of(context).size.width /
    (MediaQuery.of(context).size.height / 1),
    crossAxisSpacing: 8,
    children: _productData.map((opt) {
    return _productCard(context, opt, cart);
    }).toList(),
    ),

    Continue reading...

Compartilhe esta Página