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

Slider don't have smooth animation when start. #9

Open
naveenyadav15 opened this issue Oct 4, 2019 · 17 comments
Open

Slider don't have smooth animation when start. #9

naveenyadav15 opened this issue Oct 4, 2019 · 17 comments
Labels
help wanted Extra attention is needed

Comments

@naveenyadav15
Copy link

When we start the slider it takes a leap and after that it works perfectly fine.

@rvamsikrishna
Copy link
Owner

@naveenyadav15 Sorry! I could not understand you clearly. The thumb is intended to jump. Is that what you are saying?

@naveenyadav15
Copy link
Author

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.

@rvamsikrishna rvamsikrishna added the help wanted Extra attention is needed label Dec 13, 2019
@maddyb99
Copy link

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 added a commit to maddyb99/flutter_fluid_slider that referenced this issue Jul 26, 2020
@rvamsikrishna
Copy link
Owner

@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 😊

@maddyb99
Copy link

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 added a commit to maddyb99/flutter_fluid_slider that referenced this issue Jul 26, 2020
@maddyb99
Copy link

I have opened PR #13 to update example and gitignore and #14 for animation

@rvamsikrishna
Copy link
Owner

rvamsikrishna commented Jul 27, 2020

@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.

maddyb99 added a commit to maddyb99/flutter_fluid_slider that referenced this issue Jul 27, 2020
@maddyb99
Copy link

@rvamsikrishna are you running the example app in debug mode?

When we start the slider it takes a leap and after that it works perfectly fine.

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.

Debug mode builds use a virtual machine (VM) to run Dart code (hence the “debug” banner they show to remind people that they’re slightly slower) in order to enable Stateful Hot Reload.

Source: FAQ - Flutter

I also noticed this and then tried this in release mode and it works fine.

@rvamsikrishna
Copy link
Owner

@maddyb99 I removed the animations. The value jump is happening the value of slider.

@maddyb99
Copy link

Just to get on the same page, you are talking about this jump(in the middle bar), right?

jump

@rvamsikrishna
Copy link
Owner

@maddyb99 yup...that jump in the orange slider

@maddyb99
Copy link

maddyb99 commented Jul 27, 2020

See,

In debug mode:

Here, as you mentioned, the value jumped from 10 to 240

sfdg

In release mode:

But here, we can see the thumb come up during sliding

release

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.

@rvamsikrishna
Copy link
Owner

@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 min:0.0 and max:100.0. With this generic Material Slider, it is possible to move the slider from 0.0 to1.0. But this is not the case with Fluid slider. You cant go from 0.0 to 1.0. There is this jump in value.
Thank you, I really appreciate your time and effort in participating in solving the issue.

@maddyb99
Copy link

Oh, so you want steps, I guess. To which the slider aligns while moving?
If I'm getting this right, then this needs more precision when sliding?
I will try to reproduce it tonight.
Meanwhile, if you feel like it, you can still merge this PR for removing the delayed bounce!

@maddyb99
Copy link

Yes, I am able to reproduce the jump! Will try to figure out the reason.
Also, I will unlink the PR form this issue, and create a new issue for what I tried to fix :P

@maddyb99
Copy link

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!

@rvamsikrishna
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants