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
Related
I'm looking for a way to play a multimedia file saved in the ram memory of the mobile phone in flutter !.
Apparently the video_player package does not accept files in memory but only files on ssd, asset or url. Do you know a way to do this in flutter?
Are you allowed to cache videos?
If yes, you could try using flutter_cache_manager to cache your videos and play them from the cache.
Do note that, as written in the package README:
By default the cached files are stored in the temporary directory of the app. This means the OS can delete the files any time.
Also check out this answer from a similar thread on stack overflow.
EDIT
Since it is required to not save the video on it could be an option to use the better_player, which has the option to read a video file directly from memory, using BetterPlayerDataSource.memory as the data source.
Refer to this section of the documentation for more info.
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.
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
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
Anyone knows the max size of Safari's 'Offline Application Cache' on the iPad & iPhone. Looks like it's 5MB. Is there any way to enlarge this size?
Offline application cache docs: https://developer.apple.com/library/archive/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/OfflineApplicationCache/OfflineApplicationCache.html
I have the same problem on iPhone. On iPad though I figured a turn around. If your manifest contains files less than 5MB the first time and you update the cache by window.applicationCache.update() and before doing the update you increase the manifest files to be below 10mb it will work. If you continue doing that (increasing the manifest by <5MB each time and then update()) you will see that the iPad can cache more than the 5MB limit.
It is so sad that Apple by not supporting Flash and MIDP but only HTML5 for web-apps screws so much on that.
If your application uses more than 5mb than iPhone/iPad will ask the user to allow the website to use more space.
Let's read my test at here: Mobile Safari 5mb HTML5 application cache limit?
I think your apps need user's agreement for storage more than 5MB. Another problem you get is the network problem. It's too slow for 50MB transferring...