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

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?

3

u/Ivan_Gorchakov Mar 26 '24

You supposed to pay attention on debug console while running in debug mode (not closing it) 😉

1

u/[deleted] Mar 26 '24

Sure, but shouldn't something that fails to run in release also fail in debug? I get all kinds of random warnings that don't affect my app. For example, copying thr documentation exactly on how to set up autocomplete on username and passwords fields causes a bunch of toString() being called on null objects. Autocomplete still works on release and debug, even though I have over 100 lines of errors every time I click thr autofill pop-up.

I just don't like flutter.

3

u/Ivan_Gorchakov Mar 26 '24

It is better from the beginning of a project to try to resolve all stuff, that makes debug console "bip-bop-bip-bop-bop", because sooner or later you will find yourself searching one little error among tons or others errors/warnings. But, if you don't like it - don't dev on it.

1

u/[deleted] Mar 26 '24

I don't have a choice on this project.

Again, I copied the documentation exactly and the debug console still screams at me.