Questions tagged [dio]

Dio is a powerful HTTP client for Dart, which supports interceptors, global configuration, form data, request cancellation, file downloading, timeout, etc.

Dio is a powerful HTTP client for Dart, which supports interceptors, global configuration, form data, request cancellation, file downloading, timeout, etc.

References

Dio Dart package.

664 questions
-1
votes
2 answers

Flutter HTML response instead of json

I am having error, kindly help me with this code, new to Flutter here. When I'm using https://jsonplaceholder.typicode.com/posts it is working fine, but I am receiving error using my company URL, but when I am using postman to POST the company URL…
DL Studio
  • 267
  • 3
  • 7
-1
votes
2 answers

How to add response header in DIO package

I have been experiencing the CORS XMLHttpRequest error Access to XMLHttpRequest at 'https://maps.googleapis.com/maps/api/place/autocomplete/json?params' from origin 'http://localhost:49234' has been blocked by CORS policy: Response to preflight…
Andrea herrera
  • 81
  • 1
  • 11
-1
votes
1 answer

How implement Flutter login authentication & registration using Http post

How users got to know login Successful or Login Unsuccessful? when the user put the correct LoginId & Password, which is in my API, then only it should show a snack bar that the login is successful otherwise user is not found. my login_model.dart …
Tuhin
  • 194
  • 4
  • 16
-1
votes
1 answer

Flutter: 'List' is not a subtype of type 'String'

I am currently building an app to read data through an api and I am trying to parse a JSON api from JSON Placeholder. Unhandled Exception: type List
Haree Prasad
  • 103
  • 1
  • 2
  • 8
-1
votes
1 answer

Flutter dio&retrofit

I am trying to make a post request with dio. The body of my request contains the data with the format indicated in the image However, a list of objects with key "details" are not processed. Here is my request…
-1
votes
1 answer

How Flutter can decode a very large json array, Flutter just decode the only first 20 items?

Hello I've an api that return a big list the min length of this list could be 100 or 120 element, and flutter decode only first 20 element is the list. Now that it seems to you that I load a very large json array elements and don't care about the…
-1
votes
2 answers

Can't get data when 400 error. in Flutter

I'm trying to implement login with the Dio package in my app. When I send the correct email and password I get a 200 status code and user data. But when I send the email or password incorrect backend sends 400 error code and data like this…
Mr. ZeroOne
  • 904
  • 6
  • 20
-1
votes
1 answer

best approach to parse JSON using generic types in flutter/dart

In my project, I have multiple model classes consisting of their own JSON parsing methods, how can I use generic type to increase code reusability. NOTE: for HTTP request am using DIO package
-1
votes
1 answer

Getting Format Exception while parsing token with '|' in jsonDecode()

Getting the format exception while passing the token with '|' inside jsonDecode(). final SharedPreferences pref = await SharedPreferences.getInstance(); value = pref.get("token") as String; if (value?.isEmpty ?? true) { return null; …
gowthaman C
  • 472
  • 6
  • 16
-1
votes
2 answers

How to navigate to different screen on success response in flutter using dio

I'm trying to navigate to other screen after success response using dio. but i'm having an error, and still stack at login. I'm still starting with flutter. here's my login page import 'dart:ui'; import 'package:app/utils/api_provider.dart'; import…
-1
votes
1 answer

Flutter: How to get Response from a url after the webpage is finished loading?

I wanted to read through the HTML of a website from a dio get request in my flutter code. The website takes in an input, for my case in the URL and loads for some time before showing all the received data from the backend. Because it takes time to…
Blen
  • 151
  • 3
  • 15
-1
votes
1 answer

Flutter/Dio Hangs when in an isolate

So I'm trying to sync my database in an isolate, since UI doesn't care about the sync. Database _backgroundConnection(File dbFile) { final database = VmDatabase(dbFile); var connection = DatabaseConnection.fromExecutor(database); return…
Cate Daniel
  • 724
  • 2
  • 14
  • 30
-2
votes
0 answers

Unhandled Exception: DioError [bad response]: The request returned an invalid status code of 500

utilize Dio to create a POST request. Within this request, I transmit two pieces of information: an XFile, which represents an image obtained through an image picker, and a name provided as a String. The structure of my request function is as…
-2
votes
1 answer

Unable to save/upload files to a folder on server with Dio and File_picker flutter packages & I am doing this with PHP

The problem I am facing is that the files I upload ta server are not being uploaded inside a folder but the filename is submitting into the database. I am providing all data related to selecting a file and then uploading it to the server My flutter…
-2
votes
1 answer

How can I show progress status of upload with dio?

var response = await ApiService().dio.post( url, data: formData, onSendProgress: (count, total) { //use this for upload status }, ); How can I use onSendProgress to update my UI? Is there a way to use it as a stream? How can I do it otherwise? I…
1 2 3
44
45