Sunday, July 17, 2022

[FIXED] How to turn off warning/error bars on APK build

Issue

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?


Solution

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.



Answered By - Rémi Rousselet
Answer Checked By - Willingham (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.