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
c8a4c8b8
Unverified
Commit
c8a4c8b8
authored
Jul 21, 2022
by
Tong Mu
Committed by
GitHub
Jul 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pointer events: Allow hover events from trackpad (#108116)
parent
fc3471fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
events.dart
packages/flutter/lib/src/gestures/events.dart
+4
-5
events_test.dart
packages/flutter/test/gestures/events_test.dart
+11
-0
No files found.
packages/flutter/lib/src/gestures/events.dart
View file @
c8a4c8b8
...
...
@@ -1035,10 +1035,7 @@ class PointerHoverEvent extends PointerEvent with _PointerEventDescription, _Cop
super
.
tilt
,
super
.
synthesized
,
super
.
embedderId
,
})
:
// Dart doesn't support comparing enums with == in const contexts yet.
// https://github.com/dart-lang/language/issues/1811
assert
(!
identical
(
kind
,
PointerDeviceKind
.
trackpad
)),
super
(
})
:
super
(
down:
false
,
pressure:
0.0
,
);
...
...
@@ -1156,7 +1153,9 @@ class PointerEnterEvent extends PointerEvent with _PointerEventDescription, _Cop
super
.
down
,
super
.
synthesized
,
super
.
embedderId
,
})
:
assert
(!
identical
(
kind
,
PointerDeviceKind
.
trackpad
)),
})
:
// Dart doesn't support comparing enums with == in const contexts yet.
// https://github.com/dart-lang/language/issues/1811
assert
(!
identical
(
kind
,
PointerDeviceKind
.
trackpad
)),
super
(
pressure:
0.0
,
);
...
...
packages/flutter/test/gestures/events_test.dart
View file @
c8a4c8b8
...
...
@@ -844,6 +844,17 @@ void main() {
expect
(
event
.
synthesized
,
empty
.
synthesized
);
});
});
test
(
'Ensure certain event types are allowed'
,
()
{
// Regression test for https://github.com/flutter/flutter/issues/107962
expect
(
const
PointerHoverEvent
(
kind:
PointerDeviceKind
.
trackpad
),
isNotNull
);
// The test passes if it compiles.
});
test
(
'Ensure certain event types are not allowed'
,
()
{
expect
(()
=>
PointerDownEvent
(
kind:
PointerDeviceKind
.
trackpad
),
throwsAssertionError
);
});
}
void
_expectTransformedEvent
(
{
...
...
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