Controlling scrollbar from controller in Flutter - dart

I have made a list horizontally scrollable, but I want to control scrolling from a specific widget. In the diagram if I hold the bottom video progress bar and move it on right it should make the screen scroll. Also it adjusts its position when I scroll list horizontally by sliding the screen. I have all the widgets made. I just want to know how to sync them.
.

You can use position in scroll controller. For example - if I have to perform an operation when user reaches end of list of widgets, this is the condition -
if (_scrollController.position.pixels ==
_scrollController.position.maxScrollExtent) {}

Related

SwiftUI ScrollView

How do I achieve similar behaviour of ScrollView like in iMessages app? I mean, if you are scrolling on top, new messages will appear without pushing existing content down. Same if you get new message and you are not on the bottom, does not push items top.
If you are adding items to the end of index, it's fine. ScrollView keeping user point of view. However when user is on the top of the scrollview, and add some new items at startIndex, all content is pushed down.
I did trick and I flipped whole ScrollView with .rotationEfect and then also used rotationEffect on every item. So scrolling is from the bottom to the top. Now when I add something at start index, does not push content down but adding at end index will push content.
Also this flipped trick with rotation effect break .contextMenu functionality.
How can I achieve scroll view which is like in messanger, whatsapp, viber and rest of the chat applications?

Quick scroll by touching scroll indicator in UITextView

I'm trying to create the effect seen in some iOS apps where swiping the screen scrolls the ScollView/TextView normally, but sliding on the far right (where the scroll indicator is) creates a quick scrolling effect that allows the user to scroll through the position in the overall length of the view. For example, sliding on the far right from the middle of the screen to the bottom would take the TextView from the middle of its content to the very end.
Is there any pre-established way to do this, or is this an effect I would have to create from scratch?
Thanks a lot for any help, and I'm sorry if this question wasn't very clear.

How to center content inside collection view in exact center of shown ring view while scrolling horizontally (iOS)?

I want to set center the content inside a UICollectionView according to ring image in the center of the whole screen. Please check the image below. Any Suggestions?
The function you need is this one... https://developer.apple.com/documentation/uikit/uicollectionviewdelegate/1618007-collectionview
This function is called by the collection view when the user finishes scrolling. It provides the content offset of where the collection view will stop scrolling. (The proposed content offset).
You then need to take that offset and work out the nearest offset to place your cell in the middle of the screen.
Something like, find the item that will be closest to the middle. Work out how far away from the middle it is so you know how much to shift it by. Then apply that shift to the proposed content offset.
This will allow your collection view to decelerate naturally but always stop at the point that you want it to stop.

How to scroll to a element which is not visible in appium?

In the previous version of Appium, I can use scroll functions to scroll to the particular element which is not visible on the screen.
My requirement is I have a Layout, in which many elements are there and that layout is scrollable. The element which I want to click is not visible on the screen and I have to scroll to a particular element and click that?
Can someone help me out on this issue how to scroll to the particular element?
In latest version of appium to scroll on the screen or to scroll the tables or to implement drag and drop functionalites we have to use TouchAction.
If we want to scroll in a scrollable layout first we have to get the bounds of that layout and give the coordinates in side that bounds.
Consider the below line of code.
new TouchAction(driver).press(300,200).moveTo(300,100).release().perform();
In this line of code we will perform the scroll down by 100 points.
.press(300,200) // Start at 300,200
.moveTo(0,100) // Increase Y by 300, ending up at 300,100
You have to pass the coordinates based on your requirements.
Find the details in below link:
https://appium.io/docs/en/writing-running-appium/touch-actions/

usability issue with nested scroll views on ios

I have a horizontal scroll view with paging enabled, and the children of this scroll view are vertical scroll views. It's like the iOS home screen, but imagine scrolling vertically on each home screen.
Now, when the vertical scroll is in progress, it's hard to swipe to the next or previous screen, because the vertical scroll view apparently captures the events. Even if the angle of the swipe is almost horizontal, it doesn't go to the next or previous "page". Only after the scroll stops fully can one easily swipe to the next or previous pages.
Unfortunately, because of the slow deceleration, the user might think the content stopped moving when it is in fact moving very slowly and just about to stop. But the horizontal swipe is interpreted as a vertical scroll gesture, and the scroll velocity increases, making things worse from the user's perspective.
I've noticed multiple people struggling with this when they test out our app, and I wonder if anyone here knows a solution, perhaps a way to consider the angle of the swipe to determine which scroll view should process the event. Thanks.
I would suggest stopping the vertical scroll on a touch begins event. This is how most apps I've seen do something like this.

Resources