Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormData and List of Int not working as expected. #2241

Open
isalcedo opened this issue Jun 10, 2024 · 2 comments
Open

FormData and List of Int not working as expected. #2241

isalcedo opened this issue Jun 10, 2024 · 2 comments
Labels
h: need more info Further information is requested h: need triage This issue needs to be categorized s: bug Something isn't working

Comments

@isalcedo
Copy link

isalcedo commented Jun 10, 2024

Package

dio

Version

5.4.3+1

Operating-System

Android, iOS

Adapter

Default Dio

Output of flutter doctor -v

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.2, on Arch Linux 6.9.3-arch1-1, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2023.3)
[✓] Connected device (3 available)
[✓] Network resources

Dart Version

Dart SDK version: 3.4.3 (stable)

Steps to Reproduce

  1. Declare: List<int> categories = [104, 105];
  2. Declare: Map<String, dynamic> jsonPayload = {'categories': categories};
  3. Print: print(FormData.fromMap(jsonPayload).fields);

Expected Result

[MapEntry(categories[0]: 104), MapEntry(categories[1]: 105)]

Actual Result

[MapEntry(categories: 104), MapEntry(categories: 105)]

@isalcedo isalcedo added h: need triage This issue needs to be categorized s: bug Something isn't working labels Jun 10, 2024
@coder-xb
Copy link

I also encountered the same problem.
This is my flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.5 23F79 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] Connected device (4 available)
[!] Network resources                   
    ✗ A network error occurred while checking "https://maven.google.com/": Operation timed out

! Doctor found issues in 1 category.

And my Dart SDK version also is 3.4.3(stable)

@AlexV525
Copy link
Member

Could you explain why you think the result should be the indexed version, maybe some specs or documents? Also it would be great if you could provide a working version of the library.

@AlexV525 AlexV525 added the h: need more info Further information is requested label Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
h: need more info Further information is requested h: need triage This issue needs to be categorized s: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants