Reputation: 74
I had a AWS S3 image url.I want to cache the image once its downloaded in my flutter app,How can I achieve that
Upvotes: 0
Views: 596
Reputation: 1
CachedNetworkImageProvider(
pictureUrl,
cacheKey: pictureUrl.split("?")[0]
)
Upvotes: 0
Reputation: 318
You can use CachedNetworkImage
CachedNetworkImage(
imageUrl: 'https://your.url',
progressIndicatorBuilder: (context, url, progress) => Center(child: CircularProgressIndicator()),
height: MediaQuery.of(context).size.height * 0.1,
placeholder: (context, url) => Image.asset('images/NoImage.png'),
),
Or if you want to store image on your device than you can use sqflite and store image to database as Uint8List or String bytes. Image widget has method Image.memory for get image from Uint8List which stored on your database
Upvotes: 0