mirror of
https://github.com/flutter/flutter
synced 2024-10-14 04:02:56 +00:00
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.
This commit is contained in:
parent
a8aff38811
commit
5066750063
|
@ -247,28 +247,34 @@ class _WidgetInspectorState extends State<WidgetInspector>
|
|||
class InspectorSelection {
|
||||
/// 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> _candidates = <RenderObject>[];
|
||||
set candidates(List<RenderObject> value) {
|
||||
_candidates = value;
|
||||
index = 0;
|
||||
}
|
||||
|
||||
List<RenderObject> _candidates = <RenderObject>[];
|
||||
|
||||
/// Index within the list of candidates that is currently selected.
|
||||
int index = 0;
|
||||
|
||||
/// Set the selection to empty.
|
||||
void clear() {
|
||||
_candidates = <RenderObject>[];
|
||||
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 {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue