ensure new value applied.
This commit is contained in:
@@ -106,11 +106,17 @@ class _RingIndicatorState extends State<RingIndicator> {
|
|||||||
ticker = Ticker((_) {
|
ticker = Ticker((_) {
|
||||||
var diff = DateTime.now().difference(startTime).inMilliseconds;
|
var diff = DateTime.now().difference(startTime).inMilliseconds;
|
||||||
if (diff > 300) {
|
if (diff > 300) {
|
||||||
|
_applyChangeToSelfAndParent(newValue);
|
||||||
return ticker?.stop();
|
return ticker?.stop();
|
||||||
}
|
}
|
||||||
if (mounted) {
|
_applyChangeToSelfAndParent(oldValue + (newValue - oldValue) * (diff / 300));
|
||||||
|
})
|
||||||
|
..start();
|
||||||
|
}
|
||||||
|
|
||||||
|
_applyChangeToSelfAndParent(double value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_value = oldValue + (newValue - oldValue) * (diff / 300);
|
_value = value;
|
||||||
values[0] = LevelValue(_value);
|
values[0] = LevelValue(_value);
|
||||||
});
|
});
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
@@ -119,9 +125,6 @@ class _RingIndicatorState extends State<RingIndicator> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
..start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
|||||||
Reference in New Issue
Block a user