Workaround for timeline bar chart selection bug#1382
Merged
kenzieschmoll merged 3 commits intoflutter:masterfrom Nov 21, 2019
Merged
Workaround for timeline bar chart selection bug#1382kenzieschmoll merged 3 commits intoflutter:masterfrom
kenzieschmoll merged 3 commits intoflutter:masterfrom
Conversation
jacob314
reviewed
Nov 21, 2019
packages/devtools_app/lib/src/timeline/flutter/flutter_frames_chart.dart
Outdated
Show resolved
Hide resolved
jacob314
reviewed
Nov 21, 2019
| void refreshContent(Entry e, Highlight highlight) { | ||
| void refreshContent(Entry e, Highlight highlight) async { | ||
| _entry = e; | ||
| final frameIndex = _entry.x.toInt(); |
Contributor
There was a problem hiding this comment.
is x a double or is it just typed as a num?
Contributor
There was a problem hiding this comment.
if it is really an int, probably better to wrote
final int frameIndex = _entry.x;
jacob314
reviewed
Nov 21, 2019
packages/devtools_app/lib/src/timeline/flutter/flutter_frames_chart.dart
Outdated
Show resolved
Hide resolved
jacob314
reviewed
Nov 21, 2019
packages/devtools_app/lib/src/timeline/flutter/flutter_frames_chart.dart
Outdated
Show resolved
Hide resolved
| void onBarSelected(int index) { | ||
| // TODO(terry): this is a hack. See | ||
| // https://github.com/flutter/devtools/issues/1381. | ||
| Timer( |
Contributor
There was a problem hiding this comment.
WidgetsBinding.instance.addPostFrameCallback should help here.
If the chart library is calling this during build or paint, then we want to schedule the callback for after the current frame is painted.
Member
Author
There was a problem hiding this comment.
this worked thanks dave!
packages/devtools_app/lib/src/timeline/flutter/flutter_frames_chart.dart
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

See #1381 for bug details.
This CL also