Hi Im trying to set the value of a Timer from a slider.
I have created a custom function that takes as an argument the slider value and returns it multiplied by 1000.
I know the function works, because If I add a Text widget, and set its value to the custom function, when I run the app and I move the slider, the value of the texts updates as I move the slider.
However, if I add the timer value to the custom function, this does not happen. It just shows a static value.
Any ideas why this is?
1st image is is the text grabbing the value from the slider via the custom function, 2nd image is the timer trying to do the same.
And this is whats inside the function:
int? newCustomFunction(double? sliderValue) {
/// MODIFY CODE ONLY BELOW THIS LINE
// convert double to int
if (sliderValue == null) {
return null;
}
return sliderValue.toInt() * 10000;
/// MODIFY CODE ONLY ABOVE THIS LINE
}