mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
## Description This PR fixes a `DatePicker` flickering issue observed on some devices with a small display. ### Before When the date picker input dialog is shown the virtual keyboard opens and reduces the available height. The current logic reacts by removing the picker `TextField`. Because there is no more `TextField` the virtual keyboard is hidden and the available height increases, at that moment the `TextField` is shown again. Due to autofocus the virtual keyboard opens which leads to the removal of the `TextField` and so on. https://github.com/user-attachments/assets/deb70f2e-1c8b-47a9-9db6-47bc521e4eb7 ### After When there is not enough vertical space for the input date picker dialog, the header is hidden instead of hiding the `TextField`. https://github.com/user-attachments/assets/14051ee9-3b9a-4467-a4a0-4ee91b4979ea ## Related Issue [Fixes DatePickerDialog text input causes keyboard to open and close on a 480p Android emulator](https://github.com/flutter/flutter/issues/140311). ## Tests Adds 2 tests.