Questions tagged [flutter-http]

241 questions
0
votes
1 answer

Flutter how to pass form data to api

I Have a form to get data from the user. The objective is to pass the form data as an object to the Api. The Form is as follows. Form( key: _formKey, child: Column( children: [ …
Febin Johnson
  • 277
  • 1
  • 6
  • 21
0
votes
2 answers

Flutter HTTP post request JSON handling not working properly

I am using nodejs backend with flutter app. I use flutter http package to send requests. I want to send datetime via the request, so I converted it to string. So in the node backend this data cannot be converted into original types (like DateTime or…
Pasan Madhushan
  • 205
  • 1
  • 4
  • 10
0
votes
2 answers

The class 'List' doesn't have a constructor named 'fromJson'. Try invoking a different constructor, or define a constructor named 'fromJson'

class Product { String status; List note; List table; Product({this.status, this.note, this.table}); Product.fromJson(Map json) { status = json['status']; if (json['note'] != null)…
user16867349
0
votes
1 answer

How to display Future result (error) in Flutter

i am trying to build a address search with Places API. But I don't know how to show the results. The Searchfield class import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter/material.dart'; import…
0
votes
2 answers

How do we transfer data from one screen to another screen in flutter?

@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text( 'Category', ), ), body: Center( child: FutureBuilder( future: fetchCategory(), builder: (ctx, snapShot) { if…
user16867349
0
votes
1 answer

Unable to get response from http request from a localhost API (node js express) on Flutter Web

i build a simple api that has a response body of { "name": "saud", "age": "22" } it is hosted on http://localhost:7283/saud using Node js express app.get('/saud',(req,res)=>{res.status(200).send({name:'saud',age:'22'}) } ); it works if i access from…
Saud Ahmed
  • 65
  • 6
0
votes
1 answer

Flutter http doesn't work in releasebuild

On debug everything works fine. But if I create a releasebuild the Flutter http-libary doesn't work. I've the internet-permission in my androidmanifest. Currently I use Flutter 2.5.0 and http 0.13.3. I've already created a new project, but it…
0
votes
0 answers

Flutter Json returns null

Im trying to retrieve data from a Json. I have created a model as follows. Im receiving a response. When i try to model the response to a list it gives null. I've able to get the length of the list. But i cant access a value, it returns null class…
Febin Johnson
  • 277
  • 1
  • 6
  • 21
0
votes
0 answers

Flutter Edamam no data response

I am currently trying to learn rest APIs. I want to program a food app and I'm using the Edamam food database. https://developer.edamam.com/food-database-api-docs If I do a request on the browser with a sample…
Anima361
  • 31
  • 5
0
votes
1 answer

Flutter - how to get Stream Response of Video mp4 and download it

i am using Multipart Request in which i post image after that i get response of video.mp4 but i dont know how to get this response i tried response.stream.bytetoString() //which give me formatexception which is unexpected byte i dont know…
Adnan haider
  • 553
  • 8
  • 21
0
votes
4 answers

How to get JSON response after onPresseed button in Flutter // Dart

I don't get any issues to get JSON data the button is pressed to get JSON response.body is printed successfully but the JSON response is executed before I give _addressController value the if condition executed so the exception is shown on the print…
0
votes
1 answer

Flutter - cannot download audio files

It's been 3 days that I try to fix an issue with the download of audio files with my Flutter application. When I try to download audio files, the request keep the "pending" status and finish with no error. I have research a lot and find something…
Tryliom
  • 895
  • 1
  • 12
  • 37
0
votes
2 answers

How to change to type of response to Map in flutter

I try to make a GET http call from flutter to Nodejs. The data I get is in json form but when I try to manipulate it with flutter I can't because the response is of type RESPONSE or I can change it to string I don't know how to change the response…
0
votes
1 answer

how to get the values inside Instance of 'Future?>' in Flutter?

I'm using Dio for http requests and the function for post method is like this : Future post(String url, dynamic data) async { try { Response response = await baseAPI.post(url, data: data); return response; } on…
Shashiwadana
  • 492
  • 1
  • 8
  • 16
0
votes
1 answer

how to insert headers on MultipartRequest in flutter

below is the code that I tried but it didn't work, how to insert header on MultipartRequest? var id = prefs.getInt('id'); var token = prefs.getString('accessToken'); var uri = Uri.parse('https://url.com/submit/$id'); var…
Jon
  • 109
  • 2
  • 10