flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.57k stars 322 forks source link

layout explorer needs to surface exceptions triggered by disallowed flex layouts #1650

Open jacob314 opened 4 years ago

jacob314 commented 4 years ago

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

albertusdev commented 4 years ago

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!

jacob314 commented 4 years ago

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!