Exception caught by image resource service ═ Invalid argument(s): No host specified in URI

Viewed 73

I am getting above exception on console even though I handled the error

child: CachedNetworkImage(
                    imageUrl: "Invaild url to create error",
                    width: 300,
                    height: 300,
                    fit: BoxFit.contain,
                    errorWidget: (context, error, stackTrace) {
                      return Container(
                        width: 300,
                        height: 300,
                        color: Colors.red,
                      );
                    },
                  ),
1 Answers

errorWidget property will only be used when the target image URL failed to load, for example due to a 404 NotFound exception. If your URL is null, you should probably create another widget to handle this.

Related