Keep TextFields visible when keyboard comes up (#18291)

Fixes #10826.

Also in this PR: If you focus a text field, scroll it out of view and then start typing it will scroll back into view.
This commit is contained in:
Michael Goderbauer
2018-06-15 10:11:10 -07:00
committed by GitHub
parent e713b3349a
commit 409007827b
7 changed files with 345 additions and 12 deletions

View File

@@ -20,6 +20,7 @@ void main() {
expect(passwordField, findsOneWidget);
await tester.enterText(nameField, '');
await tester.pumpAndSettle();
// The submit button isn't initially visible. Drag it into view so that
// it will see the tap.
await tester.drag(nameField, const Offset(0.0, -1200.0));
@@ -34,6 +35,7 @@ void main() {
expect(find.text('Name is required.'), findsOneWidget);
expect(find.text('Please enter only alphabetical characters.'), findsNothing);
await tester.enterText(nameField, '#');
await tester.pumpAndSettle();
// Make the submit button visible again (by dragging the name field), so
// it will see the tap.