Skip to content

Conversation

@jacob314
Copy link
Contributor

Avoid cases where setState was called on disposed object.
Avoid cases where the inspector wouldn't render as it was called
after the first frame rendered and no other frames were rendered.

Avoid cases where setState was called on disposed object.
Avoid cases where the inspector wouldn't render as it was called
after the first frame rendered and no other frames were rendered.
bool get _reportFirstFrame => _deferFirstFrameReportCount == 0;

/// Whether the first frame has finished rendering.
bool get debugDidSendFirstFrameEvent => !_needToReportFirstFrame;
Copy link
Contributor

Choose a reason for hiding this comment

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

These docs should mention:

  • that this is only valid in debug and profile builds, it can't be used in release builds
  • that it can be deferred using [deferFirstFrameReport] and [allowFirstFrameReport]
  • that it is set at the end of the call to drawFrame

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

/// appropriate to display the Widget tree in the inspector.
bool isWidgetTreeReady([String groupName]) {
return WidgetsBinding.instance != null &&
WidgetsBinding.instance.debugDidSendFirstFrameEvent;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: vertical alignment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

} else {
// It isn't safe to trigger the selection change callback if we are in
// the middle of rendering the frame.
WidgetsBinding.instance.scheduleTask(
Copy link
Contributor

Choose a reason for hiding this comment

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

probably better to use SchedulerBinding here (the result is the same but it's more idiomatic)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

/// as selecting the edge of the bounding box.
static const double _kEdgeHitMargin = 2.0;

InspectorSelectionChangedCallback selectionChangedCallback;
Copy link
Contributor

Choose a reason for hiding this comment

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

why not a (private) method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be private. done.

Copy link
Contributor Author

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

ptal

@devoncarew
Copy link
Contributor

@jacob314, @Hixie, we'll need to land this before the IntelliJ plugin release (which we really hope to do tomorrow)

@Hixie
Copy link
Contributor

Hixie commented Jan 19, 2018

LGTM

Bonus points for a test, but I'm not sure how you'd test this really.

@jacob314
Copy link
Contributor Author

Its on my list to create some good inspector integration tests that can verify these sorts of cases as well as verifying that widget creation locations are right once that CL lands.

@jacob314 jacob314 merged commit 2e4522f into flutter:master Jan 19, 2018
DaveShuckerow pushed a commit to DaveShuckerow/flutter that referenced this pull request May 14, 2018
* Inspector robustness fixes.
Avoid cases where setState was called on disposed object.
Avoid cases where the inspector wouldn't render as it was called
after the first frame rendered and no other frames were rendered.
engine-flutter-autoroll added a commit that referenced this pull request Dec 6, 2019
…utter/engine#14154) (#46220)

git@github.com:flutter/engine.git/compare/fd240d0d532a...ed2d00b

git log fd240d0..ed2d00b --first-parent --oneline
2019-12-06 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/mac-amd64 from qQlb5... to VKso5... (#14154)


If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC chinmaygarde@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants