I have this code for asset image
Image.asset('${listPic[1]}', ),
the images are located in a Listfinal List<Image> listPic= <Image>[ Image.asset('assets/images/pic1.jpg'), Image.asset('assets/images/pic2.jpg'), ];
I know the pubsec works, because when I directly type the image location like this
Image.asset('assets/images/pic1.jpg', ),
the image is displayed,Is there something wrong with the list or Image.asset()I have tried using .toString after the ${listPic[0]} it didn't do anything instead said unnecessary string interpolation.
gives this error
The following assertion was thrown resolving an image codec: Unable to load asset: Image(image: AssetImage(bundle: null, name: "assets/images/pic1.jpg"), frameBuilder: null, loadingBuilder: null, alignment: Alignment.center, this.excludeFromSemantics: false, filterQuality: low)