Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get image added paths infinite as setstate is use how to get images path added or removed #35

Open
sunil-singh-chaudhary opened this issue Apr 3, 2024 · 1 comment
Labels
question Further information is requested

Comments

@sunil-singh-chaudhary
Copy link

bool _isSelectionToggled = false;

void toggleImageSelection(ImageFile imageFile) {
if (!_isSelectionToggled) {
setState(() {
if (selectedImages.contains(imageFile)) {
selectedImages.remove(imageFile);
} else {
selectedImages.add(imageFile);
}
_isSelectionToggled = true;
});
}
}

caling from build

builder: (context, imageFile) {
Future.microtask(() => handleImageSelection(imageFile));
return DefaultDraggableItemWidget(
imageFile: imageFile,
boxDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
),
closeButtonAlignment: Alignment.topLeft,
fit: BoxFit.cover,
closeButtonIcon:
const Icon(Icons.delete_rounded, color: Colors.red),
closeButtonBoxDecoration: null,
showCloseButton: true,
closeButtonMargin: const EdgeInsets.all(3),
closeButtonPadding: const EdgeInsets.all(3),
);
},

@shubham-gupta-16
Copy link
Owner

@sunil-singh-chaudhary Sorry I didn't understand the issue. Can you please explain more?

@shubham-gupta-16 shubham-gupta-16 added the question Further information is requested label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants