Skip to content

Instantly share code, notes, and snippets.

@allansrc
Created April 5, 2025 22:03
Show Gist options
  • Save allansrc/e1443c9edbd4ad052ff6c21df7fd7269 to your computer and use it in GitHub Desktop.
Save allansrc/e1443c9edbd4ad052ff6c21df7fd7269 to your computer and use it in GitHub Desktop.
requestPostWithFile() async {
final file = File('path');
final formDataRequestObject = FormData.fromMap({"objeto": "address"});
formDataRequestObject.files.add(
MapEntry('files', await MultipartFile.fromFile(file)),
);
final response = await Dio().post(URI, data: formDataRequestObject);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment