Adding large number of images to Flutter App - flutter

I'm creating a Flutter App and I have to use about 600 PNG images (totalling 75 MB) I have tried adding the images folder and use it directly and the APK exceeded 100 MB size! how can I do this and avoid this huge APK size? Thanks in advance! :)

I would suggest you to use a cloud storage service like firebase,azure,google-cloud or any other simple server.
Then use CachedImage or Network Image widget and fetch them from the url. This is the best way to get large number of images with just less size of app

For such a large amount of images I would suggest you to use cloud storage as Krish told you before. In your case that you want your qpp to work offline you could still save some images in your assets folder and some in the cloud so the appa could be still usable and in a smaller size

Related

Read Cache Storage Size with Flutter_Cache_Manager

I'm using Flutter_Cache_Manager Plugin to cache Files in my App.
Inside the App I want to display the entire Cache-Size in MB but I could not find a solution for that yet.
Does anyone know how I can read the cache size in MB?
Thanks

Flutter - How to compress image to display thumbnail?

I am making a flutter app which loads about 700+ image from Cloud Storage through Firebase. Though, I am using pagination, the app still crashes sometimes on low end devices(does not crash on emulator). I have already compressed all my images, still sometimes it crashes. Is there a way to compress images when we load them from firestore to display only low quality thumbnails. It's a wallpaper app. So what I want to do is, display low quality images when loading all of them to reduce work load on the device and then use the original quality when setting them as wallpaper.
Note: I assume you're loading the images from Cloud Storage through Firebase, and not from Firestore itself. Firestore is a document database, while Cloud Storage is used for storing files. While both are part of Firebase, it's best not to confuse them.
There is no built-in functionality to generate thumbnails in Firebase or Cloud Storage. But there is an extension to resize images that you can enable, and that will then generate a thumbnail (or your specification) when new images are uploaded.

Large storage in Flutter web

Is there a way to store approximately 2GB of binary data (video files with ~600MB each) in Flutter web?
I need to support web on both desktop and mobile devices.
I tried Localstorage (converting everything to List<int>), but it caps out at a couple of MB. Drift seems to be based on Localstorage aswell. Best thing I found was Sembast, which uses IndexedDB, but even there I seem to be reaching the limits.
Maybe there's a work-around to access the file system?
Edit: I basically want to cache the videos, so they are available offline (so downloading and using FilePicker is not an option). I also considered using assets, but 2GB would be too much to download initially, even if I compress it.

How get images from Firebase Storage?

I have an application that uses a lot of images. I would like to store these images outside the ios/android device. I decided to store some of the images in firebase storage. How can I get images using storage? Like this
Image.asset(brand.model[0].model_image[index].image,
fit: BoxFit.fill),
Its better to store all these images in your app directory it will increase your app size but the images will load faster as they will be in the app itself plus help in reducing the data usage for the user as the app will not download the images on app launch but still if you want to keep the images in a outside server Firebase Storage will be the best use.
You can keep the assets separately in a folder called assets and you can use that from there. The only thing you need to do is specify the path in pubsec.yaml file to access the images.
I would always do it like.
assets
|_____images
|_____svgs
|_____audios
Hope this will help you to keep it organized.
I'm also into Flutter and Firebase, trying to keep the actual application as small as possible. I could write everything out right here, but the creators of FlutterFire have a website that explains every step in detail. This link below will direct you to the first step of using cloud storage.
Link: FlutterFire Cloud Storage

External Storage

I am developing an app where i have thousands of images i am reading from the sdcard. I would like to say when i deploy the app, the images are downloaded together with the app. I have been trying to find a solution to this but no help. Please help!!!
The images are used as bitmap resources for imageViews. the are too many that I can't put them in drawable because they will make the app size too big.
Right now i have manually copied them over to the storage of the device i am accessing them from there. If I want to test thye app on another device then i have to copy the images folder again to the external drive of that device. Is there a way i can include them in the solution without putting them in drwable
I would suggest to keep your images on some web server and try to download the images from here.This will avaoid coping images all the time to devices .
So here is what you can do :
1 ) Upload the images on some server .
2) Also you can have a xml which will have urls of all the image.
3) When you start your application you first fetch the XML and get the urls.
4) then using these urls you can lazy load the images in your app.
try to read and understand this concept here :
Thanks