void main() {
ContaCorrente conta;
print(conta);
}
class ContaCorrente {
String nome;
int agencia;
int conta;
double saldo;
}
Erro:
main.dart:4:9: Error: Non-nullable variable 'conta' must be assigned before it can be used. print(conta); ^^^^^ main.dart:8:10: Error: Field 'nome' should be initialized because its type 'String' doesn't allow null. String nome; ^^^^ main.dart:9:7: Error: Field 'agencia' should be initialized because its type 'int' doesn't allow null. int agencia; ^^^^^^^ main.dart:10:7: Error: Field 'conta' should be initialized because its type 'int' doesn't allow null. int conta; ^^^^^ main.dart:11:10: Error: Field 'saldo' should be initialized because its type 'double' doesn't allow null. double saldo; ^^^^^
Está dando erro de inicializar a variável mas realizei o procedimento igual a aula https://cursos.alura.com.br/course/dart-orientacao-objetos/task/70776. Alguém me ajuda?