Issue 1:
Steps to Reproduce

When a Fullscreen dialog is opened after a file was received from ImagePicker, the layout of the Fullscreen Dialog is broken.

final File _ = await ImagePicker.pickImage();

Navigator
.of(context)
.push(new MaterialPageRoute<Null>(
builder: (final BuildContext context) {
return new TestPage();
},
));

However, wrapping the call to Navigator.push into a new Future fixes the issue.

final File _ = await ImagePicker.pickImage();

new Future(() {
Navigator
.of(context)
.push(new MaterialPageRoute<Null>(
builder: (final BuildContext context) {
return new TestPage();
},
));
});

See this project if you want to reproduce the issue.

Flutter Doctor

[✓] Flutter (on Mac OS X 10.13.1 17B1003, locale en-DE, channel master)
• Flutter at /Users/lschmierer/flutter
• Framework revision 6299dbada8 (13 hours ago), 2017-12-14 13:19:26 -0800
• Engine revision e0d19e2897
• Tools Dart version 1.25.0-dev.11.0
• Engine Dart version 2.0.0-edge.cf1de7d46cd88e204380e8f96a993439be56b24c

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.1)
• Android SDK at /Users/lschmierer/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.1
• 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-915-b08)

[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.2, Build version 9C40b
• ios-deploy 1.9.2
• CocoaPods version 1.3.1

[✓] Android Studio (version 3.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] Connected devices
• Pixel • FA69N0312108 • android-arm • Android 8.1.0 (API 27)

Issue 2:
Steps to Reproduce

Attach a function to the button onTap

Invoke an ImagePicker to select an image from the gallery (image_picker package)

Initiate Navigator.push to a new screen after image is picked.

application is frozen. navigation did not happen.

Observations:

Removing Image Picker from equation solves the problem.

Tested in iOS simulator and real device - similar behavior

the issue appeared after recent flutter update i.e. it woeked on 4 weeks old flutter (dev branch)).

This is the code that hangs (full sample app can be found here https://github.com/FastNinja/imagepickerissue

):

Future<Null> _freezesAfterNavigation(BuildContext context) async {
var _imageFile = await ImagePicker.pickImage();

// this navigation freezes and the whole app
Navigator
.of(context, rootNavigator: true)
.push(new MaterialPageRoute<String>(
settings: const RouteSettings(name: '/screen2'),
builder: (BuildContext context) {
return new Screen2Page();
}));
}

//... somewhere in the app...

new RaisedButton(
child: new Text("Select Image and Freezes"),
onPressed: () => _freezesAfterNavigation(context),
),

I have created the following repository to easily reproduce the issue.

https://github.com/FastNinja/imagepickerissue

It is the Minimum Possible App that reproduces the issue - single page with 2 buttons.

1st button just navigates to new screen. 2nd button picks an image and then navigates to new screen.

Using the image picker does not initiate navigation into new screen and the whole application gots frozen.

Logs

Run your application with flutter run and attach all the log output:

Launching lib/main.dart on iPhone 6 in debug mode...
Running pod install... 1.1s
Running Xcode build... 12.2s
Syncing files to device iPhone 6... 0.9s

🔥 To hot reload your app on the fly, press "r". To restart the app entirely, press "R".
An Observatory debugger and profiler on iPhone 6 is available at: http://127.0.0.1:8105/
For a more detailed help message, press "h". To quit, press "q".
PlatformException(multiple_request, Cancelled by a second request, null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:514:7)
#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:154:18)
<asynchronous suspension>
#2 ImagePicker.pickImage (package:image_picker/image_picker.dart:63:40)
<asynchronous suspension>
#3 _MyHomePageState._freezesAfterNavigation (/Users/user/Documents/sandpit/imagepickerissue/lib/main.dart:41:40)
<asynchronous suspension>
#4 _MyHomePageState.build.<anonymous closure> (/Users/user/Documents/sandpit/imagepickerissue/lib/main.dart:78:32)
#5 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:323:14)
#6 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:375:30)
#7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102<…>

Run flutter analyze and attach any output of that command also:

flutter analyze
Analyzing /imagepickerissue...
hint • The value of the local variable '_imageFile' isn't used at lib/main.dart:41:9 • unused_local_variable
1 issue found.
(Ran in 5.0s)

Flutter Doctor

flutter doctor

[✓] Flutter (on Mac OS X 10.12.6 16G1114, locale en-US, channel alpha)
• Flutter at /Users/user/Documents/flutter
• Framework revision 8f65fec5f5 (3 weeks ago), 2017-12-12 09:50:14 -0800
• Engine revision edaecdc8b8
• Tools Dart version 1.25.0-dev.11.0
• Engine Dart version 2.0.0-edge.d8ae797298c3a6cf8dc9f4558707bd2672224d3e

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.1)
• Android SDK at /Users/userhere/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.1
• 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-915-b08)

[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.2, Build version 9C40b
• ios-deploy 1.9.2
• CocoaPods version 1.3.1

[✓] Android Studio (version 3.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] Connected devices
• iPhone 6 • 2F890940-D8CE-40A0-B937-A93115097CDE • ios • iOS 11.2 (simulator)

For more information about diagnosing and reporting Flutter bugs, please see https://flutter.io/bug-reports/.