You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If Map response data and headers are set together it throws the exception Error: TypeError: Instance of 'IdentityMap<String, String>': type 'IdentityMap<String, String>' is not a subtype of type 'String'.
print(response.data); should print {name: John, surname: Doe}.
Screenshots
No screenshots
System details
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.3 23D5033f darwin-arm64 (Rosetta), locale en-US)
[✓] 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.2)
[✓] VS Code (version 1.90.0)
[✓] Connected device (4 available)
! Error: Browsing on the local area network for Filip‘s iPad. Ensure the device is unlocked and attached with a cable or associated with the
same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• No issues found!
Fetching Foo, Map body without headers works
{name: Foo, surname: Bar}
Fetching Foo finished
Fetching Jane, String body with headers works
{
'name': 'Jane',
'surname': 'Doe',
}
Fetching Jane finished
Fetching John, Map body with headers DOES NOT work
ERROR HAPPENS HERE
DioException [unknown]: null
Error: TypeError: Instance of 'IdentityMap<String, String>': type 'IdentityMap<String, String>' is not a subtype of type 'String'
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 296:3 throw_
packages/dio/src/dio_mixin.dart 509:7 fetch
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 60:31 <fn>
dart-sdk/lib/async/zone.dart 1666:54 runBinary
dart-sdk/lib/async/future_impl.dart 178:22 handleError
dart-sdk/lib/async/future_impl.dart 859:46 handleError
dart-sdk/lib/async/future_impl.dart 880:13 _propagateToListeners
dart-sdk/lib/async/future_impl.dart 660:5 [_completeError]
dart-sdk/lib/async/future_impl.dart 746:7 callback
dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7 <fn>
Fetching John finished
The text was updated successfully, but these errors were encountered:
Description
If Map response data and headers are set together it throws the exception
Error: TypeError: Instance of 'IdentityMap<String, String>': type 'IdentityMap<String, String>' is not a subtype of type 'String'
.Steps to reproduce
Expected behavior
print(response.data);
should print{name: John, surname: Doe}
.Screenshots
No screenshots
System details
flutter doctor
pubspec.yaml
Additional context
Here is the minimal not working app.
https://github.com/cizmarf/HttpMockAdapterBugReport/blob/main/lib/main.dart
Its output is:
The text was updated successfully, but these errors were encountered: