devtools icon indicating copy to clipboard operation
devtools copied to clipboard

layout explorer needs to surface exceptions triggered by disallowed flex layouts

Open jacob314 opened this issue 5 years ago • 2 comments

For example, frequently main axis can't be set to a value other than center if textDirection is null as is often the case.

jacob314 avatar Feb 21 '20 19:02 jacob314

I did something hacky related to this issue in src/inspector/flutter/layout_explorer/flex/flex.dart:661 by removing CrossAxisAlignment.baseline from CrossAxisAlignment options because it will throw exceptions when baseline is null.

If there are any additional pointers/ideas on how to solve this, I want to take this issue!

albertusdev avatar Feb 25 '20 06:02 albertusdev

maybe catch exceptions within the service extensions and send the exception back as a message that you then display in the UI as a toast? If you take this on, I would wait for https://github.com/flutter/devtools/pull/1682 to land as that CL makes it way easier to write the layout explorer service extensions as you get type checking and auto-complete!

jacob314 avatar Feb 27 '20 22:02 jacob314