Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate selector in footer bar is a PopupMenu instead of a DropdownMenu #3989

Merged
merged 12 commits into from
Apr 19, 2022

Conversation

elliette
Copy link
Member

Fixes #3985

Also cleans up some unnecessary formatting in the footer (removes individual alignment of items, which was unnecessary because they end up being aligned correctly in their row with spaceBetween).

@elliette elliette requested a review from kenzieschmoll April 15, 2022 23:05
Copy link
Member

@kenzieschmoll kenzieschmoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you checked these changes with a narrow screen width? I suspect that removing the Flexible and Expanded widgets may lead to renderflex overflow errors

),
),
);
final children = <Widget>[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's construct this list directly instead of calling children.add a bunch of times:

final children = [
  buildHelpUrlStatus(context, currentScreen, textTheme),
  const BulletSpacer(),
  if (showIsolateSelector)
    ...[
          const IsolateSelector(), 
          const BulletSpacer(),
       ],
   ...
];

We can also just build this directly as the children property in row. It actually makes the build method a little more readable.

Row(
  children: [ ... ],
)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Only change to your suggestion is I've pulled getting the children into a separate method

@elliette
Copy link
Member Author

elliette commented Apr 18, 2022

have you checked these changes with a narrow screen width? I suspect that removing the Flexible and Expanded widgets may lead to renderflex overflow errors

Good point! Changed so we only show the items that can fit.

Before (without this PR):
Screen Shot 2022-04-18 at 9 48 54 AM

Now:

footer

style: textTheme.bodyText2,
overflow: TextOverflow.clip,
),
if (!isNarrow) const SizedBox(width: denseSpacing),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

write if (!isNarrow) ...[ ... ], instead so you can reuse the if statement

Copy link
Member

@kenzieschmoll kenzieschmoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment then lgtm

@elliette elliette merged commit d6c0a66 into flutter:master Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clicking isolate selector shows menu item in the wrong place
2 participants