Flutter: How to display phone gallery on a container? - flutter

I found a way to display live camera on a container(). But I want to display gallery on Container() in app and control like photo example.
Is it possible in flutter ?

I'm not sure it would be possible to implement this but one things I have thought of is to request External Storage Access and maybe get the directory where all photo are stored and display the from File. However, this approach may need to a lot exceptions thrown.
I normal image_picker invokes the native channel to be able show the Android Native UI and same for iOS.

Related

Flutter Menu App that gets pictures from firebase

I have a flutter app that is a menu for a restaurant. Now the problem is that I want to get the pictures from firebase. Currently, if you open the app, the pictures take time to load and you can see that with your eyes, it is a bit annoying and not practical regarding bandwidth data usage.
Is there any chance I can cache the images when I get them from firebase and than appear instantly? I request the links of the images once the page is open using a future and display them with a CachedNetworkImageProvider() with the image URL but that still takes time to load the images. Is there a way to download all the data in the firebase at once when you open the app and not check every time you open the app?
for all apps that require fetching images from a remote location, what i have been doing so far is download the image locally and use the local image instead of the remote one if it exists locally, from my knowledge cachedNetworkImage only caches the image after fetching when the app is currently running and refetches the image when the user restarts the app.
Please if you do find another way to cache images that would be cool and remove a lot of boiler plate code, please do post it, thanks.

What is the difference between image_picker plugin and the file_picker plugin

can someone please explain the difference in these plugins and what are the advantages of using each and whether they do the same work or maybe they each do a completely different task
Short Answer: Always use image picker if you want to get images from the user. Otherwise, use file_picker.
Long Answer:
Both image picker and file picker open another app that returns an image/file that the user picked.
The advantage of image_picker over file picker is that the user gets to use their installed gallery app to pick images. This is a familiar environment to the user and is generally a lot easier to use than the generally more unfamiliar file explorer on android.
The disadvantage on the other hand is that it only works for images.
So, always use image picker if you want to get images from the user. Otherwise, use file_picker.
There is a main difference on iOS devices, file picker will redirect you to the files app, while image picker will redirect you to the gallery.
In iOS, and unlike android, Images and files exist in two completely different places, so depending on what you want to fetch you need to use the right package

pick image from internet in flutter

I wonder whether is any way to pick images from web in a flutter app??
I'm looking for something like whats app image picker
something like that
I've looked for many libraries but I didn't get what I'm looking for.
You can use available APIs such as Google Images API, which will provide images based on search request. Google Search API There are plenty of it available.

Record screen with flutter in the background as a stream

So I want to create an app for android and ios that allow the user to stream their screen to another place, I'm thinking something like google cast and the likes
I can easily find flutter screen recording, for android and ios in one package, but there doesn't seem to be one that lets me capture the screen to a stream of some sort (i do NOT want it saved as a file)
I'm thinking I could maybe create my own package for this, in which case, is there any kind of "standard" video stream in a flutter that would widely be accepted to just work, like a google cast API or whatever? From what I can find, there isn't...
There's a Flutter plugin (flutter_screen_recording) that you can use for screen capture on Android and iOS. Though this requires Android SDK 21+ and iOS 10+.
To start screen recording
bool started = FlutterScreenRecording.startRecordScreen(videoName);
then to end the recording
if(started){
String path = FlutterScreenRecording.stopRecordScreen;
debugPrint('Screen recording path: $path');
}

Flutter Images and Video Saved using path_provider not showing in Gallery

I want to record a video or audio in my Flutter App and wants it to appear in gallery. How can I do it because path_provider is saving file to safe location and one need a rooted device to access it.
I was trying Flutter Camera Plugin Example
Also asked on https://github.com/flutter/flutter/issues/20807
The reason I was facing the problem is that the example I was trying uses path_provider function "getApplicationDocumentsDirectory()" to store the files.
By replacing above Function with "getExternalStorageDirectory()" I am able to store the file in the external directory and they appear in the Gallery.
You need to do scan media files using broadcast intent.
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(YOUR_PATH)));