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

Disable Draging #23

Open
aryaMode opened this issue Nov 20, 2021 · 11 comments
Open

Disable Draging #23

aryaMode opened this issue Nov 20, 2021 · 11 comments

Comments

@aryaMode
Copy link

Is there a way to disable the dragging ?

@aryaMode
Copy link
Author

aryaMode commented Nov 20, 2021

I just used absorb pointer but that is causing me to loose the functionality of a basic button also.

@huhuang03
Copy link
Owner

Sorry, I can't understand why you want disable dragging, because this package seems only provider the dragging, and you can use the normal GridView if you don't want dragging?

@aryaMode
Copy link
Author

aryaMode commented Nov 23, 2021 via email

@MarceloRab
Copy link

MarceloRab commented Nov 23, 2021

I would like to disable drag. When deleting or adding an item or several they organize automatically. It would be possible?

Would be a nice effect for the user. Showing the user that the list has reorganized.

@huhuang03
Copy link
Owner

No, it's not posiible.

Maybe some other lib can do this.

@MarceloRab
Copy link

Okay. Grateful for the attention.

@R98rayan
Copy link

R98rayan commented Jul 3, 2022

is there is way to disable dragging from one element?

@huhuang03
Copy link
Owner

huhuang03 commented Jul 6, 2022

@R98rayan Maybe you can try something like this support recently..

https://github.com/huhuang03/reorderable_grid_view/blob/master/example/lib/demo/demo_custom.dart

@HungryBytesApps
Copy link

HungryBytesApps commented Jul 11, 2022

Place the element(s) in a IgnorePointer widget (and set ignoring to true) to disable dragging.

@R98rayan
Copy link

Place the element(s) in a IgnorePointer widget (and set ignoring to true) to disable dragging.

Thanks because of you, you gave me an idea of how to solve it.
// disable Long Press
if (widget.notes.length == (index + 1)) {
return GestureDetector(
onLongPress: () {},
key: ValueKey(index),
child: GridItem(index, context),
);
}
return GridItem(index, context);
},

@kristijorgji
Copy link

kristijorgji commented Nov 23, 2023

Hi guys, any update on this ?

I also want to disable drag&drop on only some specific items of the grid and allow others to still be dragged&dropped on each other

The answer above #23 (comment) works partially. It disables drag&drop on a particular item but it is still being pushed around! while dragging other slots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants