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

Show a screen unavailable message for disabled screens. #7958

Merged
merged 3 commits into from
Jun 21, 2024

Conversation

kenzieschmoll
Copy link
Member

@kenzieschmoll kenzieschmoll commented Jun 20, 2024

When a first party DevTools screen is loaded but is not available for the current app, we now show a message explaining why. Before we just silently navigated to a different screen or showed a blank page when embedded.

Now, we show this:
Screenshot 2024-06-20 at 3 40 27 PM

Embedded mode (hide the navigate home button in this case):
Screenshot 2024-06-20 at 3 39 21 PM

Fixes #7879

@kenzieschmoll kenzieschmoll requested a review from a team as a code owner June 20, 2024 23:04
@kenzieschmoll kenzieschmoll requested review from CoderDake and removed request for a team June 20, 2024 23:04
Copy link
Contributor

@DanTup DanTup left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +510 to +512
} else if (reason?.message != null) {
disabledReason = 'The ${screen.title} screen ${reason!.message!}';
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not important, but FWIW using case String is a nice way to avoid the !s here:

if (reason?.message case String message) {
  disabledReason = 'The ${screen.title} screen $message';
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice! will add to a follow up PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh and you can avoid writing the type (String) again like this:

if (reason?.message case final message?) {

@kenzieschmoll kenzieschmoll merged commit bebfe49 into flutter:master Jun 21, 2024
23 checks passed
@kenzieschmoll kenzieschmoll deleted the screen-unavailable branch June 21, 2024 17:03
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.

Memory/Network Page in blank (DevTools)
3 participants