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
!] Flutter (Channel stable, 3.19.0, on macOS 14.4.1 23E224 darwin-arm64, locale pt-BR)
• Flutter version 3.19.0 on channel stable at /Users/usuario/fvm/versions/3.19.0
! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/3.2.0/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/usuario/fvm/versions/3.19.0. Consider adding /Users/usuario/fvm/versions/3.19.0/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision bae5e49bc2 (3 months ago), 2024-02-13 17:46:18 -0800
• Engine revision 04817c99c9
• Dart version 3.3.0
• DevTools version 2.31.1
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/usuario/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /Users/usuario/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15E204a
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] VS Code (version 1.87.2)
• VS Code at /Users/usuario/apps/Visual Studio Code.app/Contents
• Flutter extension version 3.89.20240501
Dart Version
No response
Steps to Reproduce
When using MultipartFile.fromFile does it ask for a contentType parameter that is of type MediaType? but I can't pass the parameter because it is an http_parser parameter but dio does not export the http_parser
for (String mediaPath in genericFormData.filePaths) {
formData.files.add(
MapEntry<String, MultipartFile>(
'files',
await MultipartFile.fromFile(
mediaPath,
filename: path.basename(mediaPath),
contentType: MediaType.parse('.png') ,//Undefined name 'MediaType'. Try correcting the name to one that is defined, or defining the name.
headers: <String, List<String>>{
'Content-Type': <String>['multipart/form-data'],
},
),
),
);
}
for (String key in genericFormData.fields.keys) {
formData.fields.add(MapEntry<String, String>(
key, genericFormData.fields[key].toString()));
}
return formData;
}
The text was updated successfully, but these errors were encountered:
Resolves#2212
### Additional context and info (if any)
Exports `DioMediaType` as the alias of `MediaType` from the `http_parser` package so users don't have to import the transitive dependency explicitly.
---------
Signed-off-by: Benjamin <[email protected]>
Co-authored-by: Alex Li <[email protected]>
Package
dio
Version
5.4.3+1
Operating-System
Android, iOS, Web, MacOS, Linux, Windows
Adapter
Default Dio
Output of
flutter doctor -v
Dart Version
No response
Steps to Reproduce
When using MultipartFile.fromFile does it ask for a contentType parameter that is of type MediaType? but I can't pass the parameter because it is an http_parser parameter but dio does not export the http_parser
Expected Result
Future<FormData?> _convertForFormDataDio(
GenericFormData genericFormData) async {
final FormData formData = FormData();
}
Actual Result
Future<FormData?> _convertForFormDataDio(
GenericFormData genericFormData) async {
final FormData formData = FormData();
}
The text was updated successfully, but these errors were encountered: