Repository: flutter
Issue: Textfield receives focus but keyboard doesn't remain open on iOS.
Labels: a: text input,platform-ios,engine,has reproducible steps,P2,found in release: 2.2,team-ios,triaged-ios

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->
``` 
Keyboard disappears in Ios
```
https://user-images.githubusercontent.com/38251726/123905654-605a9800-d990-11eb-9a53-f33bce00147e.mp4

```Works fine in Android```

https://user-images.githubusercontent.com/38251726/123905964-f8588180-d990-11eb-84e8-393164ef022f.mp4
1. Run `flutter create bug`.
2. Update the files as follows: 
```
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class TestView extends StatefulWidget {
  @override
  _TestViewState createState() => _TestViewState();
}

class _TestViewState extends State<TestView> {
  late PageController _pageController;
  late int selectedIndex;
  late TextEditingController text1Controller;
  late TextEditingController text2Controller;
  late FocusNode text1Focus;
  late FocusNode text2Focus;
  bool text1Validated = false;
  bool text2Validated = false;

  @override
  void initState() {
    super.initState();
    _pageController = PageController();
    selectedIndex = 0;
    text1Controller = TextEditingController();
    text2Controller = TextEditingController();
    text1Focus = FocusNode();
    text2Focus = FocusNode();
  }

  @override
  void dispose() {
    text1Focus.dispose();
    text2Focus.dispose();
    super.dispose();
  }

  void _onPageChanged(int index) {
    setState(() {
      selectedIndex = index;
    });
  }

  void requestFocus(FocusNode currentNode, FocusNode nextNode) {
    currentNode.unfocus();
    nextNode.requestFocus();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          elevation: 0,
          backgroundColor: Color(0xFF000000),
        ),
        backgroundColor: Color(0xFF000000),
        body: PageView(
          physics: NeverScrollableScrollPhysics(),
          controller: _pageController,
          onPageChanged: _onPageChanged,
          children: [
            buildTextView1(),
            buildTextView2(),
          ],
        ));
  }

  ListView buildTextView2() {
    return ListView(
      physics: BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
      children: [
        Padding(
          padding: EdgeInsets.symmetric(vertical: 10, horizontal: 30),
          child: AutofillGroup(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  '''Text 2''',
                  style: TextStyle(
                      fontSize: 22,
                      color: Colors.white.withOpacity(1),
                      fontWeight: FontWeight.bold),
                ),
                SizedBox(
                  height: 30,
                ),
                TextField(
                  onChanged: (text) {
                    if (text.length > 0) {
                      setState(() {
                        text2Validated = true;
                      });
                    } else {
                      setState(() {
                        text2Validated = false;
                      });
                    }
                  },
                  focusNode: text2Focus,
                  controller: text2Controller,
                  autofocus: true,
                  inputFormatters: [
                    FilteringTextInputFormatter.allow(RegExp("[a-zA-Z]"))
                  ],
                  decoration: InputDecoration(
                    hintText: 'Enter Text',
                  ),
                ),
                SizedBox(
                  height: 35,
                ),
                Row(
                  children: [
                    Align(
                        alignment: Alignment.centerLeft,
                        child: ElevatedButton(
                            style: ElevatedButton.styleFrom(
                              padding: EdgeInsets.symmetric(
                                  horizontal: 30, vertical: 12),
                              shape: RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(100)),
                              elevation: 10,
                            ),
                            onPressed: !text1Validated
                                ? null
                                : () {
                                    requestFocus(text2Focus, text1Focus);
                                    _pageController.jumpToPage(0);
                                  },
                            child: Text(
                              'Continue',
                              style: TextStyle(fontSize: 18),
                            ))),
                  ],
                )
              ],
            ),
          ),
        )
      ],
    );
  }

  ListView buildTextView1() {
    return ListView(
      physics: BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
      children: [
        Padding(
          padding: EdgeInsets.symmetric(vertical: 10, horizontal: 30),
          child: AutofillGroup(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  'Text 1',
                  style: TextStyle(
                      fontSize: 22,
                      letterSpacing: 1,
                      fontWeight: FontWeight.bold),
                ),
                SizedBox(
                  height: 30,
                ),
                TextField(
                  onChanged: (text) {
                    if (text.length > 0) {
                      setState(() {
                        text1Validated = true;
                      });
                    } else {
                      setState(() {
                        text1Validated = false;
                      });
                    }
                  },
                  focusNode: text1Focus,
                  controller: text1Controller,
                  autofocus: true,
                  inputFormatters: [
                    FilteringTextInputFormatter.allow(RegExp("[a-zA-Z]"))
                  ],
                  decoration: InputDecoration(
                    hintText: 'Enter Text',
                  ),
                ),
                SizedBox(
                  height: 35,
                ),
                Align(
                    alignment: Alignment.centerLeft,
                    child: ElevatedButton(
                        style: ElevatedButton.styleFrom(
                          padding: EdgeInsets.symmetric(
                              horizontal: 30, vertical: 12),
                          shape: RoundedRectangleBorder(
                              borderRadius: BorderRadius.circular(100)),
                          elevation: 10,
                        ),
                        onPressed: !text1Validated
                            ? null
                            : () {
                                requestFocus(text1Focus, text2Focus);
                                _pageController.jumpToPage(1);
                              },
                        child: Text(
                          'Continue',
                          style: TextStyle(fontSize: 18),
                        )))
              ],
            ),
          ),
        )
      ],
    );
  }
}

```




<details>
  <summary>Logs</summary>


<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-arm, locale en-IN)
    • Flutter version 2.2.2 at /Users/rahul/Development/flutter
    • Framework revision d79295af24 (3 weeks ago), 2021-06-11 08:56:01 -0700
    • Engine revision 91c9fc8fe0
    • Dart version 2.13.3

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/rahul/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more
      details.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.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 11.0.8+10-b944.6916264)

[✓] VS Code (version 1.57.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.23.0

[✓] Connected device (4 available)
    • sdk gphone arm64 (mobile)  • emulator-5554                            •
      android-arm64  • Android 11 (API 30) (emulator)
    • R’s I  (mobile)            • c6467d3f454b96020193bf65ecad69cb68dbf640 • ios
      • iOS 14.5
    • iPhone 12 Pro Max (mobile) • B5612099-C099-4296-BBBF-1594B0706CA9     • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 91.0.4472.114
```

</details>