Open RegisSaffi opened 4 years ago
Hmm... I will think about it. Currently very busy...
Lets assume you have some source where you can get the value when change came not from user. Let it be:
MyDataStorage
With above in mind:
bool _changedHere = false;
double _value = 0;
Widget build(BuildContext context) {
if (!_changedHere) {
_value = MyDataStorage.getValue(); //Data NOT from user
} else {
_changedHere == false; //Change was done by user, so we'll not change the value, but only during current widget build
}
return SleekCircularSlider(
min: 0,
max: 255,
initialValue: _value,
onChangeEnd: (val) {
setState((){
_changedHere = true;
_value = val;
});
}
);
}
I don't think this should be done in plugin itself.
Also if you have animations enabled and see a tearing, create one CircularSliderAppearance
and then reuse it, don´t create it on every build
.
Also if you have animations enabled and see a tearing, create one
CircularSliderAppearance
and then reuse it, don´t create it on everybuild
.
This should be in the docs, the tearing drove me crazy for weeks, I was able to solve it by hacking setStates around the place, but your comment solves everything. Many many thanks @spixy !
Thanks for this widget,it is really awesome and customizable, but i am wondering if i want to set a value dynamically how would i do it? well, i can set the initial value and i can update it, but if i want to use both user interaction change and dynamic value change i can't do it, if you can add where i can know if the value change is coming from the user interaction or not, it could be useful in many cases.