This expression has a type of 'void' so its value can't be used in a set state – Flutter
To have a better view this is the void _addImage(c) async { final ImagePicker picker = ImagePicker(); final XFile? image = await picker.pickImage(source: ImageSource.gallery); print(image?.path); print(_imagePath?.split('/').last); if (image != null) { setState(() { String _imagePath = attachments.add(image.path); }); } }…