For Flutter Mobile, How to Push a New Route by a Drag/Swipe Gesture While Controlling the Position of the Routes (Like Swipe to Pop in iOS) - flutter

As most of you already know, Flutter offers a Cupertino navigation transition that represents the native iOS behavior when navigating to previous route. You can start swiping from the left edge of the device and a navigation animation is started. Unless the user ends touching to the screen, the user is in control of the position of the current (above) and the previous (below) routes.
According to the release position and velocity, whether the screen will be popped or not and the animation controller takes the rest of the job.
I want to implement exactly opposite of this. When the user starts swiping from the right edge of the screen to the left, the gesture will be detected. The new route will be created and be positioned on the right. User can drag the new route to the left (into the scene). After the release of the touch, it will be decided to whether center the new route (complete) or let it go away (cancel).
This behavior can be observed inside Safari browser, for example. You can navigate backwards by start swiping from the left edge. Moreover, you can navigate forward by starting to swipe from the right end of the screen.
Also, it is possible to experience a similar UI/UX behavior in TikTok app. When watching a video on the “For You” screen (that’s the default home page of the TikTok), the user can start dragging the screen from right to left and when the gesture detected, the profile screen of the current content’s owner will be shown. As mentioned above, the user will be in control of the position by dragging. When the user ends touching it will complete or cancel the navigation based on the situation.
Question is:
I am a power user of Flutter since the very early beta days of it. I made quite complex UX implementations till today. However, this type of a navigation need haven’t been an issue and didn’t come to my mind.
I did a deep research on the Flutter source code, internet, Flutter issues, pub.dev, etc. Yet, I couldn’t find a logically easy solution.
Does anybody know how to do that? Indeed we can use the CupertinoPageRoute and extend upon it but my mind just stopped at the moment.
Side note: The end result could be like a parallax effect or like a PageView.

Related

Unity, at higher resolution (2560 x 1440) tester cannot click the navigation elements on the screen even though they are in position

Here is my issue, the way my game works is that you click on the edges of the screen to navigate. This is done through an Overlay Canvas using OnPointerClick. I colored the navigation areas, and scale the canvas according to screen size and the navigation areas appear on their screen as they should. Yet they CANNOT click any of the elements for some reason. They have another monitor that works without issue. They've noted that their larger monitor is AMD. I've also confirmed that the ability to navigate in game has not been hindered. I have never had this issue (or any other testers) on 1920x1080 monitors.
I have completely exhausted what the issue can be, they cannot even navigate on a bare bones tutorial. Any ideas would be GREATLY appreciated.
Here is an image of their screen and the respective clickable navigation areas.
[img]https://i.imgur.com/NVQkA8g.png[/img]
Unity 2019.2.14f1
Put a Image component without sprite, because without that, you will not detect any click. You can set the alpha to 0 after you see that working.
Also check the anchors of the navigation areas.

adding business logic to swiping with PageView or alike

how can I add conditions, popups etc to swiping?
I have a screen with 2 swiping areas (top and bottom) and a narrow middle input area. Now I want to implement some logic to the bottom swiping area. If the user starts swiping, the interface shall stop further swiping and show a countdown instead, after which swiping is possible (and similar interactions).
Not sure, if this is possible (with a reasonable effort), however, currently I am not even having an idea how to tackle this. And I haven't found anything close here on stackoverflow except onPageChanged which does not work for my case (I guess). The tricky part, I guess, is that one should first see a brief swiping movement before popups etc are shown.
I guess, this not relevant for the solution, but I am generally using BloC for business logic.
Anyone with a solution or a path what to dive into?

Animate card widget on button click Tinder like swipe

Hello all I am building Tinder like swipe in Flutter. So far so good I have made the stack of cards together with the gesture detector when the user swipes left/right. However my issue come when I try to animate on click of a button. Under the stack of cards there are 2 buttons which you can like or dislike on button click. I would like to get an advice how I can approach the animation when the user clicks on either button. Below is my code for displaying the stack. Best wishes
There are several options to animate the card off screen. Since you're already using a Stack, AnimatedPosition is probably the best option.
You could also use Transform.translate to set the transform property of an AnimatedContainer. Or, if you want more control over the animation you could use a SlideTransition.
For a good overview of how to decide which animations you need, see this video from two days ago: https://www.youtube.com/watch?v=GXIJJkq_H8g
There's also https://pub.dev/packages/animations for more pre-packed options.

Touch feedback during swipe left and right

My app has a master-detail structure, where the user can tap on a master item to go to the detail view and then swipe left or right to navigate to other details items.
I'm using on-swipe-left and on-swipe-right to let users swipe between the detail views, however, when the user swipes, there is no visual feedback that there is a swipe happening. Only after the user has fully swiped does anything happen. I thought I could use the slide box, because the slidebox does provide visual feedback as soon as you start swiping, however, my views have vertical scroll and that conflicts with the left and right swipe actions due to the swipe sensitivity. In other words, when the user touches the screen to begin scrolling down, the swipe action takes over and it tries to swipe left or right instead of scrolling down.
So, what are my options? Is there any way I can provide some kind of an animation with on-swipe-left and on-swipe-right so that there is some kind of visual feedback (may be an ink trail on the screen) I can show the user? Or is there any way I can make the slidebox approach work so that the horizontal swipe and vertical scroll can function harmoniously? I have seen other apps that have scroll and swipe functions working harmoniously--gmail and pinterest are examples. Just not able to get it working with ionic.
Or is there another UI pattern that I am not thinking of? Worst case, I could provide buttons for next and previous, but this is a mobile app, so I really shouldn't have to resort to that.
Thanks!

How to know if the user has reached the edges of Webview?

I'm trying to develop an app based on the idea of the Twitter for iPad, with sliding panels (for this, I'm using stackscrollView https://github.com/Reefaq/StackScrollView).
I have a UIWebview inside a UIScrollView, what I need is a way to find if the user has "reached the edge" of the UIWebView. I mean, I want user being able to pan around the web view, zoom in/out. But, I would like to find a way to get noticed when some of the edges of the web view has been reached. When that happens, I don't want the webView to bounce (that's simple, bounce = FALSE), instead, I want that starting from this point, the ScrollView start to respond to the touch (Even with the finger of the user inside the webView).
Basically: I wanna to the same thing that Twitter for iPad does when it opens a panel to show a site: allow us to zoom in/out, panning around, and, when the edge is reached, the panel is swiped.
I think the way to go is using scrollView property of the UIWebview, but I don't know exactly how.
Any idea?