716 questions
Score of 0
1 answer
59 views
Using Package Dio in Flutter - sending multiple images(multipart) under one key
I am trying to send multi-part data to the back end server who expects a single key/field("images") to contain 2 multipart files.
Ive tried everything using Dio but nothing seems to work.
...
Score of 0
1 answer
71 views
Flutter Dio interceptor issue
class ApiClient {
final Dio dio;
final FlutterSecureStorage storage;
ApiClient(this.dio, this.storage) {
print('ApiClient constructor is being called');
dio.options = BaseOptions(
...
Score of 3
0 answers
139 views
flutter version 3.38.2 slow api calls
A dio.get() call that takes only 150 ms with curl blocks for 6–8 seconds on the client side.
The pause happens before Dio prints the first REQUEST log line, so the delay is not caused by DNS, TLS, or ...
Score of 2
1 answer
91 views
Token refresh with dio fails (sometimes)
This is the code of AuthInterceptor which I use for triggering token refreshing. For safety (that I the interceptor of main dio instance won't attach accesstoken to refresh token api) I even use a ...
Score of 0
1 answer
79 views
How to handle http post violations and show them on the screen
I'm learning Flutter and this is how I handle a post http request right now
ApartmentRepository class:
Future<bool> createApartment(Apartment apartment) async {
String path = baseUrl;
...
Score of 1
1 answer
208 views
Flutter Dio: Do not log error to Sentry on Cancel Token error
I have some cases in which I am cancelling the token for certain API requests. This is treated by Sentry as an error and being logged into Sentry.
I would like cancel token errors to not be logged.
I ...
Score of 1
0 answers
87 views
Unexpected character (at line X, character Y) with no clear source
I'm using Flutter, Dio, and Retrofit in an MVVM architecture.
Recently, I started getting this error:
FormatException: Unexpected character (at line 146, character 3)
The debug console shows no ...
Score of 0
1 answer
134 views
Getting Grafana Faro's HTTP logging inside of a dart isolate
Imagine I have a flutter application using faro-flutter-sdk to get logging and event tracking in iOS/Android devices. We use Dio for all of our HTTP requests, so, as long as we set HttpOverrides....
Score of 1
2 answers
225 views
How to solve exception "toJson() method have to add to MultipartFile" when uploading image?
I'm using the retrofit package with dio in Flutter to upload a file using @MultiPart() and MultipartFile. But when I run build_runner, I get this error:
retrofit_generator on lib/features/schedule/...
Score of 3
0 answers
122 views
Displaying an exception while using try catch
I have an application that I used dio and made a try catch on DioException, but it still shows an exception from the dio mixin, even though I did everything correctly. It still shows it, and when I ...
Score of 0
1 answer
294 views
Token refresh in Flutter with Dio interceptor
I'd need some help regarding token refresh in Flutter app which uses built-in Provider and Dio package. I use MVVM architecture with repositories and services as data layer.
I use go_router and its ...
Score of 2
1 answer
67 views
Dio upload (POST) request isn't sent
I have an issue with existing code, which worked in the past but suddenly stopped working.
I am trying to upload, using dio, but the request isn't getting sent anymore.
This would be the method called:...
Score of 1
0 answers
68 views
exception error when using imgur on flutter web
i am implementing image upload in my app. i want to use imgur's api. i got the code from the postman collection in their docs. but i am getting - DioException [connection error]: The connection ...
Score of 1
0 answers
39 views
Upload image to api with bio in flutter
In my flutter code. I'm using this method to upload the image:
Future<Either<Failure, String>> uploadImage({required File image}) async {
final String? accessToken = await ...
Score of 0
0 answers
66 views
Issue with iOS Flutter App where API sometimes showing DioExpception in iOS
I am working on a project where once user fills the Address field, there is drop down showing list of addresses and once user selects the address, the Postal code is extracted from the address and is ...