fix(mobile): fast animations when "disable animations" enabled (#21309)

* fix(mobile): disable animations speed android

* use animationBehavior instead of workaround
This commit is contained in:
Yaros 2025-08-28 04:42:38 +02:00 committed by GitHub
parent f65dabd43a
commit e2169f5316
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 6 deletions

View File

@ -272,9 +272,17 @@ class _RandomAssetBackgroundState extends State<_RandomAssetBackground> with Tic
void initState() {
super.initState();
_zoomController = AnimationController(duration: const Duration(seconds: 12), vsync: this);
_zoomController = AnimationController(
duration: const Duration(seconds: 12),
vsync: this,
animationBehavior: AnimationBehavior.preserve,
);
_crossFadeController = AnimationController(duration: const Duration(milliseconds: 1200), vsync: this);
_crossFadeController = AnimationController(
duration: const Duration(milliseconds: 1200),
vsync: this,
animationBehavior: AnimationBehavior.preserve,
);
_zoomAnimation = Tween<double>(
begin: 1.0,

View File

@ -378,9 +378,17 @@ class _RandomAssetBackgroundState extends State<_RandomAssetBackground> with Tic
void initState() {
super.initState();
_zoomController = AnimationController(duration: const Duration(seconds: 12), vsync: this);
_zoomController = AnimationController(
duration: const Duration(seconds: 12),
vsync: this,
animationBehavior: AnimationBehavior.preserve,
);
_crossFadeController = AnimationController(duration: const Duration(milliseconds: 1200), vsync: this);
_crossFadeController = AnimationController(
duration: const Duration(milliseconds: 1200),
vsync: this,
animationBehavior: AnimationBehavior.preserve,
);
_zoomAnimation = Tween<double>(
begin: 1.0,

View File

@ -378,9 +378,17 @@ class _RandomAssetBackgroundState extends State<_RandomAssetBackground> with Tic
void initState() {
super.initState();
_zoomController = AnimationController(duration: const Duration(seconds: 12), vsync: this);
_zoomController = AnimationController(
duration: const Duration(seconds: 12),
vsync: this,
animationBehavior: AnimationBehavior.preserve,
);
_crossFadeController = AnimationController(duration: const Duration(milliseconds: 1200), vsync: this);
_crossFadeController = AnimationController(
duration: const Duration(milliseconds: 1200),
vsync: this,
animationBehavior: AnimationBehavior.preserve,
);
_zoomAnimation = Tween<double>(
begin: 1.0,