Hello, in this flutter video, I am going to show you the long press gesture. So the long press gesture is when the is when a pointer remains in contact with the screen at the same location for a long period of time. That is it. So maybe you could be, you know, simulating some sort of right click or some sort of, you know, contextual menu and providing some extra information. No, I think Instagram has this, when you click a image or post, the whole image is actually one of the posts, but you don't doubletap it to you know, like it or you don't just single click it to go to it. If you just keep it pressed, you know, goes into an expo thing, it makes me a little bigger.
So it's almost like a preview before you go directly into because at the end of the day, users are very impatient. So they want it quick and easy as possible. So they can, you know, reduce them Having to go into a home of a screen, it's almost like half a screen. You know, it is overtaking the screen, but it's technically an upset screen because once you let go, you'll go back to the original thing, sort of you haven't clicked the Back button. So first of all, we just need to add a gesture detector. And in here, we'll add why the child you want to attach the gesture to is going to be an image and I just put on long press and the two of them on press, and I'll show you those.
So if I put a print statement in here, I know I made a mistake. I'm gonna say long press on long press up, so long press release. So if I was that if I click it, nothing that Double click it still not allowed me before keep my mouse button pressed me says long press for let go is long press released like is it this code here can be more complex will most likely be more complex, you can connect to a database may pull some information, you could do some animation using the transform class, you could essentially what else could you do, you could, you know, encapsulate the functionality into a separate method. So it just calls the method here because you don't want to be you know, putting 10 lines there maybe 20 lines here, you can just simply put them to a whole nother method.
And that is it. If you have any questions, feel free to shoot me a message. And as usual, I look forward to seeing you in the next video.