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

[Flutter] Problem with size of items in GridView in Flutter

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

  1. Stack

    Stack Membro Participativo

    The problem that occurs in GridView is that there is a space between the items that are created in the second row and later, as in the image below. [​IMG]

    Item Widget:

    return Material(
    color: MyColors.Transparent,
    child: Container(
    margin: EdgeInsets.only(left: 3.5, right: 3.5),
    width: 120,
    child:
    Column(
    children: [
    Card(
    elevation: 0.9,
    color: MyColors.Shadow,
    child: InkWell(
    radius: 30,
    onTap: () {
    AppController.Debug(Index);
    },
    child: Column(
    mainAxisAlignment: MainAxisAlignment.start,
    mainAxisSize: MainAxisSize.min,
    children: [
    Image.network(
    height: 50,
    width: Variables.MATCH_PARENT,
    "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ4xhc0rw70Yodsy2N2FKbxKJxCE8dAIG0sBA&s"),
    SizedBox(
    height: 7,
    ),
    Container(
    margin: EdgeInsets.symmetric(horizontal: 5),
    child: Align(
    alignment: Alignment.centerRight,
    child: WiPersianText(
    ' Item $Index',
    FontSize: 12,
    IsBold: true,
    IsSingleLine: true,
    TextColor: MyColors.Black,
    ),
    )),
    SizedBox(
    height: 6,
    ),
    SizedBox(
    height: 10,
    )
    ],
    ))),
    ],
    )


    ),
    );


    GridView:

    Directionality(
    textDirection: TextDirection.rtl,
    child: GridView.count(
    crossAxisCount: 4,
    children: items)),

    Continue reading...

Compartilhe esta Página