I used dio library to post file to a server and it is working fine, now i want to post multiple images to server that user selects from gallery, following is the code from documentation of dio library for uploading multiple files
FormData formData = new FormData.from({
"name": "wendux",
"age": 25,
"file1": new UploadFileInfo(new File("./upload.txt"), "upload1.txt"),
// upload with bytes (List<int>)
"file2": new UploadFileInfo.fromBytes(
utf8.encode("hello world"), "word.txt"),
// Pass multiple files within an Array
"files": [
new UploadFileInfo(new File("./example/upload.txt"), "upload.txt"),
new UploadFileInfo(new File("./example/upload.txt"), "upload.txt")
]
});my question is that how can i implement this in my code for images?? because i don't know that how many images are selected by user.