-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support negative values #2
Comments
It also struggles a lot, when you toggle between different min and max ranges. I think both of these issues can be fixed by scaling this values better. I attahced the formula i used in my code. Maybe you can implement this within the widget itself? double normalize(
double oldMin,
double oldMax,
double? value, {
double newMin = 0,
double newMax = 100,
}) {
if (value == null) return newMin;
if (oldMax - oldMin == 0) return 0;
return (((value - oldMin) * (newMax - newMin)) / (oldMax - oldMin)) + newMin;
} |
Thank you @tobiasht for that 💪🏻 I will post updates here. |
That would be awesome. I'm in a situation where I'd need to set the max value to 0 and dynamically change the min value. The min value needs to be negative. |
This was implemented/fixed by @dino-keskic in #7 and released in version 0.4.3 💪🏻. If there are further problems, please reopen this issue. |
Awesome! thank you very much! I'll test it now |
The package currently does not support negative values. I would be great to add some scaling to the inputs to support this.
The example values that i used:
min: -3000,
max: 3000,
value: -750,
The text was updated successfully, but these errors were encountered: