Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

452
Visualizações
flutter with Sqflite : The return type 'Null' isn't a 'Future<_>', as required by the closure's context

I have a problem function of Inserted => The return type 'Null' isn't a 'Future<_>', as required by the closure's context

enter image description here

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You have to add async to your function.

await database.transaction((txn) async { });

I would also replace then / catchError inside the function with await and try/catch.

about 4 years ago · Juan Pablo Isaza Relatório

0

If function use async-await then you have to use Future

Future<void> -> function is future and return null
Future<String> -> function is future and return String as output

In above you can replace Future<_> by the return type you expect. I think you have to return int, it will help to know on which row CRUD operation is performed

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda