Commit 50667500 authored by Jacob Richman's avatar Jacob Richman Committed by GitHub

Add comments to 3 methods that were missing comments. (#11737)

* Add comments to 3 methods that were missing comments.

Fix out of order (getter, private field, setter) tuple

* Code review fix.
parent a8aff388
...@@ -247,28 +247,34 @@ class _WidgetInspectorState extends State<WidgetInspector> ...@@ -247,28 +247,34 @@ class _WidgetInspectorState extends State<WidgetInspector>
class InspectorSelection { class InspectorSelection {
/// Render objects that are candidates to be selected. /// Render objects that are candidates to be selected.
/// ///
/// Tools may wish to iterate through the list of candidates /// Tools may wish to iterate through the list of candidates.
List<RenderObject> get candidates => _candidates; List<RenderObject> get candidates => _candidates;
List<RenderObject> _candidates = <RenderObject>[];
set candidates(List<RenderObject> value) { set candidates(List<RenderObject> value) {
_candidates = value; _candidates = value;
index = 0; index = 0;
} }
List<RenderObject> _candidates = <RenderObject>[];
/// Index within the list of candidates that is currently selected. /// Index within the list of candidates that is currently selected.
int index = 0; int index = 0;
/// Set the selection to empty.
void clear() { void clear() {
_candidates = <RenderObject>[]; _candidates = <RenderObject>[];
index = 0; index = 0;
} }
/// Selected render object from the [candidates] list.
///
/// Setting [candidates] or calling [clear] resets the selection.
///
/// Returns null if the selection is invalid.
RenderObject get current { RenderObject get current {
return candidates != null && index < candidates.length ? candidates[index] : null; return candidates != null && index < candidates.length ? candidates[index] : null;
} }
/// Whether the selected render object is attached to the tree or has gone
/// out of scope.
bool get active => current != null && current.attached; bool get active => current != null && current.attached;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment