Questions tagged [flutter-http]

241 questions
2
votes
1 answer

Null check operator used on a null value while parsing json api in flutter

Following these two api are almost same but one has variant and attributes but other one don't. So I created api model for api 1. and I try to parse both. but only 1st api works and 2nd api returns error. and the error is null check operator used on…
imran sifat
  • 165
  • 1
  • 13
2
votes
0 answers

SafeSearch (Google Cloud API) request not returning anything in flutter app

When users upload a photo in my flutter app I want to call the function below to flag inappropriate images. I first upload the image to firebase storage then call this function using the generated image URL. For now, I just want it to print the…
Globe
  • 514
  • 3
  • 17
2
votes
2 answers

Hero animation is not working when navigating to new page flutter

I have product items in grid view which is a future builder, and wrapped with Hero Widget and gave a unique tag by id, and in detail new page also I wrapped with Hero Widget and gave same unique tag but the animation is working only when coming back…
shanmkha
  • 416
  • 1
  • 8
  • 27
2
votes
0 answers

SSL Certificate verification fail exception on certain device in flutter

When I am creating the flutter app and debugging it then it shows the following error certificate_verify_failed: certificate has expired(handshake.cc:359)) But this error is in the old version of Android not in Android 10 and above. I have resolved…
2
votes
1 answer

How to pass header and body in the HTTP call - Flutter

I'm relatively new to flutter. I'm trying to make an API call using the flutter HTTP package (along with header and body) For example, how could I make the same call in Flutter HTTP? curl --location --request POST 'xyz.com' \ --header 'Referer:…
shakky
  • 434
  • 5
  • 20
2
votes
2 answers

How to assign values from an API call to a variable in flutter

I have the following method which is use dto verify a ticket/token var ticketArray = ticket.split('|'); //First check to verify token using simple versification algo if (widget.eventID.toString() != (ticketArray[0])) { setState(()…
oluwatyson
  • 251
  • 4
  • 18
2
votes
1 answer

unhandled Exception: SocketException: Failed host lookup: URL (OS Error: No address associated with hostname, errno = 7)

EDIT: Question is now Solved I tried the solution over here but it didn't work out for me. cases I have provided internet permissions I am running it on the actual device there is an active internet connection on my device basically, I built an…
vandit
  • 31
  • 1
  • 5
2
votes
1 answer

Why flutter http response in web missing headers?

I am making a simple flutter app using http package. I am trying to send a (post) login request, and the httpresponse is missing all the headers! this works fine in ios simulator but in chrome as you can see there are only 2 headers…
RanH
  • 740
  • 1
  • 11
  • 31
2
votes
0 answers

Payfast Api integration to Flutter App Http request Errors

I am building an app with Payfast payment gateway. The gateways documentaion only covers php side but I want to make it by requesting https. Trying to resolve the situation but don't understand where I am wrong. Trying to make simple form…
Muhtar
  • 1,506
  • 1
  • 8
  • 33
2
votes
1 answer

How to pass data from Model instance (which has a values from api) and give it to Text() widget

How to pass data from Model instance (which has a values from api) and give it to Text() widget? But without an examples with listview please. I need to just give the values to Text widget. In the first block, my weather instance has a values, but I…
Jack Spicy
  • 83
  • 8
2
votes
0 answers

Intercept each http request globally in flutter http package

I have many API calls to the server, in many of them if I get a 401 response then I should forward the user to the login screen to refresh the token that I used for authorization. http.post( URL, body: jsonEncode(loginHttpBody),) …
Ali Abbas
  • 1,415
  • 12
  • 19
2
votes
0 answers

Unhandled Exception: Content size below specified contentLength. 511 bytes written but expected 704

I'm trying to upload text and pdf files code below but I'm receiving the error in the content size. I'm following the code in the document but I'm not sure if I'm doing it the right way. Thanks in advance Future
Waqar Younus
  • 97
  • 2
  • 9
2
votes
1 answer

Realtime Searching: Begin search after user is done typing

In my app I am searching for results as user types something in the a TextField. I'm using Provider where there is a searchProduct() function which is fired every time user types something in the textfield. once the result is fetched I'm calling the…
javaland235
  • 743
  • 3
  • 11
  • 21
2
votes
1 answer

swagger-codegen in flutter project

I am new to flutter and trying to integration below library for using Swagger in flutter project. https://github.com/swagger-api/swagger-codegen/tree/master/samples/client/petstore/dart/swagger Steps which i did so far : 1) added the Path in…
ios developer
  • 3,363
  • 3
  • 51
  • 111
1
vote
1 answer

Flutter http request get null

I'm new to flutter and dart. While learning about get on http request I encounter some error. These are my code import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as ziraHttp; class getHttp extends…
Ziraaa
  • 13
  • 3
1 2
3
16 17