Skip to content

Hero animation causes overflow #27320

@JssDWt

Description

@JssDWt

When a Hero contains a Column with mainAxisSize: MainAxisSize.min, on navigating to a new page, the content overflows (by 0.0000172 pixels) (only during the navigation). This even happens when navigating to the exact same page with the same widgets.
My guess is the Hero is not calculating the size of the RenderFlex properly during flight.

Steps to Reproduce

  1. Create a flutter project using flutter create hero_overflow
  2. Replace the contents of main.dart with the following gist: https://gist.github.com/JssDWt/98c01b5fa29d389409010cefa881d091
  3. Run the app and press the 'button'.

Logs

Useful part of the logs:

[        ] Syncing files to device Android SDK built for x86... (completed)
[        ] Synced 0.8MB.
[        ] Sending to VM service: _flutter.listViews({})
[   +6 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0xe523760c, isolate: {type: @Isolate, fixedId: true, id: isolates/316462981, name: main.dart$main-316462981, number: 316462981}}]}
[        ] Connected to _flutterView/0xe523760c.
[   +1 ms] 🔥  To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R".
[        ] An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:64614/
[        ] For a more detailed help message, press "h". To detach, press "d"; to quit, press "q".
[ +140 ms] D/        (22909): HostConnection::get() New Host Connection established 0xc5dc6100, tid 22929
[        ] D/EGL_emulation(22909): eglMakeCurrent: 0xe47dc2a0: ver 3 0 (tinfo 0xcae7f080)
[+4656 ms] I/flutter (22909): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
[   +3 ms] I/flutter (22909): The following message was thrown during layout:
[        ] I/flutter (22909): A RenderFlex overflowed by 0.0000172 pixels on the bottom.
[  +16 ms] I/flutter (22909): 
[        ] I/flutter (22909): The overflowing RenderFlex has an orientation of Axis.vertical.
[        ] I/flutter (22909): The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and
[        ] I/flutter (22909): black striped pattern. This is usually caused by the contents being too big for the RenderFlex.
[   +6 ms] I/flutter (22909): Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the
[        ] I/flutter (22909): RenderFlex to fit within the available space instead of being sized to their natural size.
[        ] I/flutter (22909): This is considered an error condition because it indicates that there is content that cannot be
[        ] I/flutter (22909): seen. If the content is legitimately bigger than the available space, consider clipping it with a
[        ] I/flutter (22909): ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex,
[        ] I/flutter (22909): like a ListView.
[        ] I/flutter (22909): The specific RenderFlex in question is:
[        ] I/flutter (22909):   RenderFlex#856db OVERFLOWING
[        ] I/flutter (22909):   creator: Column ← Listener ← _GestureSemantics ← RawGestureDetector ← GestureDetector ← InkWell ←
[        ] I/flutter (22909):   DefaultTextStyle ← AnimatedDefaultTextStyle ← _InkFeatures-[GlobalKey#6fb53 ink renderer] ←
[        ] I/flutter (22909):   NotificationListener<LayoutChangedNotification> ← CustomPaint ← _ShapeBorderPaint ← ⋯
[        ] I/flutter (22909):   parentData: <none> (can use size)
[        ] I/flutter (22909):   constraints: BoxConstraints(w=71.0, h=16.0)
[        ] I/flutter (22909):   size: Size(71.0, 16.0)
[        ] I/flutter (22909):   direction: vertical
[        ] I/flutter (22909):   mainAxisAlignment: start
[        ] I/flutter (22909):   mainAxisSize: min
[        ] I/flutter (22909):   crossAxisAlignment: center
[        ] I/flutter (22909):   verticalDirection: down
[        ] I/flutter (22909): ◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤
[        ] I/flutter (22909): ════════════════════════════════════════════════════════════════════════════════════════════════════
[+4449 ms] Application finished.

Flutter analyze

Analyzing hero_overflow...
No issues found! (ran in 1.4s)

Flutter doctor:

[✓] Flutter (Channel beta, v1.1.8, on Mac OS X 10.14.2 18C54, locale nl-NL)
    • Flutter version 1.1.8 at /Users/jessedewit/Documents/Programmeren/flutter
    • Framework revision 985ccb6d14 (3 weeks ago), 2019-01-08 13:45:55 -0800
    • Engine revision 7112b72cc2
    • Dart version 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/jessedewit/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-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 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 31.2.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] 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)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28)
      (emulator)

• No issues found!

Metadata

Metadata

Assignees

Labels

c: crashStack traces logged to the consolef: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions