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
3243ebe3
Commit
3243ebe3
authored
Nov 06, 2019
by
Taufiq Rahman
Committed by
Michael Goderbauer
Nov 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tap.dart: Fixes the spacing to the right side of reason (#43246)
parent
cf6a8d6a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
tap.dart
packages/flutter/lib/src/gestures/tap.dart
+1
-1
tap_test.dart
packages/flutter/test/gestures/tap_test.dart
+26
-0
No files found.
packages/flutter/lib/src/gestures/tap.dart
View file @
3243ebe3
...
...
@@ -497,7 +497,7 @@ class TapGestureRecognizer extends BaseTapGestureRecognizer {
@protected
@override
void
handleTapCancel
({
PointerDownEvent
down
,
PointerCancelEvent
cancel
,
String
reason
})
{
final
String
note
=
reason
==
''
?
reason
:
'
$reason
'
;
final
String
note
=
reason
==
''
?
reason
:
'
$reason
'
;
switch
(
down
.
buttons
)
{
case
kPrimaryButton:
if
(
onTapCancel
!=
null
)
...
...
packages/flutter/test/gestures/tap_test.dart
View file @
3243ebe3
...
...
@@ -380,6 +380,32 @@ void main() {
tap
.
dispose
();
});
testGesture
(
'onTapCancel should show reason in the proper format'
,
(
GestureTester
tester
)
{
final
TapGestureRecognizer
tap
=
TapGestureRecognizer
();
tap
.
onTapCancel
=
()
{
throw
Exception
(
test
);
};
final
FlutterExceptionHandler
previousErrorHandler
=
FlutterError
.
onError
;
bool
gotError
=
false
;
FlutterError
.
onError
=
(
FlutterErrorDetails
details
)
{
expect
(
details
.
toString
().
contains
(
'"spontaneous onTapCancel"'
)
,
isTrue
);
gotError
=
true
;
};
const
int
pointer
=
1
;
tap
.
addPointer
(
const
PointerDownEvent
(
pointer:
pointer
));
tester
.
closeArena
(
pointer
);
tester
.
async
.
elapse
(
const
Duration
(
milliseconds:
500
));
tester
.
route
(
const
PointerCancelEvent
(
pointer:
pointer
));
expect
(
gotError
,
isTrue
);
FlutterError
.
onError
=
previousErrorHandler
;
tap
.
dispose
();
});
testGesture
(
'No duplicate tap events'
,
(
GestureTester
tester
)
{
final
TapGestureRecognizer
tapA
=
TapGestureRecognizer
();
final
TapGestureRecognizer
tapB
=
TapGestureRecognizer
();
...
...
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