Repository navigation
formData issue #2171
Closed
Akwasititus
started this conversation in
General
formData issue
#2171
Replies: 4 comments 2 replies
|
Try using 'as prefix' for one of the import directives, or hiding the name from all but one of the imports. |
1 reply
|
Just do what the message says, this is not related to dio but basic Dart. import 'package:dio/dio.dart' as dio;
import 'package:get/get.dart';
var formData = dio.FormData.fromMap({
'name': 'John Doe',
'email': '[john.doe@example.com](mailto:john.doe@example.com)',
'file': await dio.MultipartFile.fromFile('/path/to/file.jpg'),
});or import 'package:dio/dio.dart';
import 'package:get/get.dart' hide FormData, MultipartFile;
var formData = FormData.fromMap({
'name': 'John Doe',
'email': '[john.doe@example.com](mailto:john.doe@example.com)',
'file': await MultipartFile.fromFile('/path/to/file.jpg'),
}); |
0 replies
|
Thank you, sir, your solutions really helped me. please is there a way i can send the form-data post request using the |
1 reply
|
Thank you, sir. I appreciate your concern. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The name 'FormData' is defined in the libraries 'package:dio/src/form_data.dart (via package:dio/dio.dart)' and 'package:get/get_connect/http/src/multipart/form_data.dart'.
Try using 'as prefix' for one of the import directives, or hiding the name from all but one of the imports.
All reactions