i tried to load image from api, when i use NetworkImage from flutter or CachedNetworkImage plugin, the app frezee and stop working with this error
I/flutter ( 314): ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════ I/flutter ( 314): The following _Exception was thrown resolving an image codec: I/flutter ( 314): Exception: HTTP request failed, statusCode: 308, I/flutter ( 314): http://example.com/image/sample.jpg
code sample :
CachedNetworkImage(
height: MediaQuery.of(context).size.width * 0.25,
width: MediaQuery.of(context).size.width * 0.25,
fit: BoxFit.cover,
placeholder: (context, url) => Image.asset(
"$assetsImages/loader_image.gif",
height:
MediaQuery.of(context).size.width * 0.25,
width: MediaQuery.of(context).size.width * 0.25,
),
errorWidget: (context, url, error) => Image.asset(
"$assetsImages/image_unavailable.jpg",
height:
MediaQuery.of(context).size.width * 0.25,
width: MediaQuery.of(context).size.width * 0.25,
),
imageUrl: restoImageUrl + value['filename'],
)
problem is on imageUrl: restoImageUrl + value['filename'], when i click the link image of error its opened normally on browser, how to fix this? or how to make flutter support that url 308 permanently redirect?