First, add the image_picker Flutter package as a dependency by adding the following line in your pubspec. yaml file. Now write the function for pick image from Gallery. The optional parameter imageQuality accepts any value between 0 to 100, you can adjust it according to the size and quality required by your app.
Read moreHow do you upload pictures to Flutter?
To upload image in Flutter there are multiple way to upload image through flutter we can use http library . Here is full source code to upload image in flutter. And second one is Dio package we can use dio package to upload image.
Read moreHow do I send a file in HTTP Flutter?
dart’ as http;
Read moreHow do I upload a file using multipart in Flutter?
There is a static method in MultipartFile class which will be helpful called, fromPath which returns Future. You can add the file in your request body using request. files. add() method.
Read more