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

422
Visualizações
How to cast/convert a browser FormData object to a Dart object, in Flutter Web?

Basically I have a FormData object on the Javascript side in Flutter Web.

I need to send this object to Dart in order to make a http POST request, having the object's fields (including some eventual Blob/File field, as well) as the payload. The way I send this object to Dart is by registering a callback in Dart on the js.context window object, and calling that from the Javascript side.

Now, I've tried many different ways to achieve this:

  • Get all it's fields using the spread operator, [...formData]
  • JSON.stringify it and send it as a String
  • JSON.stringify it's .entries()
  • JSON.stringify it's keys() and values() individually
  • some other work-arounds I found on the internet

I was able to send FormData's "simple" fields (String, number, Array, Object) BUT NOT FILE/BLOBs using theese approaches.

Is there any way to get that FormData object as a whole? That is, including the Files/Blobs it might contain, if any.

Thanks

about 4 years ago · Juan Pablo Isaza
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