Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
e190327f
Commit
e190327f
authored
Jun 09, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HitTestResult.path should be unmodifiable (#4482)
Fixes #4428
parent
f75fd5c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
hit_test.dart
packages/flutter/lib/src/gestures/hit_test.dart
+6
-5
No files found.
packages/flutter/lib/src/gestures/hit_test.dart
View file @
e190327f
...
@@ -47,14 +47,15 @@ class HitTestResult {
...
@@ -47,14 +47,15 @@ class HitTestResult {
/// If the [path] argument is null, the [path] field will be initialized with
/// If the [path] argument is null, the [path] field will be initialized with
/// and empty list.
/// and empty list.
HitTestResult
({
List
<
HitTestEntry
>
path
})
HitTestResult
({
List
<
HitTestEntry
>
path
})
:
path
=
path
??
<
HitTestEntry
>[];
:
_
path
=
path
??
<
HitTestEntry
>[];
///
Th
e list of [HitTestEntry] objects recorded during the hit test.
///
An unmodifiabl
e list of [HitTestEntry] objects recorded during the hit test.
///
///
/// The first entry in the path is the most specific, typically the one at
/// 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
/// 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.
/// 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.
/// Add a [HitTestEntry] to the path.
///
///
...
@@ -62,9 +63,9 @@ class HitTestResult {
...
@@ -62,9 +63,9 @@ class HitTestResult {
/// be added in order from most specific to least specific, typically during an
/// be added in order from most specific to least specific, typically during an
/// upward walk of the tree being hit tested.
/// upward walk of the tree being hit tested.
void
add
(
HitTestEntry
entry
)
{
void
add
(
HitTestEntry
entry
)
{
path
.
add
(
entry
);
_
path
.
add
(
entry
);
}
}
@override
@override
String
toString
()
=>
'HitTestResult(
${
path.isEmpty ? "<empty path>" :
path.join(", ")}
)'
;
String
toString
()
=>
'HitTestResult(
${
_path.isEmpty ? "<empty path>" : _
path.join(", ")}
)'
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment