Skip to content

Disable debug buttons in profile mode. #53

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

Closed
wants to merge 1 commit into from

Conversation

kenzieschmoll
Copy link
Member

Also added a null check to prevent an exception.

@kenzieschmoll
Copy link
Member Author

screen shot 2018-12-04 at 2 32 28 pm

@jacob314 jacob314 self-requested a review December 4, 2018 22:35
final Isolate isolate = await serviceInfo.service
.getIsolate(serviceInfo.isolateManager.selectedIsolate.id);

bool isProfileMode;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should create a FlutterApp object that tracks whether the app is debug mode or not.

@@ -46,9 +46,29 @@ class TimelineScreen extends Screen {
PButton resumeButton;

@override
void createContent(Framework framework, CoreElement mainDiv) {
void createContent(Framework framework, CoreElement mainDiv) async {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would be a little concerned about making this method Async. I would expect a reasonable contract is that this method is not async.

);
isProfileMode = !(evaluate is InstanceRef);
} catch (e) {
isProfileMode = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

What exception is thrown? Instead of catching all exceptions verify we got the expected one.

return new PButton(text)
..small()
..disabled = shouldDisableForProfileMode && isProfileMode
..tooltip = isProfileMode ? 'Unavailable on a profile build.' : '';
Copy link
Contributor

Choose a reason for hiding this comment

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

better is to create the UI right away with the button disabled and then enable it async when we verify the app is debug mode.

}

final PButton trackWidgetBuildsButton = createButton('Track widget builds', true);
final PButton perfOverlayButton = createButton('Performance overlay', false);
Copy link
Contributor

Choose a reason for hiding this comment

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

these should be turned on and off by similar logic to VMServiceManager in the Java app instead of triggering based on whether we are in debug or profile mode. That is more robust as potentially flutter will support some or all of these options in profile mode.

@devoncarew
Copy link
Member

Is this PR still relevant or has it been superseded by following PRs?

@kenzieschmoll kenzieschmoll deleted the timeline branch December 19, 2018 16:04
@kenzieschmoll
Copy link
Member Author

PR is obsolete now. Closing.

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.

3 participants