Open FMorschel opened 1 week ago
Summary: The "Remove this widget" feature in Flutter's widget inspector is inconsistent. It disappears when removing a child widget from a Column
, and incorrectly removes the const
keyword when applied to a Center
widget.
If you remove
Text
the option toRemove this widget
is gone fromColumn
How often does this situation arise? I wouldn't think it happens very often, so it doesn't seem like a high priority issue, but if you know differently ...
What should the result be of removing Column
in that case? I ask because as a general principle we don't support refactorings / assists when they would produce diagnostics that didn't exist before. Removing Column
seems like it would have that characteristic, which probably explains why we don't support it.
At Center you have the option to
Remove this widget
but it does removeconst
That seems like a clear bug.
With this you also can't remove the Text
:
Center(
child: Text(''),
)
What should the result be of removing
Column
in that case?
Or the Text
in this case.
I would suggest the assist to look if the parameter is positional (not optional) or required to decide this and then if it can be safely removed, simply remove the full parameter.
How often does this situation arise?
I'm not sure. I do get to this some of the time when I have custom widgets in different places on my screen and I'd like to remove it from one of those places.
I wouldn't think it happens very often, so it doesn't seem like a high priority issue
I do agree this is definitely not a high-priority issue. I just think it would be nice to have the assist do this for us. Some of the time there can be lots of inner parameters and this would lessen the job of selecting the full range of lines.
I just think it would be nice to have the assist do this for us.
I agree, but we need to focus on the higher priority issues first.
Repro:
Wrongs:
Text
the option toRemove this widget
is gone fromColumn
Center
you have the option toRemove this widget
but it does removeconst