fix: preserve animations

This commit is contained in:
Prateek Sunal
2025-07-11 13:34:23 +05:30
parent cb282aa56e
commit 85bea417a1
5 changed files with 11 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ class LinearProgressDialogState extends State<LinearProgressDialog>
controller = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 300),
animationBehavior: AnimationBehavior.preserve,
);
_tween = Tween<double>(begin: _target, end: _target);

View File

@@ -75,6 +75,7 @@ class DraggableScrollbarState extends State<DraggableScrollbar>
_thumbAnimationController = AnimationController(
vsync: this,
duration: thumbAnimationDuration,
animationBehavior: AnimationBehavior.preserve,
);
_thumbAnimation = CurvedAnimation(
@@ -85,6 +86,7 @@ class DraggableScrollbarState extends State<DraggableScrollbar>
_labelAnimationController = AnimationController(
vsync: this,
duration: labelAnimationDuration,
animationBehavior: AnimationBehavior.preserve,
);
_labelAnimation = CurvedAnimation(

View File

@@ -291,9 +291,11 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
void initState() {
super.initState();
_expanded = widget.active;
expandController =
AnimationController(vsync: this, duration: widget.duration)
..addListener(() => setState(() {}));
expandController = AnimationController(
vsync: this,
duration: widget.duration,
animationBehavior: AnimationBehavior.preserve,
)..addListener(() => setState(() {}));
}
@override

View File

@@ -32,6 +32,7 @@ class _SeekBarState extends State<SeekBar> with SingleTickerProviderStateMixin {
_animationController = AnimationController(
vsync: this,
animationBehavior: AnimationBehavior.preserve,
value: 0,
);

View File

@@ -65,10 +65,12 @@ class _PersonGallerySuggestionState extends State<PersonGallerySuggestion>
_slideController = AnimationController(
duration: const Duration(milliseconds: 300),
vsync: this,
animationBehavior: AnimationBehavior.preserve,
);
_fadeController = AnimationController(
duration: const Duration(milliseconds: 200),
vsync: this,
animationBehavior: AnimationBehavior.preserve,
);
_slideAnimation = Tween<Offset>(