How to turn off warning/error bars on APK build

1,486

Solution 1

During the transition, the text receives a thick yellow underline.

That is because Hero transition is done trough Overlay, which is rendered outside of Scaffold or other Material widgets.

The problem ? It means during transition, there's no widget that introduce a valid Theme (Scaffold, Dialog, Material do for example). So it fallback to a default Theme. And that Theme has yellow underline with a big font.

The solution : Wrap your Hero child into a widget introducing Theme or in Theme itself.

Solution 2

These bars are only shown in debug build.

For release builds use

flutter build apk --release
Share:
1,486
haz
Author by

haz

Updated on December 04, 2022

Comments

  • haz
    haz over 1 year

    I am using a Hero animation in my App. During the transition, the text receives a thick yellow underline. I'm pretty sure this is a overflow warning (or something similar), but it persists even when I run flutter build apk and flutter install, i.e. it exists in production builds.

    My app functions fine, so I'd like to hide these. How do I do so?

  • Rémi Rousselet
    Rémi Rousselet about 6 years
    That's not the problem actually
  • Günter Zöchbauer
    Günter Zöchbauer about 6 years
    I'm aware that the overflow should be fixed but he explicitely asked how to just get rid of the yellow bar :D As far as I know they are not shown in release builds.
  • Rémi Rousselet
    Rémi Rousselet about 6 years
    Yeah but it's not overflow he's talking about. It's about text having a yellow underline during hero transition.
  • Günter Zöchbauer
    Günter Zöchbauer about 6 years
    I think I see now what you mean
  • haz
    haz about 6 years
    Perfect! For future readers, I had to add decoration: TextDecoration.none to all my Text widgets, to revert the theme the hero transition widget recieved.
  • haz
    haz about 6 years
    As @RémiRousselet stated, I confused the overflow warnings with the default Hero transition behavior. However, flutter gives faux-warnings (i.e. it thinks there are sub-pixel overflows due to rounding errors), and this helped quell them. Cheers!