<p dir="auto">If the following app is run with one Foo class definition and then "hot restarted" after a second Foo definition is added, flutter run hangs.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="class Foo { }
class Foo { }
void main() { print(new Foo()); }"><pre class="notranslate"><code class="notranslate">class Foo { }
class Foo { }
void main() { print(new Foo()); }
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Performing hot restart...                                        
compiler message: lib/main.dart:61:7: Error: Duplicated definition of 'Foo'.
compiler message: class Foo { }
compiler message:       ^
compiler message: lib/main.dart:60:11: Error: Duplicated name: Foo
compiler message: class Foo { }
compiler message:           ^
E/flutter ( 4573): [ERROR:flutter/shell/common/engine.cc(151)] Could not prepare to run the isolate.
E/flutter ( 4573): [ERROR:flutter/shell/common/engine.cc(116)] Engine not prepare and launch isolate."><pre class="notranslate"><code class="notranslate">Performing hot restart...                                        
compiler message: lib/main.dart:61:7: Error: Duplicated definition of 'Foo'.
compiler message: class Foo { }
compiler message:       ^
compiler message: lib/main.dart:60:11: Error: Duplicated name: Foo
compiler message: class Foo { }
compiler message:           ^
E/flutter ( 4573): [ERROR:flutter/shell/common/engine.cc(151)] Could not prepare to run the isolate.
E/flutter ( 4573): [ERROR:flutter/shell/common/engine.cc(116)] Engine not prepare and launch isolate.
</code></pre></div>
<p dir="auto">I am trying to scroll the <code class="notranslate">GridView</code> horizontally when screen orientation is portrait and vertically when the screen orientation is landscape. However, I noticed a very strange behavior. What I mean is that when I change device orientation the widget scrolls the way I want, however the touch input stays the same, e.g. I start the app in portrait mode and I scroll the grid from left to right. Then, I change the device orientation and I still have to scroll the grid from left to right instead of from top to bottom.</p>
<p dir="auto">Here's the code gist, if you run it you will get what I mean:</p>
<p dir="auto"><a href="https://gist.github.com/realvotum/b72e03e909e5bf0b47a5cd11e53ef67a">https://gist.github.com/realvotum/b72e03e909e5bf0b47a5cd11e53ef67a</a></p>
<p dir="auto">My observation is that when you uncomment the Appbar line, it works like a charm. Also, when you comment out the padding inside <code class="notranslate">GridView.count</code>, it also works the way I expect. If you delete <code class="notranslate">ScrollController</code>, it works too, yet I want to have <code class="notranslate">GridView</code> scroll callbacks to measure the offset.</p>
<p dir="auto">Is it a bug or am I doing something wrong? If so, how can I swap the scroll direction of the <code class="notranslate">GridView</code> based on the device orientation preserving the given padding and keep the scroll offset between orientation changes (without Appbar) ?</p>
<p dir="auto">I also noticed that <code class="notranslate">ListView.builder</code> behaves the same.</p>
<p dir="auto">Thank you in advance!</p>
<p dir="auto">Doctor summary (to see all details, run flutter doctor -v):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[✓] Flutter (Channel beta, v0.11.3, on Mac OS X 10.14 18A391, locale pl-PL)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio (version 3.1)
[✓] Connected device (1 available)"><pre class="notranslate"><code class="notranslate">[✓] Flutter (Channel beta, v0.11.3, on Mac OS X 10.14 18A391, locale pl-PL)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio (version 3.1)
[✓] Connected device (1 available)
</code></pre></div>