GIF https://drive.google.com/file/d/1F__XVbnERUgEohZ0BxHvrIAFpjdge2aF/view?usp=share_link
onLongPress: (){
showDialog(
context: context,
builder: (_) => _confirmarExclusao(),
barrierDismissible: true,
);
//
},
AlertDialog _confirmarExclusao(){
return AlertDialog(
title: const Text('Confirmação'),
content: const Text('Confirma a exclusão?'),
actions: [
TextButton(onPressed: (){
TaskDao().delete(widget.nome);
ScaffoldMessenger.of(context)
.showSnackBar(const SnackBar(
content: Text('A tarefa foi excluída!'),
backgroundColor: Colors.redAccent,
));
Navigator.pop(context, 'OK');
}, child: const Text('OK')),
TextButton(onPressed: (){
Navigator.pop(context, 'Cancelar');
}, child: const Text('Cancelar'))
],
);
}