Path Provider Using and Asset Problems - flutter

I want to add an image that I added to my application from the phone's gallery to the list and call it with Image.asset as a String value.
I managed to get the image with ImagePicker. Unfortunately, there is no next. I don't know exactly how to do this.
In short: I will select an image from gallery with ImagePicker and replace it with "Image.file"
I will do it by converting it to String value with Image.asset.

You have to use image.file or image.memory to load an image from ImagePicker.
image.asset is for images that already exist within your app.

Related

How to save image image with current location and some infos in FLutter

I want to save image taken in app with some information as current location(latitude, longtitude),around places(restaurant or something nearest place) ,some variables .this photo wil be shown in application in other page.At the moment i am saving image with rename file and get all infos from file name.Have any other method to save infos with image
AT the moment I am saving image as
/data/user/0/com.example.tflite_image_classification/cache/latidude#longtitude#aroundPlace.jpg
Can anyone have other stategy for save share please
If you are using the google map package, there is a method exists in the instance which is called takeSnapShot.
ex: mapController.takeSnapShot();

how to: save image data to gallery [Flutter]

I have 1 question:
I use a library and it returns the Image data type, so how do I save or share the image in the library of my device?
code:
Image image = await HmsScanUtils.buildBitmap(request);
https://pub.dev/packages/gallery_saver
This plugin saves images and videos to gallery/photos.
You need to provide a path to the file that you want to save like below:
GallerySaver.saveImage(path)
You can use this package
https://pub.dev/packages/gallery_saver.
If you dont understand any documentation given on this page then you can simply follow the following tutorial by Johannes
https://www.youtube.com/watch?v=JILcQLZvjKE

how to save uint8list to gallery as png

I'm working on a project that captures a screenshot of a widget and saves it in gallery.
my problem is there is few save to gallery packages in flutter and I tries almost all of them!
they save images as jpg which adds extra black bars around my widget which I don't want them to be there.
is there any package to save images to gallery in PNG format?
I've found the solution after 2 days of struggling with that.
you should save file as PNG to device path then use image_gallery_saver
package to save it as file
File('$dir/file_name${DateTime.now()}.png').writeAsBytes(pngBytes!);
final result = await ImageGallerySaver.saveFile(imagePath);
You can save image to gallery by using Image_gallery_saver plugin.image_gallery_saver
. For the black bars , you have to make sure that the screenshot is attached to the widget , what you want it image.
await ImageGallerySaver.saveImage(uint8list blob);

Picked gallery Image path flutter

I'm working on a app where I would like to get the local path of the selected/picked image from my mobile gallery instead of image_picker path. I have used image _picker to pick an image from the gallery. When I print the path of the selected image it showing something like this /data/user/0/coffy.testapp/cache/image_picker5380473371212438250.jpg instead I need a path of the image like /data/emulated/downloads/021545.png (The path I can see in my mobile when I click the image details of a particular image);
You need to access local storage and select from there.
https://flutter.dev/docs/cookbook/persistence/reading-writing-files
https://pub.dev/packages/path_provider

ANDROID : Loading Image From link stored in mysql db in imageview?

I want to load image in card view with other data like title and desc.
I am uaing php to get result as json response which is working and also i am able to set data to textview and pass from one activity to other !
Only problem i am facing is in setting image in image view.
i can add image manually by making listview obj and storing link in ArrayList obj
Like obj.add(R.drawable.feature1.jpg)
How to do it dynamically from the json response i am getting ?
Sorry if i sound confusing as i am new to android and just want to make a image gallery where first i will display list of albums and after clicking one of albums all images from that albums are loaded and displayed.
{"products":[{"mid":"1","title":"Demo Video 1","link":"https:\/\/m.youtube.com\/watch?v=PCwjNfSM-U","mediaCreatedOn":"2015-08-30 18:59:18","mediaUpdatedOn":"0000-00-00 00:00:00"},{"mid":"2","title":"Demo Video 1","link":"https:\/\/www.youtube.com\/","mediaCreatedOn":"2015-08-30 18:59:18","mediaUpdatedOn":"0000-00-00 00:00:00"}],"success":1}
The above is the output from server side where only the youtube link is replaced by server img location.
Thank you for reading, have a nice day ahead :)
1:You can store image to database Example:mysite.com/img/34324234342.png (phpMysql)
2:And you can get image from php rest service (Only image link)
3:For load image from link , you can use picasso library (android)
4:If you want image with text, you can use custom listview
Example xml for restful service.
<myimage>
<title>abc</title>
<ipath>mysite.com/img/34324234342.png</ipath>
</myimage>