dio icon indicating copy to clipboard operation
dio copied to clipboard

FormData and List of Int not working as expected.

Open isalcedo opened this issue 1 year ago • 2 comments

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 avatar Jun 10 '24 02:06 isalcedo

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)

coder-xb avatar Jun 13 '24 10:06 coder-xb

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 avatar Jun 15 '24 04:06 AlexV525

Closing as no active discussions are happening in this thread and the library seems to work as expected.

AlexV525 avatar Jan 23 '25 13:01 AlexV525