начните с этого кода:
List<File> _images = [];
final picker = ImagePicker();
Future getImage(int index) async {
final image = await picker.getImage(source: ImageSource.gallery);
setState(() {
_images[index] = File(image.path);
print((image.path));
});
}
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: _images.length + 1,
itemBuilder: (BuildContext context, int index){
if(index == _images.length){
return GestureDetector(
onTap: (){
getImage(index);
},
child: Padding(
padding: EdgeInsets.only(left:5.0, right:5,top: 10),
child: Container(
height: 100.0,
width: 100.0,
decoration: BoxDecoration(
border: Border.all(),
image: DecorationImage(
image: AssetImage('assets/images/add_pic.jpg'),
fit: BoxFit.fill,
),
shape: BoxShape.rectangle,
),
),
),
);
}
return Row(
children: <Widget>[
GestureDetector(
onTap: (){
getImage();
},
child: Padding(
padding: EdgeInsets.only(left:5.0, right:5,top: 10),
child: Container(
height: 100.0,
width: 100.0,
decoration: BoxDecoration(
border: Border.all(),
image: DecorationImage(
image: FileImage(_image[index]),
fit: BoxFit.fill,
),
shape: BoxShape.rectangle,
),
),
),
),