Reduced performance on iOS 15 (CupertinoBottomSheet)
Hey! I've been using this library for quite some time now and noticed something weird. Multiple users have been reporting jank while opening the bottom sheet on iOS 15 (the Cupertino one). Running the app in performance mode showed that there are a lot of frames being dropped on the 'Raster' thread. Strange enough, this isn't happening on iOS 14.
Is there anyone else having the same issue?
Does it only happen during the first animation after starting the app, or always?
On my phone, the first triggering of showCupertinoModalBottomSheet misses the complete slide-up animation, it's so slow that it jumps to the full size. But only on the first run.
I thought, it was related to this: https://stackoverflow.com/questions/65485696/flutter-ios-animations-are-janky-on-first-run https://docs.flutter.dev/perf/rendering/shader#how-to-use-sksl-warmup
FYI in my case a single TextField was causing the lag. Took about 50ms to build for the the first time.
Hey @nohli! I'm definitely aware of the first-animation jank issue. The problem I'm currently facing is different though, I'm seeing jank every time I'm opening the bottom sheet (on iOS 15). Will try to create a reproducible example and post it here 👍
I also encounter slower animations in general on iOS 15 with Flutter 2.8. Could be that it has not to do with that lib but with flutter itself.
Interesting, there are indeed multiple issues opened around frame drops on Flutter 2.8:
- https://github.com/flutter/flutter/issues/95986
- https://github.com/flutter/flutter/issues/95838
- https://github.com/flutter/flutter/issues/95151
While debugging the issue, I noticed that most of the jank is caused by scale animations on line 211 and line 285.
Reducing thefilterQualityresolves the jank for me:
Transform.scale(
+ filterQuality: FilterQuality.none,
scale: scale,
...
),
Unfortunately, this reduces the quality of the component, rendered in the back. But I prefer that over having a janky animation 😁
push :)
same issue here.
same issue here.
As @nohli mentioned, the solution is to use: https://docs.flutter.dev/perf/rendering/shader#how-to-use-sksl-warmup It's not an issue related to this repository, it's a general issue.
It has nothing to do with Shader Jank issue. It cannot be reduced by it. I have done a lot of tests. Unfortunately the plugin is not usable with IOS at the moment. I use the normal bottom sheet.