floatingActionButton: FloatingActionButton(
onPressed: () {
// Chama a tela de formulário e aguarda a nova tarefa criada
Navigator.push(
context,
MaterialPageRoute(
builder: (contextNew) => FormScreen(
taskcontext: context,
),
),
).then((value) => {
setState(
() {
},
)
});
},
child: const Icon(Icons.add),
));
ElevatedButton(
onPressed: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Criando uma nova Tarefa'),
),
);
TaskDao().save(Task(
nameController.text,
imageController.text,
int.parse(difficultyController.text)));
Navigator.pop(context);
},
child: const Text('Adicionar!'),
),