@@ -47,14 +47,15 @@ class HitTestResult {
|
||||
/// If the [path] argument is null, the [path] field will be initialized with
|
||||
/// and empty list.
|
||||
HitTestResult({ List<HitTestEntry> path })
|
||||
: path = path ?? <HitTestEntry>[];
|
||||
: _path = path ?? <HitTestEntry>[];
|
||||
|
||||
/// The list of [HitTestEntry] objects recorded during the hit test.
|
||||
/// An unmodifiable list of [HitTestEntry] objects recorded during the hit test.
|
||||
///
|
||||
/// The first entry in the path is the most specific, typically the one at
|
||||
/// the leaf of tree being hit tested. Event propagation starts with the most
|
||||
/// specific (i.e., first) entry and proceeds in order through the path.
|
||||
final List<HitTestEntry> path;
|
||||
List<HitTestEntry> get path => new List<HitTestEntry>.unmodifiable(_path);
|
||||
final List<HitTestEntry> _path;
|
||||
|
||||
/// Add a [HitTestEntry] to the path.
|
||||
///
|
||||
@@ -62,9 +63,9 @@ class HitTestResult {
|
||||
/// be added in order from most specific to least specific, typically during an
|
||||
/// upward walk of the tree being hit tested.
|
||||
void add(HitTestEntry entry) {
|
||||
path.add(entry);
|
||||
_path.add(entry);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => 'HitTestResult(${path.isEmpty ? "<empty path>" : path.join(", ")})';
|
||||
String toString() => 'HitTestResult(${_path.isEmpty ? "<empty path>" : _path.join(", ")})';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user