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.17k stars 27.25k forks source link

AutoFillHints doesn't pull up Credit Card Info for Android #116780

Open denys-rudenko opened 1 year ago

denys-rudenko commented 1 year ago

Steps to Reproduce

  1. Execute flutter run on the code sample on an Android device with a Credit Card Saved and Google Autofill selected.
  2. Enter a text field for creditcardNumber.

Expected result: On an Android device the saved CC info should be offered on keyboard.

Actual results: None of the save CC info was offered.

Code sample ``` void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Test', debugShowCheckedModeBanner: false, home: MyHomePage(), ); } } class MyHomePage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Flutter Test'), ), body: SafeArea( child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: SingleChildScrollView( child: Column( mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ Form( child: TextFormField( decoration: InputDecoration( labelText: 'Card Number', ), keyboardType: TextInputType.number, autofillHints: const [AutofillHints.creditCardNumber], ), ), ], ), ), ), ], ), ), ); } } ```
Logs ``` [✓] Flutter (Channel stable, 3.3.9, on macOS 11.7.1 20G918 darwin-x64, locale en-GB) • Flutter version 3.3.9 on channel stable at /Users/vasylprokudin/Desktop/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision b8f7f1f986 (2 weeks ago), 2022-11-23 06:43:51 +0900 • Engine revision 8f2221fbef • Dart version 2.18.5 • DevTools version 2.15.0 [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1) • Android SDK at /Users/vasylprokudin/Library/Android/sdk • Platform android-33, build-tools 33.0.1 • 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 13.0) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 13A233 • 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) [✓] VS Code (version 1.73.1) • VS Code at /Applications/Visual Studio Code .app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [✓] Connected device (3 available) • SM A515F (mobile) • R58N63DAL9J • android-arm64 • Android 11 (API 30) • macOS (desktop) • macos • darwin-x64 • macOS 11.7.1 20G918 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.98 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found! ```
darshankawar commented 1 year ago

Thanks for the report @denys-rudenko When you setup credit card details, have you also set those up in the system "autofill service" settings and provide relevant information to the autofill service for those to work ?

denys-rudenko commented 1 year ago

@darshankawar , thank you for you response Autofill service (Settings -> Autofill service) is enabled and google provider is selected. Google provider has relevant information set up.

exaby73 commented 1 year ago

I can reproduce this. Credit card info is not suggested. But I cannot be certain if this is an issue with Flutter or with my phone as I do not usually use Google for autofiil. So it might be a case of me having misconfigured it as well. But using other autofill services, such as Bitwarden, it doesn't suggest credit card numbers there either. Labeling this issue for further insights and investigation from the team

exaby73 commented 1 year ago

As per https://github.com/flutter/flutter/issues/98762#issuecomment-1077318265, this seems to be a Flutter issue. Updating labels to reflect the same

justinmc commented 1 year ago

CC @LongCatIsLooong

letsar commented 1 year ago

I can confirm it does not work with Flutter 3.7.7 with Android

zoeyfan commented 6 months ago

Can we still repro this in this latest Flutter version?