-
Notifications
You must be signed in to change notification settings - Fork 165
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
ReorderableWrap - disable reordering for specific items #89
Comments
I've the same problem for the same use... |
I've the same problem for the same use. |
In the meantime, in case it can help someone else, this is roughly my workaround:
The button is still draggable, but will always be render as the last grid item. |
@e-e I'm doing the same thing. I'm solving this by wrapping the non movable widgets in:
|
@Kal-Elx good workaround.. but the problem is the Tile is still reordable (move another tile on its place) would be nice to have the ability to deactivate that. |
@diickens Yes, my solution was to enforce that in Here's how I implemented it. You can also take a look at the rest of the widget for inspiration on a photo upload screen. |
If the item that should not be draggable is the first or the last you can use either the parameter |
This is available; thanks |
This can also take effect ReorderableWrap(
children: [
ReorderableWidget(
key: ValueKey('Disable drag'),
reorderable: false,
child: Text('Disable drag'),
),
ReorderableWidget(
key: ValueKey('Enable drag'),
reorderable: true,
child: Text('Enable drag'),
),
],
needsLongPressDraggable: false,
onReorder: _onReorder,
); |
This is the most native solution I can see, but still this allows to change the position of non-draggables by dragging over, and the footer widget doesn't obey the same placement rules as the other widgets (for example in a Wrap it's "after" the wrap eg underneath instead of whereever the next element would have been in a wrap). It's really the only dent I can see in this amazing package which is intuitive and works well! @diegotori I'm facing the exact same scenario and I can see that this issue is open for a while, is it a huge hassle to implement a "locked" item which obeys the same rules as the original Widget(eg Wrap,Column,Row etc)? |
Thanks lot |
Not work |
Is it possible to disable drag for specific items in the
ReorderableWrap
class? My specific use case is to create a photo upload screen that allows a user to upload a set number of images, building up a grid as they add photos. I would like the last item in the grid to be a "+" button used for adding the next image, but i do not want them to be able to reorder this item.The text was updated successfully, but these errors were encountered: