flutter / flutter/flutter

[iOS] Password save dialog not appearing with autofillHints on Flutter 3.27.1

Open
#162,145 15 comments 2 reactions 0 assignees View on GitHub
a: text input found in release: 3.27 found in release: 3.29 framework has reproducible steps P2 platform-ios team-ios triaged-ios
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

### Description
While the password save dialog was displayed using autofillHints in Flutter 3.10.5, upgrading to Flutter 3.27.1 caused the same code to no longer display the password save dialog. Please check why it is no longer appearing.

### Steps to reproduce

1.Install the app for the first time.
2.Enter ID/password.
3.The password save dialog does not appear.

### Flutter Version Comparison
Version where it worked: Flutter 3.10.5
Version where the issue occurs: Flutter 3.27.1

### Reproduction Environment
iOS Device: iPhone 11, iOS 18.2
Xcode Version: 15.3
CocoaPods: 1.16.2

### Expected results

The password save dialog should appear after entering the password.

### Actual results

The password save dialog does not appear even after entering the password.

### Code sample

Code sample

```dart
Widget _passwordField(BuildContext ctx) {
final obscure = ctx.select((state) => state.obscure);
final validity = ctx.select((state) => state.passwordValidity);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_title(AppKey().l10n!.password),
Padding(
padding: const EdgeInsets.only(bottom: 10, left: 30, right: 30),
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: itemMaxSize),
child: Visibility(
visible: ctx.select((state) => state.isMain),
child: TextFormField(
textInputAction: TextInputAction.done,
controller: ctx.read().passwordController,
decoration: InputDecoration(
border: const OutlineInputBorder(),
fillColor: errorBackgroundColor,
filled: !validity,
suffixIcon: IconButton(
icon: Icon(
obscure ? Icons.visibility_off : Icons.visibility,
color: validity ? Colors.grey : Colors.red,
),
onPressed: ctx.read().onChangeObscure,
),
counterText: '',
),
obscureText: obscure,
autofillHints: Platform.isIOS ? const [AutofillHints.password] : null,
onEditingComplete: TextInput.finishAutofillContext,
maxLength: 50,
keyboardType: TextInputType.visiblePassword,
onChanged: ctx.read().onChangePassword,
validator: ctx.read().validatePassword,
),
),
),
),
],
);
}
```

### Screenshots or Video

Screenshots / Video demonstration

![Image](https://github.com/user-attachments/assets/82af6887-8155-45ab-8f75-9e298cc1ba65)

### Logs

Logs

```console
[Paste your logs here]
```

### Flutter Doctor output

Doctor output

```console
fvm flutter doctor -v
[✓] Flutter (Channel stable, 3.27.1, on macOS 14.4.1 23E224 darwin-arm64, locale ja-JP)
• Flutter version 3.27.1 on channel stable at /Users/tf/fvm/versions/3.27.1
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 17025dd882 (5 weeks ago), 2024-12-17 03:23:09 +0900
• Engine revision cb4b5fff73
• Dart version 3.6.0
• DevTools version 2.40.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/tf/Library/Android/sdk
• Platform android-35, build-tools 34.0.0
• Java binary at: /opt/homebrew/Cellar/openjdk@17/17.0.13/libexec/openjdk.jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment Homebrew (build 17.0.13+0)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
• Xcode at /Applications/Xcode_15-3.app/Contents/Developer
• Build 15E204a
• CocoaPods version 1.16.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.2)
• Android Studio at /Applications/Android Studio_2023-2.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 17.0.9+0-17.0.9b1087.7-11185874)

[✓] Android Studio (version 2024.2)
• 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 21.0.3+-79915917-b509.11)

[✓] VS Code (version 1.90.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.102.0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.