void main(){
ContaCorrente conta = ContaCorrente();
conta.titular = "Gabriel";
conta.agencia = 123;
conta.conta = 1234;
conta.saldo = 150.0;
print("Titular: ${conta.titular}");
print("Agência: ${conta.agencia}");
print("Conta: ${conta.conta}");
print("Saldo: ${conta.saldo}");
}
class ContaCorrente {
String titular;
int agencia;
int conta;
double saldo;
}
banco.dart:15:10: Error: Field 'titular' should be initialized because its type 'String' doesn't allow null.
String titular;
^^^^^^^
banco.dart:16:7: Error: Field 'agencia' should be initialized because its type 'int' doesn't allow null.
int agencia;
^^^^^^^
banco.dart:17:7: Error: Field 'conta' should be initialized because its type 'int' doesn't allow null.
int conta;
^^^^^
banco.dart:18:10: Error: Field 'saldo' should be initialized because its type 'double' doesn't allow null.
double saldo;
^^^^^