flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.22k stars 27.26k forks source link

datetime keyboard input type for Samsung keyboards doesn't allow for separators #59685

Open kcruzat opened 4 years ago

kcruzat commented 4 years ago

With the new date picker, the manual input entry requires a / separator which is not present in the Samsung keyboard that is invoked with the TextInputType.datetime for the InputDatePickerFormField widget.

Flutter version: 1.17.0 Device: Samsung Galaxy S6 - Android 7.0

image

HansMuller commented 4 years ago

CC @darrenaustin

darrenaustin commented 4 years ago

Well that is unfortunate. Not sure what we can do here.

@justinmc or @LongCatIsLooong do you know if we currently handle device specific behavior anywhere else? Would it be possible to detect this case and revert to showing the full keyboard on only these devices?

LongCatIsLooong commented 4 years ago

There's a flag for Samsung keyboards: https://github.com/flutter/engine/blob/f5a4ea7d8321014269c83eea2f1b33224068f2da/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java#L283

markusaksli-nc commented 4 years ago

Reproducible on the latest master 1.21.0-2.0.pre.83 with an SM G950F with Android 9 (API 28).

Minimal reproducible sample code ``` import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Sample', home: Scaffold( appBar: AppBar( title: Text('Sample'), ), body: Container( child: Center( child: InputDatePickerFormField( firstDate: DateTime.parse("1900-01-01"), lastDate: DateTime.parse("2030-01-01")), ), ), ), ); } } ```
flutter doctor -v ``` [√] Flutter (Channel master, 1.21.0-2.0.pre.83, on Microsoft Windows [Version 10.0.18362.900], locale et-EE) • Flutter version 1.21.0-2.0.pre.83 at C:\Development\flutter_master • Framework revision 9e658bc3d5 (8 hours ago), 2020-07-21 03:56:07 +0200 • Engine revision dcc9a4048d • Dart version 2.9.0 (build 2.9.0-21.0.dev 9dca49e71e) [√] Android toolchain - develop for Android devices (Android SDK version 30.0.0) • Android SDK at C:\Users\Isa\AppData\Local\Android\sdk • Platform android-30, build-tools 30.0.0 • Java binary at: C:\Users\Isa\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\193.6626763\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.6.4) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community • Visual Studio Community 2019 version 16.6.30309.148 • Windows 10 SDK version 10.0.18362.0 [√] Android Studio (version 4.0) • Android Studio at C:\Users\Isa\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\193.6626763 • Flutter plugin version 47.1.2 • Dart plugin version 193.7361 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) [√] VS Code (version 1.47.2) • VS Code at C:\Users\Isa\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.12.2 [√] Connected device (5 available) • SM G950F (mobile) • ce12171c51cc001c03 • android-arm64 • Android 9 (API 28) • sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.18362.900] • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 84.0.4147.89 • No issues found! ```
liodali commented 3 years ago

it's better if the flutter team can add format of typing and textfield will match the format that we want to enter i found this library https://pub.dev/packages/flutter_masked_text can tranform text input to specific format in that way the flutter team will not need to make hack for each specific device

wcoder commented 3 years ago

The same issue on Samsung device

Flutter version: 1.22.6 Device: Samsung Galaxy S9 - Android 10.0

Related: https://github.com/flutter/flutter/issues/71670

Screenshot:

flutter doctor -v

[✓] Flutter (Channel stable, 1.22.6, on macOS 11.2.3 20D91 darwin-x64, locale
    en)
    • Flutter version 1.22.6 at /Users/yauhenipakala/flutter
    • Framework revision 9b2d32b605 (3 months ago), 2021-01-22 14:36:39 -0800
    • Engine revision 2f0af37152
    • Dart version 2.10.5

[✓] Android toolchain - develop for Android devices (Android SDK version
    30.0.0-rc2)
    • Android SDK at
      /Users/yauhenipakala/Library/Developer/Xamarin/android-sdk-macosx
    • Platform android-30, build-tools 30.0.0-rc2
    • ANDROID_HOME =
      /Users/yauhenipakala/Library/Developer/Xamarin/android-sdk-macosx
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin installed
    • Dart plugin version 201.9317
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.55.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (2 available)
    • Android SDK built for x86 (mobile) • emulator-5554
      • android-x86 • Android 10 (API 29) (emulator)
    • iPhone 12 (mobile)                 • 4625C1D9-1C37-412F-ABF1-463A7AED3B3D
      • ios         • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)

• No issues found!

Looks like problem with TextFormField -> keyboardType: TextInputType.datetime

huycozy commented 1 year ago

This issue is reproducible on the latest stable and master channels with Samsung Galaxy Tab A7 Lite, Android 12 OneUI 4.1, SM-T225.

flutter doctor -v (stable and master) ```bash [✓] Flutter (Channel stable, 3.3.10, on macOS 13.0.1 22A400 darwin-x64, locale en-VN) • Flutter version 3.3.10 on channel stable at /Users/huynq/Documents/GitHub/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 135454af32 (13 hours ago), 2022-12-15 07:36:55 -0800 • Engine revision 3316dd8728 • Dart version 2.18.6 • DevTools version 2.15.0 [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-33, build-tools 31.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14B47b • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) [✓] IntelliJ IDEA Community Edition (version 2022.1.1) • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.73.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.54.0 [✓] Connected device (3 available) • SM T225 (mobile) • R9JT3004VRJ • android-arm64 • Android 12 (API 31) • macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.124 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found! ``` ```bash [!] Flutter (Channel master, 3.7.0-13.0.pre.92, on macOS 13.0.1 22A400 darwin-x64, locale en-VN) • Flutter version 3.7.0-13.0.pre.92 on channel master at /Users/huynq/Documents/GitHub/flutter_master ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path. ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path. • Upstream repository https://github.com/flutter/flutter.git • Framework revision 4e08ebb2bf (2 hours ago), 2022-12-27 19:31:24 -0500 • Engine revision 8294e2693a • Dart version 3.0.0 (build 3.0.0-66.0.dev) • DevTools version 2.20.0 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-33, build-tools 31.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14B47b • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) [✓] IntelliJ IDEA Community Edition (version 2022.1.1) • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.74.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.56.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.124 [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 1 category. ```
Gaurav-CareMonitor commented 1 year ago

Any updates on this @deandreamatias ?

umaraqueli commented 7 months ago

Any news on this?