This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,11 @@ class _MyHomePageState extends State<MyHomePage> {
62
62
Text ('$offset ' ,
63
63
key: const ValueKey <String >(keys.kOffsetText),
64
64
),
65
- if (isSoftKeyboardVisible) const Text (
66
- 'keyboard visible' ,
67
- key: ValueKey <String >(keys.kKeyboardVisibleView),
65
+ Text (
66
+ isSoftKeyboardVisible ? 'keyboard visible' : 'keyboard hidden ' ,
67
+ key: const ValueKey <String >(keys.kKeyboardVisibleView),
68
68
),
69
+ const ElevatedButton (onPressed: debugDumpApp, child: Text ('dump app' )),
69
70
Expanded (
70
71
child: ListView (
71
72
key: const ValueKey <String >(keys.kListView),
Original file line number Diff line number Diff line change @@ -40,8 +40,23 @@ void main() {
40
40
// Bring up keyboard
41
41
await driver.tap (textFieldFinder);
42
42
43
+ const int keyboardTimeout = 3 ;
44
+ bool keyboardVisible = false ;
45
+ for (int i = 0 ; i < keyboardTimeout; i++ ) {
46
+ await Future <void >.delayed (const Duration (seconds: 1 ));
47
+ final String keyboardVisibilityText = await driver.getText (keyboardVisibilityIndicatorFinder);
48
+ keyboardVisible = keyboardVisibilityText == 'keyboard visible' ;
49
+ if (keyboardVisible) {
50
+ break ;
51
+ }
52
+ }
53
+
54
+ if (! keyboardVisible) {
55
+ await driver.tap (find.text ('dump app' ));
56
+ }
57
+
43
58
// TODO(jmagman): Remove timeout once flake has been diagnosed. https://github.com/flutter/flutter/issues/96787
44
- await driver. waitFor (keyboardVisibilityIndicatorFinder, timeout : const Duration (seconds : 5 ) );
59
+ expect (keyboardVisible, isTrue );
45
60
46
61
// Ensure that TextField is visible again
47
62
await driver.waitFor (textFieldFinder);
You can’t perform that action at this time.
0 commit comments