@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Transferencia'),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
final Future<Transferencia?> future = Navigator.push(context, MaterialPageRoute(builder: (context){
return FormularioTransferencia();
}));
future.then((transfRecebida) => debugPrint('Trans recebida'));
if(transfRecebida != null) {
_transferencias.add(transfRecebida);
O ERRO OCORRE AQUI.
}
},
child: const Icon(Icons.add),
),
body: ListView.builder(
itemCount: _transferencias.length,
itemBuilder: (context, int indice) {
return ItemTransferencia(_transferencias[indice]);
},
)
);
}