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

[Flutter] Create new List when Button is pressed

Discussão em 'Mobile' iniciado por Stack, Outubro 5, 2024 às 20:52.

  1. Stack

    Stack Membro Participativo

    How am I able to create a new List when im pressing a Button? Is it possible with a loop or sth?

    List<List<Countries>> groups = [];
    ...
    child: GestureDetector(
    onTap: () {
    setState(() {
    int numberOfGroups = groups.length;
    int nextGroup = numberOfGroups++;
    String number = nextGroup.toString();
    List<Countries> number = [];
    groups.add(number);
    });
    },


    This doesnt work :(

    Continue reading...

Compartilhe esta Página