r/flutterhelp • • Mar 26 '24

RESOLVED Why does flutter run differently in debug/release?

Who thought this was a good idea? I just spent hours getting the layout of my app working correctly locally. I pushed it to my server thinking it was finally working and... blank screen and tons of errors.

Why would they allow invalid code to work when run in debug mode? I can't understand that decision. And the errors in release mode are absurdly opaque and provide no useful information. How do you guys deal with this?

0 Upvotes

20 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Mar 26 '24

I had a scaffold with an expanded as the main child, then a listview inside of that. It ran fine in debug mode, but in release it would not.

I has to make the first child of scaffold a column instead, and have my expanded further down the tree.

2

u/SwampThrowawayPgy69 Mar 26 '24

Expanded can only be a child of flex, column or row widget.

2

u/[deleted] Mar 26 '24

I get that now. Why would they let it work in debug mode though? What's the point of debug if it let's bugs seem to work?

2

u/SkinFickle1735 Mar 27 '24

Some runtime Flutter errors are not hard (also depending on the case ofc), can't be differentiated from hard errors. So it is up to the developer to pay attention to the console.

And that why Widger/UI testing exists too