haz
haz

Reputation: 2288

How to turn off warning/error bars on APK build

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?

Upvotes: 4

Views: 2213

Answers (2)

Rémi Rousselet
Rémi Rousselet

Reputation: 276931

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.

Upvotes: 3

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657128

These bars are only shown in debug build.

For release builds use

flutter build apk --release

Upvotes: 2

Related Questions