Issue 1:
This isn't a critical problem :-).

If you accidentally launch a flutter app with flutter run and lib/main.dart is empty the reported error is not "you have an empty lib/main.dart file" but: "Could not prepare to run the isolate." etc.

I can say from personal experience that this is a little confusing.

Launching lib/main.dart on Nexus 5 in debug mode...
Initializing gradle... 0.8s
Resolving dependencies... 1.1s
Running 'gradlew assembleDebug'... 9.8s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk... 12.1s
E/flutter ( 5140): [ERROR:flutter/shell/common/engine.cc(158)] Could not prepare to run the isolate.
E/flutter ( 5140): [ERROR:flutter/shell/common/engine.cc(117)] Engine not prepare and launch isolate.
E/flutter ( 5140): [ERROR:flutter/shell/platform/android/android_shell_holder.cc(166)] Could not launch engine in configuration.

Issue 2:
Description

A Scaffold assumes that it is always the height of the device, so when calculating the contentBottom in order to avoid the keyboard, it doesn't include its own offset from the bottom of the screen, resulting in blank space between the keyboard and the body.

This behavior occurred for me when attempting to nest scaffolds and create an ios-style BottomNavigationBar layout. The BottomNavigationBar is hosted via Scaffold, and within each tab, I'd like to use a scaffold for the appBar and keyboard avoidance logic.

Example

Proposed Solution

On line 332 in scaffold.dart, we calculate the contentBottom using the viewInsets.bottom of the screen, but without subtracting the widget's own offset from the bottom of the screen. In my screenshots, there's a BottomNavigationBar of height 57 + viewInsets.bottom behind the keyboard, so the extra space is equal to 57 + viewInsets.bottom points.

I'm not quite sure where we'd be able to grab the screen height, but if we could get the screen height, the correct minInsets.bottom calculation would be be viewInsets.bottom - (screenHeight - widgetHeight).

Work Around

My workaround at the moment is to make sure that all scaffolds are indeed full screen by putting them in a stack and giving them an empty bottomNavigationBar container.

(for context, SwitchStack is just a Stack with Offstage/TickerMode children, and BetterNavigationBar is a simple Row of IconButtons)

Widget build(BuildContext context) {
return Material(
child: Stack(
children: <Widget>[
SwitchStack(
children: paths
.map((p) => FocusScope(node: nodes[p], child: routes[p]))
.toList(),
index: currentIndex,
),
Align(
alignment: Alignment.bottomCenter,
child: BetterNavigationBar(
currentIndex: currentIndex,
onTap: _handleItemSelected,
items: [
_buildTabItem(Icons.crop_square, "Spaces"),
_buildTabItem(Icons.donut_large, "Circles"),
_buildTabItem(Icons.add, "Action"),
_buildTabItem(Icons.format_align_justify, "Lines"),
_buildTabItem(Icons.account_circle, "Dot"),
],
),
),
],
),
);
}

and each one of those routes renders something like

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: appBar,
body: body,
bottomNavigationBar: Container(
height:
kBottomNavigationBarHeight + MediaQuery.of(context).padding.bottom,
color: Colors.transparent,
),
);
}

flutter doctor -v

[✓] Flutter (Channel beta, v0.11.3, on Mac OS X 10.13.6 17G65, locale en-US)
• Flutter version 0.11.3 at /Users/matt/.flutter-sdk
• Framework revision 72bf075e8d (2 weeks ago), 2018-11-09 20:36:17 -0800
• Engine revision 5646e86a6f
• Dart version 2.1.0 (build 2.1.0-dev.9.3 9c07fb64c4)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at /Users/matt/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /Users/matt/Library/Android/sdk
• 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-1136-b06)
• 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
• ios-deploy 2.0.0
• CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

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

[✓] Connected device (1 available)
• Rose iPhone • 1af0c70e23fe6c60e7f570442a106b3ea6e33db0 • ios • iOS 12.1

• No issues found!