1
resposta

[Projeto] Alert DIalog

onLongPress: () {
                          showDialog(
                            context: context,
                            builder: (BuildContext context) => AlertDialog(
                              title: const Text('Deletar'),
                              content:
                                  const Text('Tem certeza que deseja deletar?'),
                              actions: <Widget>[
                                TextButton(
                                  onPressed: () =>
                                      Navigator.pop(context, 'Cancelar'),
                                  child: const Text('Cancelar'),
                                ),
                                TextButton(
                                  onPressed: () =>
                                      //TaskDao().delete(widget.taskName),
                                      Navigator.pop(context, 'Deletar'),
                                  child: const Text('Deletar'),
                                ),
                              ],
                            ),
                          ).then((returnVal) {
                            if (returnVal != null) {
                              ScaffoldMessenger.of(context).showSnackBar(
                                SnackBar(
                                  content: Text('Você clicou no $returnVal'),
                                  action: SnackBarAction(
                                    label: 'Deletar',
                                    onPressed: () {
                                      TaskDao().delete(widget.taskName);
                                    },
                                  ),
                                ),
                              );
                            }
                          });
                        },

Link do gif https://drive.google.com/file/d/1aGhyS0BBv7CCiT8_NI6BiO39zvvJsdxB/view?usp=share_link

Link do Gif `https://drive.google.com/file/d/1aGhyS0BBv7CCiT8_NI6BiO39zvvJsdxB/view?usp=share_link`

1 resposta

Fala Cleber, de boa ?

Cara ficou bem maneiro sua tela! A ideia é continuar se aprimorando e praticando