-
Notifications
You must be signed in to change notification settings - Fork 46
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
Slider don't have smooth animation when start. #9
Comments
@naveenyadav15 Sorry! I could not understand you clearly. The thumb is intended to jump. Is that what you are saying? |
No, i am saying that when it is moved in right direction at. Start it doesn't move smoothly it jumps 5 values after that it works fine. |
I think what @naveenyadav15 means is that there is a bit of delay between drag start and pop up and it doesn't feel smooth enough! I think the solution is in reducing the animation time and changing the animation (this is because the distance the animation is travelling is small for bounce to look good) I have a potential solution in mind, if you are interested? |
@maddyb99 Thank you Maddy. I would really appreciate some help. You can push it forward and just submit the pull request. Or suggest the solution. I will look into it 😊 |
Well, I have 2 options, I will record and upload GIF for both in some time and also open a PR for the same! |
@maddyb99 Thank you for the PR. Changing the animation duration and curve gives a new feel to the slider but does not solve the issue @naveenyadav15 mentions. Now I found the issue to be that of the slider thumb jumping from value 0 to like 10 or 11 instantly. I tried it removing the thumb animation completely and this issue still persists. This is what that's. needs to be fixed. |
@rvamsikrishna are you running the example app in debug mode?
This problem does not happen in release mode. It might be because of the overhead due to the flutter VM. All animations appear to be slow at first.
Source: FAQ - Flutter I also noticed this and then tried this in release mode and it works fine. |
@maddyb99 I removed the animations. The value jump is happening the value of slider. |
@maddyb99 yup...that jump in the orange slider |
See, In debug mode:Here, as you mentioned, the value jumped from 10 to 240 In release mode:But here, we can see the thumb come up during sliding Even if animations are removed, moving the slider can be considered as an animation in itself and flutter needs to update the state to show it onto the screen, which has a VM overhead. This is not the case in release mode, where Dart is compiled to native binary and therefore removes the latency due to the VM. |
@maddyb99 I understand all the overhead of JIT and assets that happen on debug mode. I tried running it in profile mode. To reproduce the issue create a normal Slider with |
Oh, so you want steps, I guess. To which the slider aligns while moving? |
Yes, I am able to reproduce the jump! Will try to figure out the reason. |
I am not able to find a solution to this and honestly didn't get much time in the past few days, will keep looking! |
@maddyb99 I got a chance to spend some time yesterday. I cornered down the problem to be not considering the slider thumb padding and the offset of actual slider on x axis while converting the global to local. |
When we start the slider it takes a leap and after that it works perfectly fine.
The text was updated successfully, but these errors were encountered: