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. |
Beta Was this translation helpful? Give feedback.
-
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': '[[email protected]](mailto:[email protected])',
'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': '[[email protected]](mailto:[email protected])',
'file': await MultipartFile.fromFile('/path/to/file.jpg'),
}); |
Beta Was this translation helpful? Give feedback.
-
Thank you, sir, your solutions really helped me. please is there a way i can send the form-data post request using the |
Beta Was this translation helpful? Give feedback.
-
Thank you, sir. I appreciate your concern. |
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions