i want to make many different images using listView builder
CodePudding user response:
Image.asset takes a string not, in this case you can either have your widgets as
list a =[
'assets/myimage.png',
'assets/myimage.png']
or change the Image.asset in your listview to
as your list a =[]
returns a widget of type Image.asset
return a[index]
CodePudding user response:
You are using redundand Image.asset
.
Your code at line 25:
return Image.asset(Image.asset('.../.../sth.png'))
Change 25 line to :
return a[index]
You can read more about this topic here: https://docs.flutter.dev/development/ui/assets-and-images