Repository navigation
Description
Animating a Platform View widget is janky.
Tested on latest stable and master 3.8.0-5.0.pre.1, android 12SKQ1.211006.001, xiaomi mi lite 11 5G.
Steps to Reproduce
Please run this simple example here:
https://github.com/delfme/flutter-native-text-input-repo
Expected results:
When opening keyboard, native widget should animate smoothly.
Actual results:
Native widget animation is janky.
videozip_459.MP4
Flutter doctor:
[✓] Flutter (Channel master, 3.8.0-5.0.pre.1, on macOS 12.2 21D49 darwin-arm64, locale en-IT)
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
Activity
darshankawar commentedon Feb 13, 2023
Thanks for the report @delfme
Can you please enable
performancOverlayand see if you get shader jank while opening the keyboard ?Also, is that the default device keyboard or external one such as Gboard ?
delfme commentedon Feb 13, 2023
@darshankawar here is the performanceOverlay. We have red frames when widget is rendered and on first keyboard opening. Then we can't observe red frames but animation is still jittery.
cc: @jonahwilliams might this be the android equivalent of #120555 ?
Screen.Recording.2023-02-13.at.09.44.38.mov
darshankawar commentedon Feb 14, 2023
Thanks for the update @delfme. The similar issue you linked states that it may not be related to
platform-views#120555 (comment).Since this issue could also be related, although trying to S10 device, the jank I observed was not consistent and sometimes smooth with animation and the jank wasn't noticeable mostly.
Is it possible to confirm without adding native textfield and check if the animation is still janky on the device you used ?
https://github.com/delfme/flutter-native-text-input-repo/blob/d18841e1a0542e8fbe70dff463cade69448b1d7e/lib/demo_screen.dart#L99
delfme commentedon Feb 14, 2023
I will try to look into this. Indeed it seems that issue may not be due to platform view #120555 (comment)
Can you also help with this? By disabling lines 98-
131 and enabling 134-151 we can debug the issue with flutter textfield.
https://github.com/delfme/flutter-native-text-input-repo/blob/d18841e1a0542e8fbe70dff463cade69448b1d7e/lib/demo_screen.dart#L98
darshankawar commentedon Feb 15, 2023
I tried as above, although I see some jank in performance overlay, the animation jank while opening the keyboard is not noticeable as it opens pretty smoothly on S10 atleast I tried on.
I'll keep this issue open for team's attention and for better tracking.
[-][android][platform view] Janky Animation[/-][+][android] Janky Animation when opening keyboard[/+]delfme commentedon Feb 15, 2023
@darshankawar janks/jittery occurs randomly yet consistently. On my Xiaomi Mi Lite 11 is much evident. It might not be wrong animation curve. Right now we are debugging same issue on iOS and it seems to be caused by flutter engine, we saw GC and raster getting stuck waiting.
If flutter team can work on this, the discovery on other issue should be helpful, or else we will try to have a look at this after iOS fix
delfme commentedon Oct 6, 2023
Linking here the unsync keyboard issue coz the two issues might be intertwined.
#116836
delfme commentedon Apr 14, 2025
@reidbaker saw you've recently triaged #163516 Would you be so kind as to check if the janky / stuttering keyboard animation still persists in Flutter 3.29? This issue affects both iOS and Android and significantly impacts the user experience.
ice-kreios commentedon Jul 15, 2025
I can reproduce this behavior using the provided sample code.
mdurmaz commentedon Nov 25, 2025
IbrokhimMirzaev commentedon Dec 2, 2025
saibotma commentedon Jun 6, 2026
I can still reproduce this on Flutter 3.44.1 with a native Android EditText embedded as a platform view.
I also tested with HCPP enabled via --enable-hcpp on a Pixel 7. The keyboard/opening animation did not become noticeably smoother. In addition, the Android text magnifier regressed: only the magnifier background/shadow was visible, but the magnified text/content was not rendered.
So at least for this native text input case, HCPP does not appear to solve the keyboard animation jank, and it introduces a separate text editing fidelity issue.
This also seems related to #167547.
Flutter 3.44.1
Android device: Pixel 7
Android version: 16
Renderer: Impeller
Native view: EditText
Composition tested: classic Hybrid Composition and HCPP