Repository navigation
Fix stale "no timeline event analysis data" message in Frame Analysis tab #10050
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,7 @@ class FlutterFramesController extends PerformanceFeatureController { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// The currently selected timeline frame. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ValueListenable<FlutterFrame?> get selectedFrame => _selectedFrameNotifier; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| final _selectedFrameNotifier = ValueNotifier<FlutterFrame?>(null); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| final _selectedFrameNotifier = _SelectedFrameNotifier(null); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// The flutter frames in the chart. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ValueListenable<List<FlutterFrame>> get flutterFrames => _flutterFrames; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -123,6 +123,12 @@ class FlutterFramesController extends PerformanceFeatureController { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _unassignedFlutterFrames.remove(frameNumber); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _updateFirstWellFormedFrameMicros(frame); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (_selectedFrameNotifier.value == frame) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // [frame] was selected before its timeline events were available. Notify | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // listeners again so that views built from [selectedFrame], like the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Frame Analysis tab, rebuild with the data that is now available. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _selectedFrameNotifier.notifyFrameDataChanged(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bool hasUnassignedFlutterFrame(int frameNumber) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -223,3 +229,16 @@ class FlutterFramesController extends PerformanceFeatureController { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| super.dispose(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Notifier for the selected [FlutterFrame]. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Timeline events are assigned to a [FlutterFrame] in place, which can happen | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// after the frame has been selected. [ValueNotifier] only notifies when | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// [value] changes, and [notifyListeners] is protected, so this subclass | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// exposes [notifyFrameDataChanged] for that case. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class _SelectedFrameNotifier extends ValueNotifier<FlutterFrame?> { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _SelectedFrameNotifier(super.value); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Notifies listeners that the selected frame's data changed in place. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void notifyFrameDataChanged() => notifyListeners(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+239
to
+244
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [MUST-FIX] Calling
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this class is introduced. It only contains a controller which passes the
valueto super, and overrides notifyListeners to call super. On the surface, it looks like a complete no-op from just usingValueNotifier<FlutterFrame?>.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah fair, by itself it does look like a no-op. notifyListeners is
@protectedand@visibleForTestingon ChangeNotifier, so calling it on a plain ValueNotifier from the controller trips invalid_use_of_protected_member and analyze fails. the override was only there to re-expose it (same as ListValueNotifier), but agree that was too hidden, so i swapped it for a named notifyFrameDataChanged() and put the reason in the doc comment 👍