flutter / devtools

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

Layout explorer is not dense enough for IDE #7758

Closed kenzieschmoll closed 1 month ago

kenzieschmoll commented 5 months ago

This view is difficult to use when embedded in the IDE. This should be modified so that the UI is far more dense. Arbitrarily, this view should work well in when it is ~2-3" wide and tall.

This should be part of the work for inspector V2 to provide a great embedded IDE experience.

elliette commented 2 months ago

Keeping track of https://github.com/flutter/devtools/pull/8161#issuecomment-2274140091 here

elliette commented 2 months ago

Some notes here:

Currently, for the following code snippet:

Padding(
        padding: EdgeInsetsDirectional.only(start: appBarPadding),
        child: IconButton(
          key: const ValueKey('Back'),
          icon: const BackButtonIcon(),
          tooltip: MaterialLocalizations.of(context).backButtonTooltip,
          onPressed: () {
            Navigator.maybePop(context);
          },
        ),
      )

Which corresponds to this portion of the Widget Tree:

Screenshot 2024-08-08 at 3 10 54 PM

In the layout explorer, we show the following:

For the IconButton:

Screenshot 2024-08-08 at 3 15 38 PM

For the Padding:

Screenshot 2024-08-08 at 3 15 52 PM

IMO, I don't think the layout we are showing for padding is very useful. I don't particularly care about seeing the ConstrainedBox, particularly because it is the exact same size as my padding (although the layout explorer is a bit misleading in this regard). What I'm really interested is not its parent widget, but its child widget (the IconButton). I would rather see the same view for both of them.

Something like:

Screenshot 2024-08-08 at 3 38 44 PM
elliette commented 2 months ago

Note: it's unnecessary to show the width / height twice:

Screenshot 2024-08-08 at 3 57 35 PM