-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
Steps to Reproduce
- Launch a flutter application with a login form (email/pw).
- Fill out the form, submit and navigate to another page.
- On iOS (I observed this on iOS 15+), dismiss the prompt.
** On the machine I ran, it currently has flutter 2 however, when upgraded to flutter 3, the same behavior is present. And appears only to affect iOS.
Expected results: The prompt should dismiss from the widget leaving the underlying page unmodified.
Actual results: After being dismissed, the contents on the widget is being pushed up and down.
Code sample
Simplified widgets to show the issue:import 'package:exampleapp/widgets/simple_page.dart';
import 'package:flutter/material.dart';
class AutoFillPwWork extends StatefulWidget {
const AutoFillPwWork({Key? key}) : super(key: key);
@override
State<AutoFillPwWork> createState() => _AutoFillPwWorkState();
}
class _AutoFillPwWorkState extends State<AutoFillPwWork> {
final TextEditingController email = TextEditingController();
final TextEditingController password = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Save PW iOS'),
),
body: ListView(
children: <Widget>[
const Text('Login'),
AutofillGroup(
child: Column(
children: <Widget>[
TextField(
controller: email,
autofillHints: const <String>[AutofillHints.email],
),
TextField(
controller: password,
autofillHints: const <String>[AutofillHints.password],
),
],
),
),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SimplePage()),
);
},
child: const Text('Push SimplePage'),
),
],
));
}
}
import 'package:flutter/material.dart';
class SimplePage extends StatelessWidget {
const SimplePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.red,
appBar: AppBar(
title: const Text('Simple Page'),
),
body: Center(
child: Container(
color: Colors.blue,
child: const Text('Simple Page'),
),
),
);
}
}
Details
Flutter (Channel unknown, 2.10.1, on macOS 11.6.8 20G730 darwin-x64, locale en-US) • Flutter version 2.10.1 at /Users/user/Development/flutter • Upstream repository unknown • Framework revision db747aa (8 months ago), 2022-02-09 13:57:35 -0600 • Engine revision ab46186 • Dart version 2.16.1 • DevTools version 2.9.2[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/user/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.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.10+0-b96-7281165)
[✓] VS Code (version 1.71.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.48.0
[✓] Connected device (2 available)
• iPhone (mobile) • ios • iOS 15.7 19H12
• Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.125
[✓] HTTP Host Availability
• All required HTTP hosts are available