0

There are tons of questions & answers about specific instances of this issue. My question is more general:

In debug mode, there are no compiler warnings, and the screen looks as it should. Obviously there's a print statement in the console, but that's so easy to miss. In release mode, the widget gets painted totally grey, because of the exception.

How do I either:

  • Get Debug mode to treat the exception like it would in Release (aka paint the widget grey, or similar), without actually building for Release.
  • Get a compiler warning/error about the issue, or maybe something similar that a separate dependency/linter could provide.
user1366911
  • 918
  • 7
  • 20
  • Can you include a sample code snippet that will reproduce the same issue – Md. Yeasin Sheikh Aug 18 '22 at 15:02
  • If you put a Positioned widget as a child of a Stack, everything's fine. if you wrap the Positioned widget in a Semantics widget, then everything compiles fine, but you get an exception. Similar to this SO: https://stackoverflow.com/questions/54905388/incorrect-use-of-parent-data-widget-expanded-widgets-must-be-placed-inside-flex – user1366911 Aug 18 '22 at 16:33

1 Answers1

0

Run

flutter run --release

This will run the project in release mode and you can still see the logs

Kaushik Chandru
  • 15,510
  • 2
  • 12
  • 30
  • I appreciate the response! just calling out that I'm specifically hoping for an answer "without actually building for Release", since doing that constantly in development isn't feasible. – user1366911 Aug 18 '22 at 16:37
  • Absolutely. You can also try some packages like linter and define rules onceand when you develop codes it will show warnings of codes that doesnt follow those rules. https://pub.dev/packages/linter – Kaushik Chandru Aug 18 '22 at 16:40