flet icon indicating copy to clipboard operation
flet copied to clipboard

Display Flutter errors (or similar) when the layout is broken

Open Hamza5 opened this issue 1 year ago • 0 comments

Please Describe The Problem To Be Solved

In Flutter, if we make a problematic layout where a child widget tries to take the maximum height/width of a parent widget that does not have a maximum height/width, a viewport was given an unbounded height/width error will be printed in the console.

unbounded error

More information about this problem can be found in this video on the Flutter YouTube channel:

flutter_video

Also, if a widget is trying to get more space than what is available (overflow), we get a visual indicator on how many pixels are not displayed:

overflow error

Unfortunately, we don't have this important feedback in Flet. All we get is a layout that has something unexpected (no scrolling or incomplete control). Beginners often struggle a lot to learn Flet because of these problems (especially the first). In fact, if you check the Discord server, almost every new one is facing these problems and does not know how to solve them or even how to properly describe them because no error is shown. It would be very useful to have feedback similar to what we get in Flutter.

(Optional): Suggest A Solution

Show similar errors to what Flutter shows for its users.

Hamza5 avatar Jul 10 '23 02:07 Hamza5