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

836
Visualizações
Flutter Error: Unsupported operation: Platform._version on web

I use packages http: ^ 0.12.2

this is my iport

import 'package: http / http.dart' as http;
import 'dart: io';
import 'dart: convert';

for retrieving the data from a server. It works fine with Android and iOS. But on the web I get the error message Unsupported operation: Platform._version

this is my function:

Future getUserData() async {
    var url_ = "${APIDomain}/antragsteller/1";
      HttpClient client = new HttpClient();
      client.badCertificateCallback =
          ((X509Certificate cert, String host, int port) => true);

      HttpClientRequest request = await client.getUrl(Uri.parse(url_));
      request.headers.set('content-type', 'application/json');
      request.headers.set('Access-Control-Allow-Origin', '*');
      HttpClientResponse response = await request.close();

      String reply = await response.transform(utf8.decoder).join();
      this.userData = jsonDecode(reply);
  }

the return value is then of course empty. My internet search did not produce any useful results. Can someone please help me find the cause and solve the problem. Thank you!

over 4 years ago · Santiago Trujillo
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