Repository navigation
Description
A user of my app who has a Samsung Galaxy S20 FE (Android 11) is reporting that the showTimePicker input dialog is behaving strangely. The locale is English (United Kingdom). In keyboard entry mode, the input dialog is not accepting what should be a valid 24-hour time. A validation error message "Enter a valid time" is shown when pressing OK button for hours 13 to 23 (pm time). For am hours though, the input was accepted. Dial time picker entry mode seems to be working correctly.
I have asked the user to download the Flutter Gallery app and try out the demo time picker. The results were the same i.e. validation failed for hours 13 to 23 in keyboard mode.
The issue is not reproducible on the Android 11 emulator and on my Android 10 Mi A2 phone. I wonder if this issue only affects certain Android 11 devices (e.g. Samsung Galaxy S20 FE), or if there is a conflicting setting on the device.
Steps to Reproduce
- Language on device is set to
English (United Kingdom). - Launch Flutter Gallery app.
- Navigate to Material > Pickers > Time Picker.
- Open the time picker.
- Dial the time to a pm time e.g.
20:00. Tap the keyboard icon to switch to keyboard input mode. - The keyboard entry dialog appears, showing
20:00; Tap OK without touching the time boxes.
Expected results:
Time accepted on pressing OK. Dialog is closed.
Actual results:
Enter a valid time validation error message in red appears (even though 20:00 is a valid 24-hour time). Dialog remains opened. Tapping on the input text box to edit causes the app to crash/close.
Note: In the case of my app, the time picker did not crash the app (probably due to different Flutter SDK version?). My app in production is running on Flutter 1.22.3 stable.

Activity
darshankawar commentedon Jan 15, 2021
@jongkb
Is there a way to confirm if this is only happening in Flutter Gallery app and on S20 ?
Although I don't have the said device and on Emulator 11 didn't see the issue:
Is it possible to reach out to the user with below sample code (demo app) and ask them to try it to see if issue persists ?
code sample
jongkb commentedon Jan 16, 2021
@darshankawar
I'm finally able to reproduce the odd behavior in the time picker on the Android 11 emulator and my own phone. This doesn't look like a Galaxy S20 FE specific issue after all.
The issue can be reproduced under the following conditions:
English (United Kingdom)- en_GB)Use locale defaultandUse 24-hour formatoptions to off in the Date & time settings of the device.This essentially sets the
alwaysUse24HourFormatproperty of Flutter'sMediaQueryto false.The sample code workaround fixes the validation issue. Hopefully this can be addressed at the framework level but with that said, there seems to be a more fundamental issue. With the 24-hour format turned off in Settings, the Flutter time picker UI still presents itself as 24-hour clock instead of a 12-hour clock (with AM/PM).
To confirm what should be the "standard" UI behavior, I noticed that when setting alarm in the native Clock app, the clock indeed switches to 12-hour format when 24-hour format is turned off in Settings.
[-]Strange behavior in showTimePicker dialog in keyboard input mode on Samsung Galaxy S20 FE[/-][+]Strange behavior in showTimePicker dialog in keyboard input mode[/+]darshankawar commentedon Jan 18, 2021
@jongkb
Thanks for digging deep into this issue. I tried the suggested settings in emulator and sample code.
Although I am unable to replicate the issue, keeping this issue open for further analysis.
stable flutter doctor -v
Ham3D commentedon Apr 28, 2021
I have the same bug, I'm on the latest flutter version.
do I need to provide more data?
kindaniel commentedon May 26, 2021
This bug still continues. Apparently Flutter should get the time format information to use in the time picker using the OS configuration and not the app's location. Because we can have people who are in a location that the default is 24hrs, however, they set it as the default to be used as 12hrs.
4 remaining items
[material_ui] Fix time picker input validation for 24-hour locales (#…
github-actions commentedon Oct 20, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.