opt progress bar

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-22 15:14:59 +08:00
parent 66752093e4
commit b9eaa368b1
3 changed files with 19 additions and 11 deletions

View File

@@ -482,6 +482,13 @@ class _RenderProgressBar extends RenderBox {
}
}
@override
void dispose() {
_drag?.dispose();
_clearLabelCache();
super.dispose();
}
// This is the gesture recognizer used to move the thumb.
_EagerHorizontalDragGestureRecognizer? _drag;
@@ -620,6 +627,8 @@ class _RenderProgressBar extends RenderBox {
}
void _clearLabelCache() {
_cachedLeftLabel?.dispose();
_cachedRightLabel?.dispose();
_cachedLeftLabel = null;
_cachedRightLabel = null;
}