I am using the cache_image_network plugin in my flutter to cache images from the network.
Unfortunately it doesn't work and i can see this "warning" :
I/flutter ( 4308): *** WARNING ***
I/flutter ( 4308):
I/flutter ( 4308): Invalid argument null with type Null.
I/flutter ( 4308): Only num, String and Uint8List are supported. See https://github.com/tekartik/sqflite/blob/master/sqflite/doc/supported_types.md for details
I/flutter ( 4308):
I/flutter ( 4308): This will throw an exception in the future. For now it is displayed once per type.
The url i provide is working fine, i can see my image from the network but the cache has this issue (i have turned off my internet connection & restarted the app, no image in cache).
How can i fix this please ?
I am using the latest version (at the moment this question is asked) 3.0.0 of the plugin.
EDIT : I am adding the code in case it matters :
@override
Widget build(BuildContext context) {
return CachedNetworkImage(
imageUrl: url,
maxWidthDiskCache: 200,
maxHeightDiskCache: 200,
placeholderFadeInDuration: Duration(milliseconds: 100),
placeholder: (context, url) => SvgPicture.asset(
'assets/images/Logo/logo_login_light.svg',
width: Constants.maxHeight * 10 / 100,
height: Constants.maxHeight * 10 / 100,
),
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
fit: BoxFit.fill,
image: imageProvider
),
),
),
);
}
UPDATE :
My question is partially wrong because the CacheNetworkManager is partially working, i was using the resize attribute (200x200) which was caching 2 files :
Here are the cached files : One of them has null properties.
HOWEVER : After i turn off the internet connection and rebuild my app (hot reload or manual restart without IDE), i can see the cache is cleared instead of being read.
Why this behaviour ?
Thanks
