error in update flutter + firebase method

Asked

Viewed 55 times

0

Good afternoon!

I’ve got an item error repo.senha and repo.nome.

 void atualizar(Repositor repo) async {
    var update = Map<String, String>();
    update.putIfAbsent("senha", repo.senha);
    update.putIfAbsent("nome", repo.nome);
    await _userRef.child(repo.cpf).update(update).then((_) {
      print("Update Sucess");
    });
  }

the msg passes is:

The argument type 'String' can’t be Assigned to the Parameter type 'String Function()'

  • Please read friend: https://pt.meta.stackoverflow.com/questions/5483/manual-de-como-n%C3%83o-faq? cb=1

2 answers

1

The error is in returning a type String, place .toString() at the end of each object as name and password

0

o Error was the method takes a function that returns an object of type String, had to pass ()=>Repo.password and ()=>Repo.name

Browser other questions tagged

You are not signed in. Login or sign up in order to post.