O ERRO:
I/flutter (19144): Clicou no btn salvar
════════ Exception caught by gesture ═══════════════════════════════════════════════════════════════ The following StackOverflowError was thrown while handling a gesture: Stack Overflow
When the exception was thrown, this was the stack:
#0 StringBase.interpolate (dart:core-patch/string_patch.dart:835:3)
#1 Transferencia.toString (package:byte_bank/modelos/Transferencia.dart:12:70)
#2 StringBase.interpolate (dart:core-patch/string_patch.dart:842:19)
#3 Transferencia.toString (package:byte_bank/modelos/Transferencia.dart:12:70)
#4 StringBase.interpolate (dart:core-patch/string_patch.dart:842:19) ... Handler: "onTap" Recognizer: TapGestureRecognizer#f7d3c debugOwner: GestureDetector state: possible won arena finalPosition: Offset(152.3, 272.0) finalLocalPosition: Offset(29.8, 26.0) button: 1 sent tap down ═════════════════════════════════════════════
E O CÓDIGO :
Widget botaoSalvarTransferencia() {
return RaisedButton(
child: Text(
"Salvar",
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
color: Colors.blueAccent,
textColor: Colors.white,
padding: const EdgeInsets.fromLTRB(32, 16, 32, 16),
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(8.0),
),
onPressed: () {
print("Clicou no btn salvar");
final double valor = double.tryParse(_controladorValor.text);
final int numeroDaConta = int.tryParse(_controladorNumeroConta.text);
if (numeroDaConta != null && valor != null) {
final transferencia = Transferencia(valor, numeroDaConta);
debugPrint('$transferencia');
}
},
);
}