Issue 1:
Steps to Reproduce

Create a view with a text input, and a submit callback listener. In the submit listener, call something like Navigator.popAndPushNamed(). This will result in the following error message:

E/flutter (11330): 'package:flutter/src/widgets/routes.dart': Failed assertion: line 200 pos 12: '!_transitionCompleter.isCompleted': Cannot reuse a MaterialPageRoute after disposing it.

Probably not the best error message to read.

Through a conversation on the flutter gitter I found that dismissing the keyboard using Focus.clear(context); before popping the view resolved the error.

I propose the error message is changed to be more helpful towards this (seemingly quite common) error case - something like 'If you're popping and pushing a route with a text input, make sure you dismiss the keyboard using Focus.clear(BuildContext) before changing the route. Failing to do this results in the navigator trying to double-pop the keyboard.` or something along those lines!

I'd quite like to open a PR for this, I just want to check I haven't totally misunderstood what's going on underneath the hood!

Thanks,

Tom

Issue 2:
Steps to Reproduce

Video: https://i.imgur.com/A85IETe.mp4

Install Flutter Gallery on iOS simulator

Open and close any sample using the swipe mechanism

After a few successful swipes pick up the pace of opening and closing the sample

Crashes

Logs

flutter: ══╡ EXCEPTION CAUGHT BY ANIMATION LIBRARY ╞═════════════════════════════════════════════════════════
flutter: The following assertion was thrown while notifying status listeners for AnimationController:
flutter: Cannot reuse a MaterialPageRoute<dynamic> after disposing it.
flutter: 'package:flutter/src/widgets/routes.dart': Failed assertion: line 218 pos 12:
flutter: '!_transitionCompleter.isCompleted'
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter: https://github.com/flutter/flutter/issues/new?template=BUG.md
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2 TransitionRoute.didPopNext (package:flutter/src/widgets/routes.dart:218:12)
flutter: #3 NavigatorState.pop (package:flutter/src/widgets/navigator.dart:1944:23)
flutter: #4 _CupertinoBackGestureController._handleStatusChanged (package:flutter/src/cupertino/route.dart:651:17)
flutter: #5 _AnimationController&Animation&AnimationEagerListenerMixin&AnimationLocalListenersMixin&AnimationLocalStatusListenersMixin.notifyStatusListeners (package:flutter/src/animation/listener_helpers.dart:192:19)
flutter: #6 AnimationController._checkStatusChanged (package:flutter/src/animation/animation_controller.dart:736:7)
flutter: #7 AnimationController._tick (package:flutter/src/animation/animation_controller.dart:752:5)
flutter: #8 Ticker._tick (package:flutter/src/scheduler/ticker.dart:228:5)
flutter: #9 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
flutter: #10 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleBeginFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:906:11)
flutter: #11 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.forEach (dart:collection/runtime/libcompact_hash.dart:367:8)
flutter: #12 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleBeginFrame (package:flutter/src/scheduler/binding.dart:904:17)
flutter: #13 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleBeginFrame (package:flutter/src/scheduler/binding.dart:834:5)
flutter: #17 _invoke1 (dart:ui/hooks.dart:203:10)
flutter: #18 _beginFrame (dart:ui/hooks.dart:156:3)
flutter: (elided 5 frames from class _AssertionError and package dart:async)
flutter:
flutter: The AnimationController notifying status listeners was:
flutter: AnimationController#f0974(⏮ 0.000; paused; DISPOSED; for
flutter: MaterialPageRoute<dynamic>(/cupertino/alert))
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
flutter: Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 1507 pos 12: '!_debugLocked': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 1507 pos 12: '!_debugLocked': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 1507 pos 12: '!_debugLocked': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 1507 pos 12: '!_debugLocked': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 1507 pos 12: '!_debugLocked': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 1507 pos 12: '!_debugLocked': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 1507 pos 12: '!_debugLocked': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 1507 pos 12: '!_debugLocked': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 1507 pos 12: '!_debugLocked': is not true.

Analyzing flutter_gallery...
No issues found! (ran in 5.6s)

[✓] Flutter (Channel master, v1.2.1-pre.50, on Mac OS X 10.14.2, locale en-US)
• Flutter version 1.2.1-pre.50 at /Users/droidery/flutter
• Framework revision dbd1b317ff (76 minutes ago), 2019-01-30 21:31:44 -0500
• Engine revision 15f2b92cce
• Dart version 2.1.1 (build 2.1.1-dev.3.2 71bee8f05e)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/droidery/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
✗ Verify that all connected devices have been paired with this computer in Xcode.
If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
To update with Brew, run:
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
• ios-deploy 1.9.4
• CocoaPods version 1.5.3

[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 31.3.3
• Dart plugin version 182.5124
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] IntelliJ IDEA Community Edition (version 2018.3.4)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 32.0.3
• Dart plugin version 183.5429.25

[✓] VS Code (version 1.30.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.22.2

[✓] Connected device (1 available)
• iPhone SE • 58F34A3E-1576-453E-B1B4-3DCB22E1FEDD • ios • iOS 12.1 (simulator)

Might be related to #27333 but error message and reproduction steps are difference.