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

[Flutter] How to remove padding from some children in a Column?

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

  1. Stack

    Stack Membro Participativo

    Padding(
    padding: const EdgeInsets.all(20.0),
    child: Column(
    children: [
    // ... some widgets
    Padding(
    padding: const EdgeInsets.all(-20.0), // Error: How to do something like this?
    child: FooWidget()
    ),
    // ... more widgets
    BarWidget(), // Remove padding from here also
    // ... and some more widgets
    ],
    ),
    )


    I'm providing a padding of 20 to my Column, but I want to remove this padding from some of its children, like FooWidget, BarWidget, etc. How can I do that?

    Note: I'm not looking for workarounds like provide the padding to other widgets instead of the root Column or wrap those widgets in another Column and provide that column a padding, etc.

    Continue reading...

Compartilhe esta Página