CachedNetworkImage (Package of the Week)
Вставка
- Опубліковано 14 жов 2024
- Learn more about CachedNetworkImage → goo.gle/3wovaGc
A picture is worth 1,000 words, but is it worth 2,000? Use CachedNetworkImage to stop re-downloading images in your Flutter apps 🌄💙
This video is also subtitled in Chinese, Indonesian, Italian, Japanese, Korean, Portuguese, and Spanish.
Learn everything about Flutter at → goo.gle/2WAhEN1
Get more tips! → goo.gle/Flutte...
Subscribe to Flutter! → goo.gle/FlutterYT
#PackageoftheWeek #Widgets #Flutter
product: Flutter - Development - User interface; fullname: Khanh Nguyen;
I cannot express that how great people flutter engineers are. These video made me better today. Thank you flutter team.
I love the way it is always "and thats it". all of big works is in just some teeny tiny words.
This is one of the greatest widgets ever. It will save us a lot of money 💸💸💸
I was searching for this type of widget for so long ....😍😍
Less money when dealing with Firestore great 😁
i have been waiting for this kind of widget thank you flutter team
it's a pretty old package. And it's not from the official flutter team.
I am glad this package is being highlighted. I found this package so useful in my application.
It's next level, flutter the future 🖤🖤
Thank you flutter team!
Does it replace the package flutter_cache_manager_firebase ?
I think this is for all use cases, not just when you're using a firebase backend
CachedNetworkImage accepts normal urls. When you use firebase storage you can use the firebase cache manager together with CachedNetworkImage to supply gs:// urls. You can set your own cache managers for the image widget. So it doesn't replace the package, they can be used together.
Genial, muy bueno. Larga vida a Flutter!
This is the great package and the Flutter engineers are a great team, but i have one question. Why, even if it is cached, it still "loads" shortly the picture when i select the page in my bottomnavbar where this picture located. why can't it get initially loaded if it is already being cached?
Yup same question here. i was thinking to dowload pictures as local assets and then i do logic, if image link still the same as saved in sharedpref, then ImageAsset will be used instead. If no then delete the old one and dowload the new as local asset
Still curious about how this widget works, cause the loading is just kinda same as ImageNetwork usual widget
become more likely (Package of the month) 😁
Well done.
I love how there are no docs on what types of caching are implemented. Is it based on "expires" , "etag", "max age"?
What if the image hosted in the URL changes? That is, it's the same URL, but the image changes.. Would CachedNetworkImage update? Or is there a way to force it to update?
I'm the maker of the package. It uses http cache-control headers to check the validity of the image. So the first important header is the max-age, for example when you set that to 1 day it will use the same (possible old) image for at least a day. After that day it will use the eTag to check if the image is still the same, or outdated. When it's still the same the backend should return a 304 (not modified) and the data usage will be minimal. When it's changed it will return a new file with new cache-control information.
@@ReneFloor thanks for the wonderfull package, It was super handy in old times, but now Image.network caches as well, so can you please tell what the difference?
So I can make the graphics on app load with this widget?
Ya its a pro just that it would increase app data
Great 👍
Already using this
me too. it's a pretty old package.
Nice package but don't you hate seeing this weird naming like 'imageUrl' parameter here? It if were just 'url' would it be confusing to a user taking into account that the widget name is 'CachedNetworkImage'?'
I agree, these are old choices and not weird enough for breaking changes (at least not to me).
@@ReneFloor No need for breaking changes, just adding `url` field and putting deprecation warning to `imageUrl` (and coping its value to `url` if specified) will do
How do you create this animation? Which application is used ?
perfect, was hoping to have some kind of custom key, and there it is: `cacheKey` parameter exists! thanks!
Please, allign audio volume on the intro and the voice in the video. IMO, the intro was too loud.
Thanking you
Glad you liked the video, Janam! Be sure to check out the links in the description for more great tips and tutorials 😎
Doesn't Work For Firebase Fetched images?
Does this cache the image in memory, or on disk?
I just want to cache an image from url, for multipart request. Any idea?
awesome
Does it update when the url changes ?
yes
can anyone help me out if we rendered multiple images in PageView take a time(3s) even local assets
then what should we do?
preCacheImage and didChangeDependecy did not wok
Awesome
How to move cached image to downloads folder so that user data can be saved
Please improve the SEO in flutter web
do you have this for video???
Does it work with Web?
It does work on web, but doesn't do any caching there. When you use the html renderer the browser manages the caching for you.
Other departments of google are on one side, and flutter team on the other !
Still flutter team wins
I don't recommend this package. Your app will crash sometimes
what really? how is happen?
Maybe you forgot to place error builder in case some unexpected error happened on loading?
1st